variables losing value on current file aliased lookup

Bruce Easton bruce at stn.com
Tue Apr 20 08:18:19 PDT 2010


Below I show some code along with comments below that to explain some
unexpected runtime results.     (filepro 5.0.14 - Linux)
The code is invoked with clerk from the file "control".

          Then: exit
   3   --------   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -   -   -   -   -   -   -   -  -
@menu   If:
          Then: declare GLOBAL targdir(20,*)
   4   --------   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -   -   -   -   -   -   -   -  -
               If:
          Then: targdir="/var/www/html/"{getenv("clientdir"){"/"
               .
               .
150  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -   -   -   -   -   -   -  -
               If:
          Then: lookup getnum = control@  r=("1")   -np
151 --------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -   -   -   -   -   -   -  -
               If: not getnum
          Then: goto mssngct    'handle unexpected missing/locked ctrl rec
152 --------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -   -   -   -   -   -   -  -
               If:
          Then: viewnum=getnum(1); getnum(1)=getnum(1)+"1"; close getnum
               .
               .

The debugger shows that the value of "targdir" is retained until line 
150, and
that as soon as the lookup on line 150 is executed (successfully) the 
values of
"tardir", and other variables, are cleared.    I don't usually use a 
file for dual
purpose like this, so I just made a new file to use instead of "control" 
for
holding the one-up number and the problem went away.

There are no other triggers in this code - it runs top-down  - all from 
@menu.
Is this behavior expected?

Bruce

Bruce Easton
STN, Inc.














More information about the Filepro-list mailing list