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

Re: [sqr-users] Reset all variables in the program.



Thank you very much. I was suspecting that there is no such command. 
Apparently, I did not write the programs.
Thanks again.

Ray Ontko <rayo@ontko.com> wrote:
Aleksandr,

The short answer is "No, and it's worse than you may think."

There is no command to reset all your global variables. CLEAR-ARRAY
works for arrays, but that's all you get.

To make matters worse, all local variables (in procedures) will also
retain their values from call to call. If you have procedures that
you normally only call once, you may want to make sure that they also
intialize all variables before use.

To avoid this problem, I always initialize variables before use.

Does anyone out there have a utility for finding uninitialized 
variables that Aleksandr could use?

Ray

On Tue, Sep 20, 2005 at 07:14:59PM -0700, Aleksandr Slobodyanik wrote:
> Hi.
> I am modifying several programs that we run periodically for the number of 
>clients.
> I have to run every SQR separately for each client. If I have 20 clients, and 
>4 programs, I have to run them 80 times. I am modifying SQRs by adding while 
>loop in BEGIN-PROGRAM section. Also I added flat file with parameters for each 
>client. So on the first iteration program reads first line of the parameter 
>file, runs through, produces CLIENT_NAME.PDF. Next line of the parameter file, 
>NEW-REPORT another PDF with different client name, and so on until the end of 
>the parameter file.
> Instead of 80 times I have to run these programs just 4 times.
> Everything would be fine if I would not have one problem. After each 
>iteration all variables still have values from the previous loop. Sure, I go 
>and reset them after each iteration, but there are tons of them in each 
>program, and I have to go through each, find them, put into procedure and 
>reset.
> My question: Is there a command that would reset all variables in the program 
>to 0 or NULL depending on the type?
> Thank you.
> 
> 
> 
> ---------------------------------
> Yahoo! for Good
> Click here to donate to the Hurricane Katrina relief effort. 
> 
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
----------------------------------------------------------------------
Ray Ontko rayo@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users


                
---------------------------------
Yahoo! for Good
 Click here to donate to the Hurricane Katrina relief effort. 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users