Long variable name losing value

Bruce Easton bruce at stn.com
Fri Feb 15 17:18:14 PST 2008


Scott Walker wrote Friday, February 15, 2008 6:53 PM:
 
> -----Original Message-----
> From:Bruce Easton
> Sent: Friday, February 15, 2008 6:18 PM
> To: filepro list
> Subject: Long variable name losing value
> 
> I'm seeing something kooky today where it appears that a long
> variable is losing its value.
> 
> Here is not all, but what I hope are the relevant parts of the
> prc table (runs from clerk - 5.014):
> 
>   1  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>          If:
>        Then: exit
>   2  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> @menu    If:
>        Then:
>   3  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>          If:
>        Then: declare GLOBAL log_name(14,*)
>   4  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>          If:
>        Then: '
>   5  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>          If: '[this is the ONLY called table (no chained tables)]
>        Then: CALL "setup"      '[setup does not reference "log_name"]
>   6  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> .
> .            '[debugger here shows log_name has a value]
> 158  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> process  If:
>        Then: 'process file
> 159  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> .     [there are a couple of sys commands in here that are running
> .      to completion OK]
> 233  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>          If:  '[debugger shows log_name is blank and so is new(323)]
>        Then: new(323)=log_name
> 234  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> .     [there is an import here that is successfully assigning
> .      to other 'new' fields]
> 375  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> enndd    If:  '[the record is being created, all but field new(323)]
>        Then: close new                         '[populated OK]
> 376  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> 
> 
> To get around this, I have assigned a field ln(14,*)=log_name up
> on line 4, then below that I now only assign 'new(323)' from ln.
> Field new(323) is now getting its value OK this way.
> Does anyone know why the long variable could lose its
> value?  Also, this is on Windows, but I've not seen the same
> behavior on our Unix version.
> 
> Bruce
> 
> Bruce Easton
> STN, Inc.
> 
> Bruce,
> 
> Try:
> 
> declare global log_name(14,*,g)
> 
> so that log_name retains it's value between records.  
> 
> I'm just wondering if since @MENU happens before you are positioned on
> any record if it retains it's value once you are on the first record.
> It will NOT retain it's value between records.
> 
> Regards,
> 
> 
> Scott
> 

Scott - that would be a good thing if I were going across 
records, but this program runs in its entirety from top to 
bottom from @menu. So where it loses the value of the 
variable is also prior to any record access 
(which inentionally never actually happens).  The regular 
dummy field 'ln' which now appears next to the declare at 
the top and now in place of the assignment is also not 
global, appears in all the same places in program execution 
(as the long var), but somehow does the job that the long 
variable fails to do.

Bruce

Bruce Easton
STN, Inc.




More information about the Filepro-list mailing list