Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     DM Challenge to IB Developers
Page 1 2 

Read-Only Read-Only Topic
Go
Search
Notify
Tools
DM Challenge to IB Developers
 Login/Join
 
Master
posted
Can we have

-BLOCK_IF expression ;

-BLOCK_ELSE_IF expression ;

-BLOCK_ELSE
-BLOCK_END_IF

Sometime or even just.

-BLOCK_IF

-BLOCK_ENDIF

This one should be easy as well

-PERFORM label
.
.
.
-label

-RETURN

Can all this be done with a simple push down stack of the current line to be executed.

For reasons unknown, this might be harder than I think - if so could someone post reasons.

It may be because fixing this is not seen as a selling point - however when I show other programmers the -GOTO based syntax in DM, people start to dismiss wf as a cosmetic job on some Mainframe dinosaur language.



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Platinum Member
posted Hide Post
DM HAS been around since the dinosaur mainframe days - early 80's I think. The FOCUS core language and DM are still the heart of the WF product - and there's really nothing wrong with that at all.

http://en.wikipedia.org/wiki/FOCUS

I suppose you could always request CASE/subroutine DM usage as a new feature - makes sense to me.

All these years I still hear people bad mouth FOCUS. These are the same people who also think PERL, PHP, Python are also "dinosaur" languages and are also probably the ones who think anything without a GUI isn't worth using as a programming tool.

It's just different.


WebFOCUS 7.6.6/TomCat/Win2003,SQL Server 2005,Oracle
 
Posts: 125 | Location: New England | Registered: February 20, 2007Report This Post
Gold member
posted Hide Post
Hallo!

DM is very frustrating and not for only novices.

I suppose that's the better thing can be done - freeze this language.
It's good enough for some tasks, but many times I've thought how much better if instead of DM was some modern dynamic-typed language.

Python, Perl, Ruby, server-side JavaScript, Lua - all are good enough.

Maybe like embeddable module allowing substitute DM, maybe like in CGI-scripts - first comment is about script-language (by default - DM)


WF 7.6.2, WinNT/2K, MSSQL 2K, MSOLAP 2K, BID
 
Posts: 79 | Location: Moscow | Registered: April 27, 2007Report This Post
Master
posted Hide Post
quote:
-PERFORM label
.
.
.
-label

-RETURN

Can all this be done with a simple push down stack of the current line to be executed.


This is the crucial one that would produce huge returns on a minimal effort.

Infact I would say it's the biggest cost benefit that could be realised in the whole of WebFOCUS.

A good coder could do this in less than a day since the dm processor will have address of next statement available.

1. -PERFORM label

is

PUSH next statement
-GOTO label

2. -RETURN

is

POP next statement
-GOTO next statement



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Virtuoso
posted Hide Post
In the old days, and I haven't done this for years, we used to do:
-TYPE 1
-SET &RETURN = ':LABEL1';
-GOTO :LABEL2
-:LABEL1
-*
-TYPE 2
-*
-EXIT
-*
-:LABEL2
-*
-TYPE 3
-*
-GOTO &RETURN

or something like that, to try and emulate the GOSUB effect. Now I can't be bothered.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
It would not be such a radical departure from the current DM language. An inline-block-oriented control structure already exists:

-REPEAT label n TIMES
...
-label

When n evaluates to false (=0) or or true (=1), this accomplishes the same as the missing inline conditional execution structure.

But at present (7.6.5) n has to be a constant or a DM variable; expressions are not allowed.

Allowing n to be a parenthesized DM expression that yields an integer would not seem to be such a challenge.


And/or, establish a suitable syntax for conditional execution, say

-DO label IF condition;
...
-label

and handle its execution like

-REPEAT label (condition) times.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Platinum Member
posted Hide Post
Hi

I know using GOTOs feels ancient, but doesn't this accomplish exactly what you want? Am I missing something?

Jodye

-SET &ECHO=ALL;
-SET &X=2;

