for - next

old syntax:

for=loopname=start=end=step=typ

 

new syntax:

for <loopname> = <start> to  <end>  step <stepvalue>]

[code]

next

 

 

Nested for - next and use of Place holders are allowed.

 

step: (is optional)

1        - increment with 1

-1        - decrement with 1

 

 

Special Typ's:

DATUM                DataTime.

MONAT                Month

 

 

 

 

Example:

Set Columns afterward's.

In that case you must work over the whole DataWindow

 

hmtoggle_plus1old Syntax

// Save current Row

setvar=lastrow=<getrow>                

// Deactivate rowfocuschanged-Event

setvar=sysupdate=ja

// rowcount=quantity of the lines

for=MyLoop=1=<rowcount>

 // junp to line                        

 setrow=<MyLoop>                

 select u_ke from oitm where itemcode='<itemcode>'

 // set value of actual line

 setcolumn=u_ke=<wert1>        

next                                

// end of loop

 

 

hmtoggle_plus1with new Syntax:

// Save current Row

setvar=lastrow=<getrow>                

// Deactivate rowfocuschanged-Event

setvar=sysupdate=ja

// rowcount=quantity of the lines

for MyLoop = 1 to <rowcount>

 // junp to line                        

 setrow=<MyLoop>                

 select u_ke from oitm where itemcode='<itemcode>'

 // set value of actual line

 setcolumn=u_ke=<wert1>        

next                                

// end of loop

 

 

 

Important:

Setrow will trigger the rowfocuschanged script.

That means for each Row Change a lot of functionality might be executed and this might slow down the procedure.

 

You can deactivate this in the "Update Event"

Alternative you can deactivate this by setting the Variable "sysupdate" on "ja".

 

This is not necessary inside the Retrieve and Post Retrieve event.