Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] what is the use of LET NOPRINT
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] what is the use of LET NOPRINT
 Login/Join
 
Member
posted
Hi All,

what is the use of LET in 'LET NOPRINT '.

thanks
RP

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


webfocus 7.6.9 windows XP Excel
 
Posts: 22 | Registered: July 22, 2009Reply With QuoteReport This Post
<JG>
posted
Without a right hand component it means nothing.

What's to the right of the =

Is it

LET NOPRINT = ;
LET NOPRINT = 'Happy Christmas'

Where is it coded

in a focexec or edasprof.prf or another profile file?
 
Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Master
posted Hide Post
Eeker

That is useful, we use &qout;param for these kind of constructions...

Why isn't LET documented?
(it's not to be found in the 'help')

Legacy?


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 669 | Location: Veghel, The Netherlands | Registered: February 16, 2010Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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 7 - IE11.
in Focus since 1988
 
Posts: 1960 | Location: Netherlands | Registered: September 25, 2007Reply With QuoteReport This Post
Master
posted Hide Post
Like the Beatles would say..

Let LET be.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 669 | Location: Veghel, The Netherlands | Registered: February 16, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
Hi RP,

Suggestion from our technicals:

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: 1950 | Location: New York | Registered: November 16, 2004Reply With QuoteReport This Post
<JG>
posted
Old, no documentation number and notice the word legacy in the URL

WebFOCUS Defining a Word Substitution

This message has been edited. Last edited by: <JG>,
 
Reply With QuoteReport This Post
Master
posted Hide Post
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: 919 | Location: Oklahoma City | Registered: October 27, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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 :
 
Posts: 1643 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Platinum Member
posted Hide Post
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, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
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 :
 
Posts: 1643 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] what is the use of LET NOPRINT

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.