hi Infratec, long time no see. good to see you again.
Thanks for your replay.
I did in the early days a lot of assembler programming.
I do know what you mean, but in that days gwbasic and quickbasic did not have that problem.
My problem is: for i = a to b step c does not work if c is an integer.
for i = a to b step 5 does work okay.
So i can not calculate the value of c , and that looks strange.
Or is there a way to change an integer into a number in purebasic?
Wim
naugty problem with for next in grid calculations
Re: naugty problem with for next in grid calculations
c most likely is a variable and that is not supported by PBMy problem is: for i = a to b step c does not work if c is an integer.
for i = a to b step 5 does work okay.
So use maybe it will help
Code: Select all
For i= a to b
your code here
calculate c or get it from previous calculation or read it from DataSection then
i + c
Next
Egypt my love
-
- Enthusiast
- Posts: 290
- Joined: Thu Dec 16, 2010 2:05 pm
- Location: Delfzijl ( The Netherlands )
- Contact:
Re: naugty problem with for next in grid calculations
okay Rashad,
Your idea is awesome
i like to do: for i = a to b step c
pure basic does not allow this.
only this works: for i = a to b step 5
so if i do it the way below, this problem is solved.
It is a bit dirty, but it works
Thanks.
Your idea is awesome
i like to do: for i = a to b step c
pure basic does not allow this.
only this works: for i = a to b step 5
so if i do it the way below, this problem is solved.
It is a bit dirty, but it works
Thanks.
Code: Select all
a = 5
b = 20
c = 5
For i = a To b
; do the calculations with i
Debug i
i = i + c - 1
Next i