Code: Select all
Procedure ForNextNewStepValue(Interval.i)
Protected x.i
For x = 0 To 100 Step Interval ;this would be a nice change
Debug "Interval won't work. Must be a numeric constant"
Next x
EndProcedure
Code: Select all
Procedure ForNextNewStepValue(Interval.i)
Protected x.i
Select Interval
Case 2
For x = 0 To 100 Step 2
Debug "It's a numeric constant"
Next x
Case 3
For x = 0 To 100 Step 3
Debug "It's a numeric constant"
Next x
Default
EndSelect
EndProcedure
Something like this would be nice:
Code: Select all
Random(200, -200, #PB_Integer/#PB_Float) ;if you wish to use integer or float
Code: Select all
Procedure.i RandomI(min.i, Max.i, SeedVal.i = #PB_Ignore)
If SeedVal = #PB_Ignore : SeedVal = ElapsedMilliseconds() : EndIf
ProcedureReturn (Min + (Max - Min) * Random(SeedVal) / SeedVal)
EndProcedure
Procedure.f RandomF(min.f, Max.f, SeedVal.i = #PB_Ignore)
If SeedVal = #PB_Ignore : SeedVal = ElapsedMilliseconds() : EndIf
ProcedureReturn (Min + (Max - Min) * Random(SeedVal) / SeedVal)
EndProcedure
Debug RandomI(-20, 20)
Debug RandomF(-20.5, 20.5)
It would surely also be nice if you could use structured variables.
Something like this:
Code: Select all
Structure _Counters
x.i
y.i
z.i
EndStructure
Global co._Counters
For co\x = 0 To 500
Next co\x