The Daily Click ::. Forums ::. Klik Coding Help ::. Text loop
 

Post Reply  Post Oekaki 
 

Posted By Message

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
27th February, 2009 at 10:45:19 -

Is there a way to loop through each character in a text file (ini) and then say when a character "/" is found, stop the loop or do some other action? Is there a better option than ini?

Say I had a text file like this:

I have a red hat.* Actually it is blue.

Then I wanted to loop through that until I reached the "*" character, then display that sentence as static text or in an edit box etc.

So the text in the game would just say "I have a red hat." because everything after the "*" wouldn't be looped through.

Thanks in advance

Please ask for more info about my question if this is not enough!

Edited by -J-

 
n/a ...

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
27th February, 2009 at 12:18:36 -

Use the "String Parser" extension. Set the delimiter to "*". You can then retrieve the text between each "*" as a different substring.

 
n/a

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
27th February, 2009 at 12:53:54 -

Thanks sketchy . Is it possible to have multiple delimeters? Like if I wanted to check if the character was a * or a ] etc? Would it be better to use more than one string parser?



 
n/a ...

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
27th February, 2009 at 13:18:52 -

You can have multiple delimiters - no need for more than one string parser object in the frame.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click