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.
LET is a way of creating substitutes. For instance, if I specify LET RP=TABLE, I could code RP FILE CAR PRINT * It means that RP gets substituted by TABLE at runtime.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Yes, it is a legacy thing. Although I know that it exists, I never use it. It used to work fine with Focus, but I tried it once in WebFocus and it failed for some odd reason. So I decided to let LET be and never used it again.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
As mentioned, the use of LET will create a substitution. In the case of:
LET NOPRINT=;
a substitution is generated so that when FOCUS sees NOPRINT, it will be replaced by blank. This is an interesting way to prevent people from using NOPRINT in their code. Try this:
LET NOPRINT=; TABLE FILE CAR PRINT COUNTRY NOPRINT END
Notice that COUNTRY will still show up in the output.
Cheers,
Kerry
Kerry Zhan Focal Point Moderator Information Builders, Inc.
Posts: 1948 | Location: New York | Registered: November 16, 2004
While LET is cool, I never had much use for it except for OS commands. For example, say one wants to delete a file. In Windows one might do:
-DOS DEL path/filename
while in UNIX or Linux it would be
-UNIX rm path/filename
One could put the following in the edasprof
LET OSDEL=-UNIX rm
and use the following in the code:
OSDEL path/filename
So if the code might run on a Windows and a Linux reporting server, doing something like this keeps one from having to change code when moving between environments. All one has to do is change OSDEL in the edasprof of the Reporting Server.
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, 2006
I'd say it's a fairly powerful debugging tool. Say you have a graph that doesn't display what it should be displaying. You put
LET GRAPH=TABLE;
in your fex and you can see what values it's using.
I haven't tried, but you could for example conditionally create a GRAPH or a TABLE. Like so:
-GOTO TYPE_&OUTPUTFORMAT
-TYPE_TABLE
LET OUTPUT = TABLE;
LET FMT = HTML;
-GOTO TYPE_END
-TYPE_GRAPH
LET OUTPUT = GRAPH;
LET FMT = PNG;
-TYPE_END
OUTPUT FILE CAR
PRINT WIDTH
BY LENGTH
ON TABLE PCHOLD FORMAT FMT
END
Of course you need to be very careful not to accidentally overwrite a core Focus command, that would give some interesting results for sure!
You can do the same using ampersand-variables, but you'll frequently find you need to eval them.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
As a software engineer I find the use of LET to be a great trick. As a manager of many software engineers I would bar the use of LET in any production software.
Think of the poor guy trying to maintain a 500 line fex who sees GRAPH ... but getting TABLE?!?! All because much further up in the fex there is a -INCLUDE and the included file did some trickery that CHANGES the language.
If you use &VARs the subsequent readers KNOW there is a substitution.
(getting off my sandbox).
Brian Suter VP WebFOCUS Product Development
Posts: 200 | Location: NYC | Registered: January 02, 2007
Certainly true, it's as powerful a tool as it is dangerous.
I also just found out that you apparently can't use it for number formatting :/
-* File let.fex
TABLE FILE CAR
PRINT WEIGHT/P12.2
BY CAR
END
LET WGT = P12.2
TABLE FILE CAR
PRINT WEIGHT/WGT
BY CAR
END
-*0 ERROR AT OR NEAR LINE 10 IN PROCEDURE let FOCEXEC *
-*(FOC035) ERROR IN THE FORMAT OF THE COMPUTED FIELD DEFINITION: WEIGHT/WGT
-*BYPASSING TO END OF COMMAND
-*(FOC009) INCOMPLETE REQUEST STATEMENT
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :