[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Local Procedures
- Subject: Re: Local Procedures
- From: James Womeldorf <jwomeldo@FASTENAL.COM>
- Date: Fri, 5 Apr 2002 21:32:06 -0600
Ken,
Glad the stuff helped. I'm pretty sure there is no way to pass parameters
and still have a 'public' procedure. Also, no real functions, at least not
in 4.3.4. Wish there were. There are a lot of things I'd change about SQR
if I could, but there are some pretty neat things in there that I like.
I'm pretty sure all arrays are global. Period.
I, too, did some work in LISP in the early '90s to the point where I could
hardly think iteratively. I still like to 'recurse' whenever possible. You
can get so much work done with so little code!
If you don't have one you should consider getting a copy of 'SQR in
PeopleSoft and Other Applications' by Landres and Landres published by
Manning. Even if you are not doing PeopleSoft the book should be very
helpful. The vast majority of it is non-PeopleSoft specific. I began the
SQR phase of my career using this book and was eventually sent to an SQR
class which was helpful, but the book is still within reach all the time.
As you may have discovered, there is not much available in the bookstores.
Greet the Space Needle for me. I worked in Seattle a couple summers during
my college years and harbor very fond memories of the Great Northwest.
Jim
-----Original Message-----
From: Ken Boettger [mailto:BoettgeK@CWU.EDU]
Sent: Friday, April 05, 2002 7:13 PM
To: SQR-USERS@list.iex.net
Subject: 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