ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sat Feb 16, 2019 5:08 pm

All times are UTC




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
 Post subject: for - next Problem!
PostPosted: Tue Jan 29, 2019 5:18 am 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 127
Seems like QuickBMS cant do a if <> endif like this

Code:
get FILES long
get HEADER long
for i = 0 < FILES
get ID long
get TEST long
if TEST == -1
next i
endif
get SIZE long
get DUMMY long
get OFFSET long
log ID OFFSET SIZE
next i


what is the problem now? it really clear. when i run this script QuickBMS will always going to next i and dont read if and just do next i. but just have to do it when TEST == -1.
its wrong. QuickBMS just will find next i text in script and not matter there is a if option!
note: i am sure this problem never solve too :)

{
for i

if
next i
endif

next i
}


Attachments:
File comment: test file
TEST.zip [978 Bytes]
Downloaded 8 times
Top
   
 Post subject: Re: for - next Problem!
PostPosted: Tue Jan 29, 2019 12:05 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9764
Learn programming and learn the bms language.
I don't even know what you want to do but I guess you want the following:
Code:
get FILES long
get HEADER long
for i = 0 < FILES
    get ID long
    get TEST long
    if TEST != -1
        get SIZE long
        get DUMMY long
        get OFFSET long
        log ID OFFSET SIZE
    endif
next i

Exists also a "continue" instruction that works like in C and other programming languages, it's something you can try in place of the "next i" of your wrong code.

Anyway PLEASE don't open topics for every single wrong usage you do of the bms language, I try to answer but it takes time and I prefer to dedicate it to other topics.


Top
   
 Post subject: Re: for - next Problem!
PostPosted: Tue Jan 29, 2019 12:12 pm 
User avatar

Joined: Tue Oct 13, 2015 1:26 pm
Posts: 434
Why every time that you get stuck in something, you immediately assume that is a quickbms problem?!? Well, I don't kown about bms, but in general programming speaking, you are trying to do something against the logic, this your code will fail in any known programing language.
Every loop has a condition to end its cycle, in you case, the loop will ended when i = FILES, you can't override this, the only thing you can do is force to exit, breaking this loop, aluigi showed this to you a few days ago here.

Edit1: aluigi just answered...
Edit2: I think that you don't understand that is the "next" is part of the "for" instruction, and not another common instruction.

_________________
Tribo Gamer Brasil


Last edited by Delutto on Sat Feb 02, 2019 9:18 pm, edited 2 times in total.

Top
   
 Post subject: Re: for - next Problem!
PostPosted: Wed Jan 30, 2019 6:35 am 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 127
Delutto wrote:
Why every time that you get stuck in something, you immediately assume that is a quickbms problem?!? Well, I don't kown about bms, but in general programming speaking, you are trying to do something against the logic, this your code will fail in any known programing language.
Every loop has a condition to ended its ciclo, in you case, the loop will ended when i = FILES, you can't override this, the only thing you can do is force to exit, breaking this loop, aluigi showed this to you a few days ago here.

Edit1: aluigi just answered...
Edit2: I think that you don't understand that is the "next" is part of the "for" instruction, and not another common instruction.

so. i need to creat a dumper and i need to count header first for some reason
how can i do it when i cant put two different cycle? because last file will lost and i did it with calculating the header of first file and header of next file


Top
   
 Post subject: Re: for - next Problem!
PostPosted: Wed Jan 30, 2019 2:01 pm 
User avatar

Joined: Tue Oct 13, 2015 1:26 pm
Posts: 434
aluigi's code works perfectly, so I don't understand what you're trying to do, but if for some reason you want to do the same thing using two loops, you just need store the values on first loop and recovery this values on second loop:
Code:
get FILES long
get HEADER long
for i = 0 < FILES
   get ID long
   putarray 0 i ID
   get TEST long
   putarray 1 i TEST
   if TEST != -1
      get SIZE long
      get DUMMY long
      get OFFSET long
      putarray 2 i SIZE
      putarray 3 i OFFSET
   endif
next i

for i = 0 < FILES
   getarray ID 0 i
   getarray TEST 1 i
   if TEST == -1
      continue
   endif
   getarray SIZE 2 i
   getarray OFFSET 3 i
   log ID OFFSET SIZE
next i

_________________
Tribo Gamer Brasil


Top
   
 Post subject: Re: for - next Problem!
PostPosted: Thu Feb 07, 2019 8:48 am 
User avatar

Joined: Wed Jul 19, 2017 5:04 am
Posts: 198
in some language, codes has an special id (it's up to your skill) and will find those id to do actors
but if you write [for $2], then actor will find first [next $2] in script, that is why can't run your work

_________________
Be Good, Even in distressing or defamation and chill, Even Everyone's Called You a Bad Guy Or Lier and Mad


Top
   
 Post subject: Re: for - next Problem!
PostPosted: Sat Feb 09, 2019 7:17 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9764
@GHOST DEAD
No sense, please don't post just for posting.
The topic has been already answered.
Thanks


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 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