xboxscene.org forums

OG Xbox Forums => Official MediaXMenu (MXM) Forum => Dashboard Forums => MXM ActionScripting Forum => Topic started by: Kthulu on November 08, 2003, 11:53:00 PM

Title: Help With Comparison Prob...
Post by: Kthulu 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???
Title: Help With Comparison Prob...
Post by: Kthulu 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.
Title: Help With Comparison Prob...
Post by: BenJeremy 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)
Title: Help With Comparison Prob...
Post by: Kthulu 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