Help - Search - Members - Calendar
Full Version: Help With Comparison Prob...
Scenyx Entertainment Community > Xbox1 Forums > Dashboard Forums > Official MediaXMenu (MXM) Forum > MXM ActionScripting Forum
Kthulu
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???
Kthulu
check this out...
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.
BenJeremy
Hmmm... could be. 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)
Kthulu
no problem. 27000000000 is a pretty big number and since i'm dealing with disk space anyway, i just chopped off the least significant digits like this...
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.