ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sat Sep 21, 2019 3:03 pm

All times are UTC




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
 Post subject: divided wrong
PostPosted: Wed Feb 13, 2019 11:37 am 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 239
Code:
math SIZEQ = 17
if SIZEQ / 16
print "%SIZEQ%"
endif
break

you can see, i post a very simple code
if SIZEQ divided by 16, then print it. but must print nothing. what is the wrong?


Top
   
 Post subject: Re: divided wrong
PostPosted: Wed Feb 13, 2019 12:56 pm 
User avatar

Joined: Tue Oct 13, 2015 1:26 pm
Posts: 461
Code:
math SIZEQ = 17
xmath MOD "SIZEQ % 16"
if MOD = 0
   print "%SIZEQ%"
endif
aluigi wrote:
There's a "if not" instruction?

_________________
Tribo Gamer Brasil


Top
   
 Post subject: Re: divided wrong
PostPosted: Wed Feb 13, 2019 1:26 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
Just replace / with % and it works.
You also have an useless "break" there.

17 / 16 = 1
16 / 16 = 1
17 % 16 = 1
16 % 16 = 0
It's just math :)


Top
   
 Post subject: Re: divided wrong
PostPosted: Wed Feb 13, 2019 1:46 pm 
User avatar

Joined: Tue Oct 13, 2015 1:26 pm
Posts: 461
aluigi wrote:
Just replace / with % and it works.
But it'll do the opposite, that's why I asked you for a "if not" like instruction.

_________________
Tribo Gamer Brasil


Top
   
 Post subject: Re: divided wrong
PostPosted: Wed Feb 13, 2019 2:32 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 10569
Ah sorry, I replied to Shokoniraya only.

Anyway you are right, there is no "if not".
I just use "if ... else" for handling these cases.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited