Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
String Array #230300
10/04/08 17:06
10/04/08 17:06
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Ralph Offline OP
Senior Member
Ralph  Offline OP
Senior Member

Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Hi,
i would like to use string array´s, but i cant find something about it in the manual.
Anyone know how to use string array´s? (i know that in C++ you can use char array´s)
...Okay i can use delimiter´s in a normal string like this "word%foobar%blubb" and cut the string if i need one of these words, but this is not the best and easiest way. frown

Ralph

Re: String Array [Re: Ralph] #230376
10/05/08 05:14
10/05/08 05:14
Joined: Feb 2008
Posts: 337
V
Vadim647 Offline
Senior Member
Vadim647  Offline
Senior Member
V

Joined: Feb 2008
Posts: 337
use TEXT* pointers. You can use them as string arrays, and just keep it not visible. It's fully described in manual.


I switched to other account since marth 2010. Guess which.
Re: String Array [Re: Vadim647] #230394
10/05/08 09:50
10/05/08 09:50
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Ralph Offline OP
Senior Member
Ralph  Offline OP
Senior Member

Joined: Feb 2006
Posts: 385
Oldenburg,Germany
I have this idea yesterday, but i dont want to make 100 or more TEXT* pointers.
But thank you.

Ralph

Last edited by Ralph; 10/05/08 09:50.
Re: String Array [Re: Ralph] #230404
10/05/08 10:59
10/05/08 10:59
Joined: Feb 2008
Posts: 337
V
Vadim647 Offline
Senior Member
Vadim647  Offline
Senior Member
V

Joined: Feb 2008
Posts: 337
You dont understand. TEXT pointer can store in it any cound of strings. Then you just need to use string\pstring to edit or view them.


I switched to other account since marth 2010. Guess which.
Re: String Array [Re: Vadim647] #230421
10/05/08 13:26
10/05/08 13:26
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Ralph Offline OP
Senior Member
Ralph  Offline OP
Senior Member

Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Yeah i know that TEXT* Pointers can store hundrets auf Index´s with Strings, but i need much String Array´s and not only 10 or less.

Ralph

Re: String Array [Re: Ralph] #230619
10/07/08 05:56
10/07/08 05:56
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
You can alternatively use an array of handles to dynamically created strings, eg:

Code:
var MyArrayOfStr[10];

..
//To place a string
MyArrayOfStr[0] = handle(str_create("A new string here"));

..

//To get a string
String* StrPointer;

StrPointer = ptr_for_handle(MyArrayOfStr[0]);


Also remember to use ptr_remove when they are no longer needed wink

The code is not tested, but it should look something like that wink

Thanks,
Adoado


Visit our development blog: http://yellloh.com
Re: String Array [Re: adoado] #230625
10/07/08 08:34
10/07/08 08:34
Joined: Jul 2008
Posts: 894
T
TechMuc Offline
User
TechMuc  Offline
User
T

Joined: Jul 2008
Posts: 894
I'm pretty sure you can ignore the handles..

MyArrayOfStr[0] = str_create("A new string");

Re: String Array [Re: TechMuc] #230707
10/07/08 21:36
10/07/08 21:36
Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Ralph Offline OP
Senior Member
Ralph  Offline OP
Senior Member

Joined: Feb 2006
Posts: 385
Oldenburg,Germany
Thank you guys, this work fine for me!
But what about saving this string array in a external *.txt file?
How can i do this?
Ralph

Re: String Array [Re: Ralph] #230717
10/07/08 23:50
10/07/08 23:50
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
Just iterate through the array with a while loop, recalling each string and then save it..

There is no direct way to dump the array into a file and get it to keep the strings, as they are not actually string objects but handles.


Visit our development blog: http://yellloh.com

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1