variables losing value on current file aliased lookup
John Esak
john at valar.com
Tue Apr 20 09:03:48 PDT 2010
I just tried this on my SCO system and I can not duplicate it. My vars keep
the value assigned. You don't try and assign a value to a real field in the
local file do you? Perhaps, that would invalidate all assignments without
an error message? Since @menu is not standing on any record you cbviously
can't assign to a real field, but I've always been able to assign to vars
and lookups. In fact, this method is how I guarantee getting a good free
record to stand on for some work and then dumping it with a delete... In a
way that does not goof up the free chain. I don't know why this Is
happening to you.
John
> -----Original Message-----
> From: filepro-list-bounces+john=valar.com at lists.celestial.com
> [mailto:filepro-list-bounces+john=valar.com at lists.celestial.co
m] On Behalf Of Bruce Easton
> Sent: Tuesday, April 20, 2010 11:18 AM
> To: filepro-list at lists.celestial.com
> Subject: variables losing value on current file aliased lookup
>
> 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.
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
More information about the Filepro-list
mailing list