Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
array of strings used to store strings read from a file #11061
11/22/02 10:26
11/22/02 10:26
Joined: Jun 2002
Posts: 42
home
tomahawk009 Offline OP
Newbie
tomahawk009  Offline OP
Newbie

Joined: Jun 2002
Posts: 42
home
hi all

here is what i want to do.I want to read the contents of a file.i have doen that part.i'm able to tokenize the contents.now i need to store these tokenized strings in an array of strings and be able to access and use them when i need......how do i go about doing that ?If i use the text defintion then i need to predefine my strings in oder to store them as array of strings? how do i declare an array of strings and store strings that i'm reading from my file into it ?
i need help on this badly !!


reality is an illusion albeit a persistant one.
Re: array of strings used to store strings read from a file #11062
11/22/02 11:33
11/22/02 11:33
Joined: Oct 2002
Posts: 471
USA - Tennessee
JayG Offline
Senior Member
JayG  Offline
Senior Member

Joined: Oct 2002
Posts: 471
USA - Tennessee
The only way I have found is using a text object.

here is a sample of what I have done.

code:
  
define NumItemStrings = 20;
string strItem1;
string strItem2;
string strItem3;
string strItem4;
string strItem5;
string strItem6;
string strItem7;
string strItem8;
string strItem9;
string strItem10;
string strItem11;
string strItem12;
string strItem13;
string strItem14;
string strItem15;
string strItem16;
string strItem17;
string strItem18;
string strItem19;
string strItem20;

//////////////////////////////////////////////////////////////////////////////////////////
// text txtPanels
//
// Description : Holds Positions For strings to be read in for credits and keys for
// options
//
//////////////////////////////////////////////////////////////////////////////////////////
text txtPanels
{
layer = 100;
font = fntCentury12;
strings = NumItemStrings;
string = strItem1, strItem2, strItem3, strItem4, strItem5, strItem6, strItem7,strItem8,
strItem9, strItem10,strItem11,strItem12, strItem13, strItem14, strItem15, strItem16,
strItem17, strItem18, strItem19, strItem20;
}


//////////////////////////////////////////////////////////////////////////////////////////
// function ResetStrings()
//
// Description : Resets all of the strings so they are empty
//
//////////////////////////////////////////////////////////////////////////////////////////
function ResetStrings()
{
var Counter;

while (Counter < NumItemStrings)
{
str_cpy(txtPanels.string[Counter], " ");
Counter += 1;
}
}

function SetKeyboardStrings()
{
ResetStrings();

str_cpy(strItem1, "Left");
str_cpy(strItem2, "Right");
str_cpy(strItem3, "Up");
str_cpy(strItem4, "Down");
str_cpy(strItem5, "Space Bar & Left Button");
str_cpy(strItem6, "ALT & Right Button");
str_cpy(strItem7, "CTRL");

str_cpy(strItem9, "M");
str_cpy(strItem10, "R");
str_cpy(strItem11, "4");
str_cpy(strItem12, "1 2 3");
str_cpy(strItem13, "Z");
}

txtPanels.pos_x = 330;
txtPanels.pos_y = 280;
txtPanels.visible = on;



Re: array of strings used to store strings read from a file #11063
11/27/02 08:58
11/27/02 08:58
Joined: Jun 2002
Posts: 42
home
tomahawk009 Offline OP
Newbie
tomahawk009  Offline OP
Newbie

Joined: Jun 2002
Posts: 42
home
thanx jay it helped me get my problem solved


reality is an illusion albeit a persistant one.

Moderated by  HeelX, Spirit 

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