No. The point of the post was that the data IS initialized, but then remains
constant until the user logs out (which is what named common is for). He
wants to re-initialize at the start of each listing.

In theory, @DATE and @TIME should not change during a listing (unlike Date()
and Time()). If UDT respects that, you can use this to set a named common
variable that holds the last time the data was initialized:

TIMESTAMP = (@DATE * 86400)  + @TIME
IF TIMESTAMP <> MYCOMMONVAR THEN
   GOSUB INIT
   MYCOMMONVAR = TIMESTAMP
END

Works on UV (where you also have @NI working correctly), I don't have UDT to
hand at this moment.

Brian

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of art
> Sent: 21 August 2009 05:59
> To: [email protected]
> Subject: Re: [U2] UD: Executing small part of subroutine code 
> once from dictionary call
> 
> Bill Haskett wrote:
> > 
> >> I have a UD dictionary that calls a subroutine.  The subroutine 
> >> selects a small file and saves the data into a reformatted array, 
> >> which is returned as a passed variable.
> >>
> >> I want to only execute this select code once in the 
> subroutine then 
> >> continue with the reset of the subroutines business rule(s) for 
> >> subsequent items processed.  When I create a "named" 
> common variable 
> >> for the built data array the array is set once and when I alter the
> 
> For the named common variable, could you not just use something like:
> IF NOT(ASSIGNED(NAMED.VAR)) THEN GOSUB INIT.DATA
> 
> Art
> 
> _______________________________________________
> U2-Users mailing list
> [email protected]
> http://listserver.u2ug.org/mailman/listinfo/u2-users
> 

_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to