-IF &X=1 THEN GOTO DO_1 ELSE IF &X=2 THEN GOTO DO_2 ELSE GOTO DO_ELSE;

-DO_1;
-TYPE DO_1
-*CODE GOES HERE
-GOTO ALLDONE;

-DO_2;
-TYPE DO_2
-*CODE GOES HERE
-GOTO ALLDONE;

-DO_ELSE;
-TYPE DO_ELSE
-*CODE GOES HERE

-ALLDONE;
-TYPE ALLDONE

-EXIT


WF 8.0.0.5M
 
Posts: 246 | Location: Montreal, QC, Canada | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
John,

Between Alan and Jodye one can have all the constructs that one might need. Also, never forget that DM is a pre-processor, a sort of "conditional assembly" that generates the code that will later run against data files. The whole concept of DM is a very powerful one and very few languages can match it.
As for those who look down upon GOTOs, let them try to do with their tools what WF can do with DM.

And a little caveat for Jodye. I know that DM will accept -IF &X=1 THEN GOTO ... but the correct syntax is -IF &X EQ 1 THEN GOTO ...
Also a semi-colon should not appear after a label.
One day, a "tighter" version of WF might not accept it and then OUCH!


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
HERE'S the link to the doc on looping
http://documentation.informationbuilders.com/masterinde..._lang436/02cat97.htm
the REPEAT WHILE might be work exploring, john.
i agree whole-heartedly with jodye and alan et.al., DM (being careful to distinguish DM Dialogue Manager from DM Data Migrator) is infinitely flexible and pricelessly valuable, and Danny's well-said explanation that "its a 'pre-processor' that actually structures the code" puts this tool in the proper perspective for the newbies.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
I agree on some user complain that DM is not so easy if you are used to modern tools, but a good start would be reading the manuals and ask for a proper course before diving into the coding.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
A a dinosaur myself (started on MF Focus 4.5), I agree with Danny.

DM is a scripting language, and with that you can do almost anything, including have DM create or manipulate your reports on the fly.

Just keep in mind that this is FOCUS not "Python, Perl, Ruby, server-side JavaScript, Lua".

If you want to use those, call them from DM. Smiler

Why not try to think like a Focus programmer, learn and use DM. With a little imagination you can accomplish anything. Idea


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Waz!

quote:

Why not try to think like a Focus programmer, learn and use DM. With a little imagination you can accomplish anything.


I agree with you wholeheartedly: DM is for the WF magicians: there is no limit. Add to that techniques such as "McGuyver" and "alternate masters" and it is an always renewed challenge with much gratification.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Master
posted Hide Post
I agree that you can build all modern computing structures with an IF and a GOTO but it is messy and error prone in that logic has to be reversed which is why those new structures were created.

Alan B

Your construct is fine if you have one level of invocation; you would need a stack structure to fully implement psuedo-perform. But your example is very clear in showing how simple it would be for IBI developers to implement.

There is no reason why modern constructs cannot be entered into dm. It is merely a pre-processor of which many languages make use eg C, PL/1 etc but a pre-processor is doubly ideal for an interpreted language since you have code that writes code.

Again out of the box great thinking to come up with using REPEAT WHILE as a simple if block (you would have to disable the condition in the block at some point to ensure only one iteration).

The problem I find with this is that it confuses someone who is maintaining your code and unless it is a standard becomes very difficult to justify.

The other type of IF block I use (got idea off forum) is

-SET &CMNT = IF condition THEN ' ' ELSE '-*' ;
&CMNT.EVAL code1
&CMNT.EVAL code2
...

This message has been edited. Last edited by: hammo1j,



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
Gold member
posted Hide Post
Hallo all!
Excuse me, my post was not right thread.

