Project

General

Profile

Actions

Bug #244

closed

For/Next not working with negative step when defined with variables

Added by David Baldwin almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
02/21/2020
Due date:
% Done:

0%

Estimated time:
Affected version:

Description

For/Next not working with negative step when defined with variables.

Example:-

#manifest:"pc"
#fullScreen:true
#fps:false
#splashScreen:false

Ink 1

For_Loop_Start=0 
For_Loop_End=1
For_Loop_Step#=0.02
Count=0

Gosub Tester

Text 20,100,"Test One - Step Forward - Step Count:"+Str$(Count)

For_Loop_Start=1 
For_Loop_End=0
For_Loop_Step#=-0.02
Count=0

Gosub Tester

Text 20,200,"Test Two - Step Backward - Step Count:"+Str$(Count)

End

Tester:
For F#=For_Loop_Start to For_Loop_End Step For_Loop_Step#
Inc Count
Wait Vbl
Next F# 
Return
Actions #1

Updated by David Baldwin almost 5 years ago

Just checked the code and some bits missing,

#manifest:"pc"
#fullScreen:true
#fps:false
#splashScreen:false

Ink 1

For_Loop_Start=0 
For_Loop_End=1
For_Loop_Step#=0.02
Count=0

Gosub Tester

Text 20,100,"Test One - Step Forward - Step Count:"+Str$(Count)

For_Loop_Start=1 
For_Loop_End=0
For_Loop_Step#=-0.02
Count=0

Gosub Tester

Text 20,200,"Test Two - Step Backward - Step Count:"+Str$(Count)

End

Tester:
For F#=For_Loop_Start to For_Loop_End Step For_Loop_Step#
Inc Count
Wait Vbl
Next F# 
Return
Actions #2

Updated by Francois Lionet almost 5 years ago

  • Target version set to 0.9.5

Fixed, and added the tag #checkForNextLoops

Actions #3

Updated by Francois Lionet almost 5 years ago

  • Status changed from New to Resolved

Fixed, and added the tag #checkForNextLoops in the process...

Actions #4

Updated by Baptiste Pillot over 4 years ago

  • Description updated (diff)
  • Status changed from Resolved to Closed
Test One - Step Forward - Step Count: 50
Test Two - Step Backward - Step Count: 50

Ok.

Actions

Also available in: Atom PDF