Re: comparing values strange behaviour
- From: Matt Wills <I'm@xxxxxxxx>
- Date: Wed, 21 Nov 2007 14:40:55 GMT
on 11/21/07 1:49 AM ard said:
I have this code snippet:
set field[gstart,1]
set field[gend,1000]
set field[gserial,gstart]
loop
new record
set field [serial,gserial]
set field [gserial,gserial+1]
exit loop if [(gend>gserial)]
eend loop
I had expected this to generate records 1 to 1000. It generates only 1
record. If you change the exit condition to
exit loop if [(gserial-gend>0)
Is this expected behaviour?
In the first pass, gend = 1000, gserial = 2 by the time you get to Exit loop if gend > gserial.
Changing the exit condition, I can't quite figure out what you're saying.
Why are you making it so complicated?
Set Field [ gCount ; 0 ]
Loop
New record
Set Field [ gCount ; gCount + 1 ]
Set Field [ gSerial ; gCount ]
Exit Loop If [ gCount = 1000 ]
End Loop
Is gSerial supposed to be a serialized value in each record? Why not make that an autoenter field?
Matt
.
- Follow-Ups:
- Re: comparing values strange behaviour
- From: Helpful Harry
- Re: comparing values strange behaviour
- References:
- comparing values strange behaviour
- From: ard
- comparing values strange behaviour
- Prev by Date: Re: Prequestion: Help for FM5 needed...
- Next by Date: Re: comparing values strange behaviour
- Previous by thread: comparing values strange behaviour
- Next by thread: Re: comparing values strange behaviour
- Index(es):
Relevant Pages
|