But my opinion remains the same - DM is ...
(it's just a simple preprocessing language. Maybe TOO simple)

I can't understand about "dinosaurs" - most of modern languages influenced by Scheme, Lisp, Smalltalk
I can't understand this "Think like FOCUS programmer".

I'm a fan of FOCUS - it's really powerful language.
I'm not a fan of DM.
And FOCUS is NOT easy, DM IS easy.

And it's so easy today to find good embeddable dynamic-typing language.
With good IO, elegant syntax, powerful string manipulations.


WF 7.6.2, WinNT/2K, MSSQL 2K, MSOLAP 2K, BID
 
Posts: 79 | Location: Moscow | Registered: April 27, 2007Report This Post
Virtuoso
posted Hide Post
While I am not opposed to change, I believe that the adage "If it ain't broke, don't fix it" applies very well. They could add some additional functionality to DM that may make some things easier - and then you have more DM commands that you needs to know i.e. more complexity. I could simply ignore the new stuff if I chose to do so. Smiler

With the handful of DM commands that currently exist, all of the funtionality mentioned above can be accomplished. It has existed for thirty-some years with little change, which can be said for VERY few languages/software packages. The highly complex applications I have created simply would not be possible without DM, so in my mind, the FOCUS language and DM are inseparable.

Like butter and toast - if I can't have butter on my toast, I'll skip the toast for today.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Platinum Member
posted Hide Post
As one who got started with those 'oldies' like BAL, RPG, Fortran, PL/1, COBOL, Clist, and EXEC (and never got into the new stuff like Java, Perl, C, and C++), I think of DM as the programming language that writes your program code.

Programming your program ... what a concept, what flexability, what power!


WIN/2K running WF 7.6.4
Development via DevStudio 7.6.4, MRE, TextEditor.
Data is Oracle, MS-SQL.
 
Posts: 154 | Location: NY | Registered: October 27, 2005Report This Post
Expert
posted Hide Post
quote:
DM ROCKS!!!

Its good to know I am in the company of other purists.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
Don't know about the purity of DM, but it certainly enables the good old-fashioned focus users to do whatever they need to do.
And yes, maybe it would be nice to have some funtionality added that could make our life a little bit easier. Until then we;l just keep on using our existing knowledge of the language and be happy with it.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Gold member
posted Hide Post
I suppose that I'm misunderstood.

I think that:

1. DM is good enough. It does not needed to add functionality in it.
2. It should be good if there was alternatives.

Let me explain second point.
I can even today run scripts written in Perl, python, ruby etc... Because DM can run external programs.

Problem is efficiency - most of this languages have long start. Start interpreter, load script, compile P-code, run P-code in VM ..

This problem not exists when language is embedded. Lua, for example, adds only 4Kb(!) to binaries.
Look at
list of applications using Lua in this mode.

I'm a fan of python.
And I'm thinking now about writing python-FOCUS bridge. Python for IO, SOAP, string manipulation (generation FOCUS statements on fly, master-file definitions on fly, SQL on fly) , FOCUS - for databases and final output.

When I get results, I'll wrote about this.

Best regards,
Alex


WF 7.6.2, WinNT/2K, MSSQL 2K, MSOLAP 2K, BID
 
Posts: 79 | Location: Moscow | Registered: April 27, 2007Report This Post
Platinum Member
posted Hide Post
I LOVE DM!! It's the heart and soul of FOCUS and WF. And it's FUN to code! Smiler


WF 7.7.05
HP-UX - Reporting Server, Windows 2008 - Client, MSSQL 2008, FOCUS Databases, Flat Files
HTML, Excel, PDF
 
Posts: 149 | Location: Dallas, TX | Registered: June 08, 2007Report This Post
Gold member
posted Hide Post
cburtt,

"Programming your program" this concept have name - Metaprogramming.

It's old as programming itself.
In lisp-family - it's the main concept. "Programmable programming language"

Most languages have support for metaprogramming of some kind. Some strong, some weak.

DM support for metaprogramming is quite weak. Because it's all about string manipulation and DM does not very good for this tasks


WF 7.6.2, WinNT/2K, MSSQL 2K, MSOLAP 2K, BID
 
Posts: 79 | Location: Moscow | Registered: April 27, 2007Report This Post
Platinum Member
posted Hide Post
quote:

And a little caveat for Jodye. I know that DM will accept -IF &X=1 THEN GOTO ... but the correct syntax is -IF &X EQ 1 THEN GOTO ...
Also a semi-colon should not appear after a label.


You know what.. I have a nasty habit of sometimes using EQ and sometimes =. It gets me into trouble all the time. And I always use a semicolon with a label and it always works. I guess it is not required though.

I agree with everyone else. DM feels like it is super old... with the gotos. But you can accomplish anything.

Reminds me of learning BASIC in school. Hey anyone else remember LOGO? Man I used to have fun with that in 1983 or so...

http://en.wikipedia.org/wiki/Logo_(programming_language)


WF 8.0.0.5M
 
Posts: 246 | Location: Montreal, QC, Canada | Registered: October 01, 2003Report This Post
Virtuoso
posted Hide Post
Sure I remember LOGO. I even wrote a whole set of functions to output Mandelbrot fractals!


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
Danny , you are coming to summit yes??? You i gotta meet!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
quote:
This one should be easy as well

-PERFORM label
.
.
.
-label

-RETURN



I too, would very much like to see a PERFORM command in Dialog Manager.

I've gotten used to that type of program structuring in Maintain and other languages.

I believe that it promotes better code, both for ease of design, writing, self documentation, and later maintenance. Sure I can write programs with -GOTO's, but I've never been happy with them since I got used to performs, functions, procedures, and such. If IBI can expand DM without a lot of pain, they should do so.

Its not like they have a Microsoft-like lock on the BI market, they need to do all they can to make WebFocus a better product, for many types of programmers !


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
 
Posts: 165 | Location: Detroit Metro | Registered: September 17, 2003Report This Post
Expert
posted Hide Post
Expanding DM would be great, I remember when I first found out about -REPEAT, it was brilliant.

Several years ago, I heard a rumer that DM would be dropped (I think from Dev Studio).

The important thing is that you can still code the process, even if the a single command doesn't exist.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Virtuoso
posted Hide Post
For the PERFORM enthusiasts an idea with a bit of code:
  
-* File perform1.fex
-SET &PERFORM='-GOTO ';
-SET &RETURN='-GOTO ';
-*
-* LOTS OF CODE
-*
-SET &BACK='#NEXT1';
&PERFORM.EVAL #ABC
-#NEXT1
-TYPE RETURNED HERE
-SET &BACK='#NEXT2';
&PERFORM.EVAL #XYZ
-#NEXT2
-TYPE RETURNED ELSEWHERE
-*
-* LOTS OF CODE
-*
-SET &BACK='#NEXT3';
&PERFORM.EVAL #ABC
-#NEXT3
-TYPE RETURNED AGAIN
-*
-EXIT
-*
-#ABC
-TYPE ARRIVED THERE
&RETURN.EVAL &BACK
-*
-#XYZ
-TYPE ARRIVED FURTHER
&RETURN.EVAL &BACK


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
I take it that you are very busy then Daniel? Wink

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Master
posted Hide Post
You guys are making this too hard. Want to do a PERFORM? Just do a -INCLUDE.

Take the code you want to PERFORM, put it in its own fex and do a -INCLUDE.

You can even make the command conditional. Here's some pseudo code.
-SET &PERFORM=IF TEST IS TRUE THEN'-INCLUDE FEXNAME' ELSE '-*';
&PERFORM.EVAL


You can even take it one step further and have FEXNAME be conditional.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Virtuoso
posted Hide Post
Tony,
A roundabout way to say, toungue-in-cheek, that in 99% of the procedures, a PERFORM is not really necessary. Wouldn't you agree?
BTW, coming to the Summit?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
  Powered by Social Strata Page 1 2  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     DM Challenge to IB Developers

Copyright © 1996-2020 Information Builders