[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Local Procedures



Jim

Cool.  That is my problem then. Apparently, SQR does not like the redundant use 
of LOCAL when it is already implied.  Hmmm... how would I then declare the 
procedure non-local when passing parameters?

In any event, thanks for the info!  VERY helpful for me. I was a PowerHouse 
developer on the VMS side for many years and most recently (last 4 years) doing 
the web consultant thing in Seattle (ASP, VBScript, etc).  I just started here 
about 12 weeks ago so am relatively new to SQR (though I am told I am learning 
very quickly).

I definitely do the self contained thang. I think of it as supporting the 
long-term integrity of applications. So I am really trying to get this local 
procedure and parameter passing to work here (and hopefully motivate others to 
do the same). One additional question, can one write functions in SQR? From 
what I have read, the answer is no.  I would like to do something like:

IF NewHire(emplid)
   do de da de dum
END-IF

...where NewHire returns true or false (similar to my VB days)?

>If you have a begin-select in a local procedure, selected column names are
>not seen by the rest of the program.

Wow, this explains the errors I have been getting...

The static variable thing is also good to know. I am particularly fond of 
recursion (LISP was one of my favorite languages in the 80's).


>If you wish to refer to a global variable from within a local procedure and
>you do not wish to pass that variable in as a parameter, you must place an
>underscore in the variable name after the type identifier, so the variable
>#Price becomes #_Price.  This makes locating all references to a global
>variable interesting, since you now have to search for BOTH names.  I would
>pass ALL variables in if possible.

OK. Cool. Not too hard to work around.


>If you use arrays, then believe it or not, the arrays are referenced exactly
>the same way inside local procedures as they are outside them!  Go figure!

Hmmm. Can I assume that all arrays are globals???  Or just that globally 
defined arrays are accessed without the underscore?

Thanks for the help Jim. This message was a gold mine for me. Some of this was 
not well explained in the book. I am already starting to push SQR to its limits 
here and many of your comments here resolved some of my issues and 
misunderstandings with this language. Thanks!

-Ken
boettgek@cwu.edu