IonicWind Software

IWBasic => General Questions => Topic started by: Ficko on December 24, 2006, 11:24:43 AM

Title: FOR NEXT Handicap?
Post by: Ficko on December 24, 2006, 11:24:43 AM
I am not trying to be a pain-in-ass but I think this:

OPENCONSOLE
DEF T AS Double
T = 100
FOR A=0 TO INT(T)
ÂÃ,  PRINT A
NEXT A
DO:UNTIL INKEY$<>""

Should work.
Indeed "T" automatically should be converted to TYPE of "A".

That's only my humble opinion.ÂÃ,  ;)

Csaba


Title: Re: FOR NEXT Handicap?
Post by: Ionic Wind Support Team on December 24, 2006, 11:34:41 AM
the INT function returns an INT64 when passed a DOUBLE since both are 64 bit.

FOR only works with 32 bit integers.  Use a WHILE or DO loop if you want to count using floating point.
Title: Re: FOR NEXT Handicap?
Post by: Ficko on December 24, 2006, 12:18:27 PM
Ok,

Than You for you fast reply! :)

Csaba
Title: Re: FOR NEXT Handicap?
Post by: Ionic Wind Support Team on December 24, 2006, 04:34:49 PM
However with that said I think we need an inline way of casting a double to an int.  Or at least I can let the FOR statment use 64 bit integers, not that you would want to be stuck in a loop that long ;)
Title: Re: FOR NEXT Handicap?
Post by: Ficko on December 25, 2006, 10:50:39 AM
Yes the most semantically correct way would be a function like INT64() for 64bits integers and INT<32>() for 32 but that would throw up backwards compatibility.

So you have to keep INT() how it is and may introduce an INT64().

To running FOR NEXT on 64 bits isn’t a bad Idea either sooner or later you will import Ebasic on a 64 bit assembler anyway, don’t you?ÂÃ,  ;D

-Just teasing you!-
;)