xboxscene.org forums

Author Topic: Help With Comparison Prob...  (Read 91 times)

Kthulu

  • Archived User
  • Hero Member
  • *
  • Posts: 787
Help With Comparison Prob...
« on: November 08, 2003, 11:53:00 PM »

CODE

 SETFUNC DVDTitle XBETITLE D:DEFAULT.XBE
 SETFUNC DVDSIZE FILESIZE D:
 SETFUNC strLen LENGTH $driveFfree$
 SUB strLen 14
 SETFUNC freeFdrive MID 3 %strLen% $driveFfree$
 SETFUNC freeFdrive REPLACE "," "" %freeFdrive%

BeginDraw UseCurrent
 MessageBox "=%freeFdrive%<=%DVDSIZE%="    <--displays as "=27701000000<=89000000="
EndDraw
Delay 15

 IF# %freeFdrive% <= %DVDSIZE% GOTO NOROOM


yet it goes to NOROOM...wtf am i missing here???
Logged

Kthulu

  • Archived User
  • Hero Member
  • *
  • Posts: 787
Help With Comparison Prob...
« Reply #1 on: November 09, 2003, 01:22:00 AM »

QUOTE

If# "27000000000" <= "1" GOTO NOROOM
BeginDraw UseCurrent
  MessageBox "Compared correctly"
EndDraw
Delay 10
QUIT

:NOROOM
BeginDraw UseCurrent
  MessageBox "Compared incorrectly"
EndDraw
Delay 10
QUIT


when i run it, goes to :NOROOM.  so is 27000000000 too big for the comparison to handle?  when i take a couple of zeros off, it works.
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Help With Comparison Prob...
« Reply #2 on: November 09, 2003, 05:02:00 AM »

sad.gif I'll take a look at changing the numeric translation to use "bigger" variables (in this case, to explain to programmers, I'll use int64 types instead of longs)
Logged

Kthulu

  • Archived User
  • Hero Member
  • *
  • Posts: 787
Help With Comparison Prob...
« Reply #3 on: November 09, 2003, 11:29:00 AM »

CODE

 SETFUNC DVDTitle XBETITLE D:DEFAULT.XBE
 SETFUNC DVDSIZE FILESIZE D:
 SETFUNC strLen LENGTH $driveFfree$
 SUB strLen 21
 SETFUNC freeFdrive MID 3 %strLen% $driveFfree$
 SETFUNC freeFdrive REPLACE "," "" %freeFdrive%

 DIV DVDSIZE 1000000

 If# %freeFdrive% <= %DVDSIZE% GOTO NOROOM


however, the largest number that could be used with IF# would be a good thing to add to the ::Actionscript Reference.  I was banging my head pretty hard till i figured out the number was too big smile.gif
Logged