dummy value changing in @wbrk1, but not a numeric or subtotal field

Brian K. White brian at aljex.com
Fri Nov 16 11:57:10 PST 2007


> ----- Original Message ----- 
> From: "Kenneth Brody" <kenbrody at bestweb.net>
> To: "Brian K. White" <brian at aljex.com>
> Cc: <filepro-list at lists.celestial.com>
> Sent: Friday, November 16, 2007 9:05 AM
> Subject: Re: dummy value changing in @wbrk1, but not a numeric orsubtotalfield!
> 

> Quoting Brian K. White (Fri, 16 Nov 2007 01:16:43 -0500):
> [... dummy field based on rand() changes value between detail and @wbrk1 ...]
> [... because of the multiple break-level copies of the dummy field        ...]
>
> > Oh hohhhh!
> >
> > So I guess instead of:
> >   longvar = rand()
> > another way I could fix it (pun intended) is by:
> >   iv = rand() ; iv = iv
> 
> Using the declared variable rather than a dummy field will work around
> this, as declared variables don't have the multiple-copies feature.
> 
> However, the second example you give won't make any difference, since
> iv will still have multiple copies.

---------

I think I see.

Obviously I thought the problem was that the assignment was from a variable function getting executed multiple times to populate each copy, and that if I just followed it with an assignment from a static value, then all copies would get reset to the current value of this copy.

But you're saying the statement iv=iv, wherever it happens, to whichever copy, in whatever context, will not cause all the other copies to be set to the value of this copy, it will cause all the other copies with their differing values, to copy over themselves, resulting in no change anywhere.

Boggles my mind that behavior like that hasn't caused anyone else a problem before, but I suppose everyone always feels that way about whatever they run into that doesn't make sense to them.

> Note that dummy fields defined in automatic do not have multiple copies.

Thats... interesting... Well, thanks for providing the non-longvar workaround whose existence I was just beginning to wonder about.

Thanks again. Or some more, or something.

Brian K. White    brian at aljex.com    http://www.myspace.com/KEYofR
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



More information about the Filepro-list mailing list