Jump to content

LET command and how we can use it in WebFOCUS. I have never ...


VisuaLizeFOCUS .

Recommended Posts

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...