The Daily Click ::. Forums ::. Klik Coding Help ::. Strings
 

Post Reply  Post Oekaki 
 

Posted By Message

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
15th November, 2008 at 01:48:33 -

I have a string that says this "15:231:08"

How would I receieve just one of the numbers as a value, like if I wanted to get the middle one (231)?

This string can change though so it could read "9:15:27" or anything...

I know how to convert the string to a number, but I need a way of extracting the correct part of the string that I want... where each number is separated by a ":"

Image Edited by the Author.

 
n/a ...

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
15th November, 2008 at 01:54:26 -

Use String Parser 2.

Start of frame, add a delimeter ":"

Then if you want to get the middle number, set a counter to listGetAt$( "String Parser", 2), where "2" = the "element number".
For example:

listGetAt$( "String Parser", 1) will return "15"
listGetAt$( "String Parser", 2) will return "231"
listGetAt$( "String Parser", 3) will return "08"

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

-J-



Registered
  05/10/2008
Points
  228

VIP MemberThe Cake is a Lie
15th November, 2008 at 02:09:36 -

Thanks

It works perfectly now

I've even got an array to read the values and save each one not only to the correct X and Y coordinates but also Z.

so the "231" would be saved to the array at X1, Y1, Z2

Apart from tile designs I think this level editor is almost complete...


Image Edited by the Author.

 
n/a ...
   

Post Reply



 



Advertisement

Worth A Click