The Daily Click ::. Forums ::. Klik Coding Help ::. testing line from list object?
 

Post Reply  Post Oekaki 
 

Posted By Message

Zode



Registered
  13/04/2009
Points
  239

PS3 Owner
14th October, 2009 at 17:49:55 -

Is that somehow possible to test if 1 ( or more) lines on list object has .ini at end of it?
like
line 1: sadsadsad.exe
line 2: fgsfds.rar
line 3: list.ini
line 4: ubersave.data
line 5: list2.ini

and then it picks:
list.ini
and
list2.ini
because they have .ini at end :3

(;c gawd i dont know anything about mmf2)
thanks in advance

EDIT: i got it somehow that string goes thru whole list, so how i can test if that string ends whit: .ini :I
EDIT2: NVM, got it working, after that string thing, i thinked that if i use stringparser and do something i might get it working.. ;D

Edited by Zode

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
14th October, 2009 at 21:17:15 -

You don't need string parser for this.

Run a loop the number of lines in the list times.

Every loop use the condition compare two general values.

And then use the expresion:

Lower$(Right$("string you are checking",4))
And check if it equals ".ini"

I'll make you an example when I get home.


 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
15th October, 2009 at 00:14:27 -

You should untick the box for "1-based index" in the list object's preferences, as fastloops use a 0-based index.
Use "compare 2 general values" for the second event.
Use "Lower$()" so that it will recognize ".INI" aswell as ".ini" etc.

+ Whenever...
-> Start loop "Check for Ini Files", List Nb Lines( "List" ) times.

+ On loop "Check for Ini Files"
+ Lower$(Right$(List Line Text$( "List", LoopIndex("Check for Ini Files")), 4)) = ".ini"
-> Add 1 to Counter or whatever...


I'm curious why you need to do this.
If the list is a directory listing you could just use:

+ Start of frame (or whenever)
-> List: Load filelist from "C:\My Folder\*.ini"

Maybe that's not what you're doing though...

 
n/a

Zode



Registered
  13/04/2009
Points
  239

PS3 Owner
15th October, 2009 at 14:45:30 -


Originally Posted by Sketchy

blahblahblah


I'm curious why you need to do this.
If the list is a directory listing you could just use:
blah..



i need this since im making project, wich is just normal shooter engine whit some extra features, 1 of the features is MODDING
so, whole game is based on mods. :3 im making this because all people wont know how to code so i made shooter game making easy whit this project
and i dont want mod installing to be hard (you just copy mod floder to that project floder and tada, no .ini editing needed :3)

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1971

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
15th October, 2009 at 15:20:38 -

Sounds cool - good luck

 
n/a

Zode



Registered
  13/04/2009
Points
  239

PS3 Owner
15th October, 2009 at 18:02:32 -


Originally Posted by Sketchy
Sounds cool - good luck

;3 if u want to follow my progress, go favorite it from my project page http://www.create-games.com/project.asp?view=main&id=1721 it comes whit 3 mods, default, arcade and 8-bit

 
n/a
   

Post Reply



 



Advertisement

Worth A Click