How to access a certain string of a text?

Posted By: mEnTaL

How to access a certain string of a text? - 08/15/12 14:14

I know this question sounds simple, but i just didn't make it to work... So, i have a TEXT with multiple strings and i want to access a certain one. This code represents what i want:

Code:
TEXT* my_text= 
{
//
strings=50;
//
}

function test()
{
handle=media_play(my_txt.string[1],NULL,100); 
}



All i want is to access the first string of the array, then the second, the third, and so on. The manual says:
"If the text contains more than one string, individual strings can be accessed through a [] index suffix, just like variable arrays." ...But obviously i don't know the exact way to do that.
Help pls.
Posted By: txesmi

Re: How to access a certain string of a text? - 08/15/12 14:34

Hi!
Code:
(my_txt.pstring)[index]



Salud!
Posted By: mEnTaL

Re: How to access a certain string of a text? - 08/15/12 16:49

Thanks, buddy
© 2023 lite-C Forums