Re: comparing values strange behaviour





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
.



Relevant Pages

  • Re: Go To Portal Row script step 7.0-8.5
    ... Set Field ... Exit Loop If ... TestField, performing the Set Field commands only when the record's ... TestField is not empty. ...
    (comp.databases.filemaker)
  • Re: Go To Portal Row script step 7.0-8.5
    ... I appreciate the effort Harry I do, but I don't need help writing a ... End Loop If ... Set Field ... TestField, performing the Set Field commands only when the record's ...
    (comp.databases.filemaker)
  • Re: Being smart with a date range
    ... Set Field ... Set Field [LoopCounter, 1] ... Exit Loop ... End Loop If [LoopCounter> NumClasses] ...
    (comp.databases.filemaker)
  • Re: Scripting question re Loops
    ... is there a way to step through a value list in a loop? ... I would like to be able to use FM8's ScriptMaker to do something like the following using FM8's native scripting, ... Set Field ... Associate Member, FileMaker Solutions Alliance ...
    (comp.databases.filemaker)
  • Re: comparing values strange behaviour
    ... set field ... exit loop if [ ... Changing the exit condition, I can't quite figure out what you're saying. ... Exit Loop If [gserial> gend] ...
    (comp.databases.filemaker)