Jump to content


Photo

Help With Comparison Prob...


  • Please log in to reply
3 replies to this topic

#1 Kthulu

Kthulu

    X-S Freak

  • XS-BANNED
  • PipPipPipPipPip
  • 1,287 posts
  • Xbox Version:v1.0
  • 360 version:unknown

Posted 09 November 2003 - 07:53 AM

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???


#2 Kthulu

Kthulu

    X-S Freak

  • XS-BANNED
  • PipPipPipPipPip
  • 1,287 posts
  • Xbox Version:v1.0
  • 360 version:unknown

Posted 09 November 2003 - 09:22 AM

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.

#3 BenJeremy

BenJeremy

    X-S Elysian

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 9,690 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 09 November 2003 - 01:02 PM

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)

#4 Kthulu

Kthulu

    X-S Freak

  • XS-BANNED
  • PipPipPipPipPip
  • 1,287 posts
  • Xbox Version:v1.0
  • 360 version:unknown

Posted 09 November 2003 - 07:29 PM

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users