Page 1 of 1
retrieving the XY-Position in a string
Posted: Tue Mar 15, 2005 3:00 am
by Hroudtwolf
Dear comunity,
Thats my prob....
I want to search a string in a string. If the string was found, i need the XY-position from the foundet string in my string.
I tried a lot of thing. My brain already A knot.
Is there anyone who can help me ?

Re: retrieving the XY-Position in a string
Posted: Tue Mar 15, 2005 3:15 am
by PB
Use the FindString command. If it returns 0, the string inside the string
wasn't found. Anything other than 0 is the X position of the found string.
There is no Y position because strings are one-dimensional, unless you
use two-dimensional strings but then that requires a bit more work.
Posted: Tue Mar 15, 2005 3:28 am
by Hroudtwolf
I get my string from a editorgadget. This string has virtualy two dimensions.
Posted: Tue Mar 15, 2005 5:58 am
by PB
> I get my string from a editorgadget
PureBasic strings are only one dimensional. You can't get the text from an
EditorGadget in two dimensions, unless you store it in two different strings.
Posted: Tue Mar 15, 2005 6:29 am
by Dreglor
if your string is formated like "10,5" then use
Code: Select all
X=StringField(String.s,1,",")
Y=StringField(String.s,2,",")