For and quads

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

For and quads

Post by MachineCode »

Just hit this limitation today:

Code: Select all

Line 12: 'For' doesn't support quad variables.
Any plans to support this in future? I need to do a For/Next loop where the ending value is a quad value, but the variable I'm using with "For" can't be a quad. Not sure how to get around it. :( The code is: "For a.q=1 To n", where "n" = a quad value.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: For and quads

Post by J. Baker »

+1

Had the same issue with using a double. Looks like only an integer is supported at the moment.

Instead of a quad though, couldn't you just make "n" a negative value?
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: For and quads

Post by MachineCode »

"n" is the result of FileSize() for an 8 GB file, so... no. :)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: For and quads

Post by J. Baker »

MachineCode wrote:"n" is the result of FileSize() for an 8 GB file, so... no. :)
yeah, my bad, as "n" would still not be any larger then an integer anyway. What was I thinking. :oops:
Can you use a loop like, Repeat until Eof?
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: For and quads

Post by Danilo »

MachineCode wrote:Not sure how to get around it. :( The code is: "For a.q=1 To n", where "n" = a quad value.

Code: Select all

a.q = 1
n.q = 10

While a <= n
  ;
  Debug a
  ;
  a+1
Wend
Or with a constant:

Code: Select all

a.q = $FFFFFFFFFFFA
#n  = $FFFFFFFFFFFF

While a <= #n
  ;
  Debug a
  ;
  a+1
Wend
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: For and quads

Post by MachineCode »

Looks like While/Wend will have to do. Thanks to both of you.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Post Reply