Is there any workaround to do something like this?
procedure draw(a)
for x=0 to 100 step a
:
:
next
endprocedure
i need this to do some variable drawing, a pity PB does not support it, maybe in asm?, any idea?, thanks.
Variable for/next step workaround?
Re: Variable for/next step workaround?
This works:
Code: Select all
Procedure Numbers(a)
For x=1 To 100
x+a-1 ; Simulates "Step a"
Debug x
Next
EndProcedure
;
Numbers(1) ; Shows 1, 2, 3, 4, 5, etc.
Numbers(5) ; Shows 5, 10, 15, 20, etc.
- tinman
- PureBasic Expert

- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
Code: Select all
x = 1
While x < 100
; processing for loop
x + a
Wend
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
