Guest Posted July 29, 2021 Share Posted July 29, 2021 Here are a couple of FocalPoint discussions about the LET command. Could be useful for testing and debugging. I agree with Brian Suters post where he says: 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. What is the use of LET NOPRINT LET command problem Link to comment Share on other sites More sharing options...
VisuaLizeFOCUS . Posted July 29, 2021 Author Share Posted July 29, 2021 LET command and how we can use it in WebFOCUS. I have never used this command and was just curious how and where we can use it Link to comment Share on other sites More sharing options...
Warren Hinchliffe Posted July 30, 2021 Share Posted July 30, 2021 (edited) The LET command can replace any WebFOCUS (FOCUS) command. Actually any work that is not dialog manger. Another link to an example with LET. Fun with LET Edited October 4 by Warren Hinchliffe Link to comment Share on other sites More sharing options...
Douglas Lee 2 Posted July 30, 2021 Share Posted July 30, 2021 My first use of this was during a course at IBI HQ (1250 Broadway) When I was asked to write, on the white board, a short fex which when like this: TFC SUM DCOST RCOST BY CAR BY COUNTRY BY MODEL END Of course, that TFC was LET TFC = TABLE FILE CAR Oh, the memories of simplicity Link to comment Share on other sites More sharing options...
john cullen Posted July 31, 2021 Share Posted July 31, 2021 Rajesh, I would be cautious using LET. While it allows global substitution, it can also make unintended results when a LET starts changing your syntax. And, it can start to paint you into a corner once you start using LETs because, if you ever change the LET, you will be then changing all your code. LET used to be documented in the old days. Today it would be called an undocumented or legacy feature. It was likely undocumented for a reason. To me, the reason for LET is gone. Let used to be when we had the >> focus prompt to save on typing. You could type a procedure right on a command line, without using a line editor. LET made sense then to save on typing. Or, you could open a line editor (who remembers TED), and just type your code. So LET does allow global substitution. Just remember, once you implement a LET and start using it in your code, you will be stuck with a LET. I just dont think a LET is a good idea, unless you are in an impossible situation. Summary, I basically refuse to use a LET command. Just call it a old trick that should no longer be used. Link to comment Share on other sites More sharing options...
Warren Hinchliffe Posted August 1, 2021 Share Posted August 1, 2021 An interesting use of LET would be LET NOPRINT = '. This would disable all NOPRINT usage. I found it in some code a while back. Link to comment Share on other sites More sharing options...
VisuaLizeFOCUS . Posted August 2, 2021 Author Share Posted August 2, 2021 Thanks, guys for the response It was some really interesting knowledge Link to comment Share on other sites More sharing options...
Toby Mills Posted August 2, 2021 Share Posted August 2, 2021 I first was told to use LET a long time ago when doing an app that would be converted to Spanish. The idea was to use LET to swap Spanish for English. It wasnt a great idea really. Also as John points out, there are a few things that might surprise you with LET. For example, I think it uses the same general part of core FOCUSs brain that JOINs use (or was it DEFINEs). So if you LET CLEAR *, you could clear your JOINs or maybe that was vice versa. Id have to go look. Or maybe it doesnt even apply anymore. The idea of LET was that we might use abbreviations for common phrases like TABLE FILE as TF (as Doug pointed out). Really, these days I dont know that we really get much value out of that since we use GUI tools more often. Id tend to agree with John - Id just stay clear of them unless theres some really compelling reason to use them. Just my 2 cents. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now