Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,119 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Code Conversion #374453
06/18/11 19:57
06/18/11 19:57
Joined: Aug 2002
Posts: 673
Las Cruces, NM
JimFox Offline OP
User
JimFox  Offline OP
User

Joined: Aug 2002
Posts: 673
Las Cruces, NM
Hello,
I have a piece of old code (C-Script) with the following command:

string is_sNpcLine[10000];

I can easily put it into Lite C as:
STRING* is_sNpcLine[10000];

But I have a sneaking feeling that the old code was intending to allocate a string of 10000 characters, not an array of 10000 pointers. If that was the case, then I should do this:
STRING* is_sNpcLine(#10000);

Does anyone remember the old C-script syntax well enough to say what the code represented?
Thanks for your help!!


Jim
Re: Code Conversion [Re: JimFox] #374457
06/18/11 21:56
06/18/11 21:56
Joined: Feb 2011
Posts: 135
Myrkling Offline
Member
Myrkling  Offline
Member

Joined: Feb 2011
Posts: 135
Quote:
But I have a sneaking feeling that the old code was intending to allocate a string of 10000 characters, not an array of 10000 pointers.

Yep, you're right: In C-Script this will create a string with 10000 characters.

Actually string arrays are not possible in C-Script (unless you use a TEXT).

Re: Code Conversion [Re: Myrkling] #374497
06/19/11 13:12
06/19/11 13:12
Joined: May 2008
Posts: 257
D
djfeeler Offline
Member
djfeeler  Offline
Member
D

Joined: May 2008
Posts: 257
Hello,

if you want to allocate 10,000 characters in lite c must be :

Code:
STRING* is_sNpcLine = "#10000";



djfeeler

Last edited by djfeeler; 06/19/11 13:13.
Re: Code Conversion [Re: Myrkling] #374638
06/20/11 16:55
06/20/11 16:55
Joined: Aug 2002
Posts: 673
Las Cruces, NM
JimFox Offline OP
User
JimFox  Offline OP
User

Joined: Aug 2002
Posts: 673
Las Cruces, NM
OK, thanks everyone. That helps a lot. I will correct the code as you indicated.
Regards,


Jim

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