Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Need code help please! #139509
07/04/07 21:50
07/04/07 21:50
Joined: Feb 2006
Posts: 126
USA,
manic7creations Offline OP
Member
manic7creations  Offline OP
Member

Joined: Feb 2006
Posts: 126
USA,
I am trying to do some file reading, but I am getting some errors with this code. I need some help on how to get it working for me.

Code:
 ////////////////////////////////////////////////////////////////////

var video_mode = 7; // 800x600 pixels
var video_depth = 32; // 32 bit mode

////////////////////////////////////////////////////////////////////

string work02_wmb = <work02.wmb>;

////////////////////////////////////////////////////////////////////

///The code down below is the code that is causing me problems....


string test_str[8];


var fhandle;


fhandle = file_open_read("C:/Documents and Settings/Chris/Desktop/OREO/test.txt");
file_str_read(fhandle,test_str);
file_close(fhandle);



////////////////////////////////////////////////////////////////////

text collision_txt
{
pos_x = 10;
pos_y = 10;
font = _a4font;
string = test_str;
flags = visible;
}
/////////////////////////////////////////////////////////////////////



///////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////

function main()
{
level_load (work02_wmb);

}



Re: Need code help please! [Re: manic7creations] #139510
07/04/07 22:43
07/04/07 22:43
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
The text file must exist in the savedir directory:

savedir "\\GameSave"; //example name

And forget about that path, just put:

fhandle = file_open_read("test.txt");

Also its good idea you put the instructions in a function, like main or another one.

Re: Need code help please! [Re: demiGod] #139511
07/05/07 00:53
07/05/07 00:53
Joined: Feb 2006
Posts: 126
USA,
manic7creations Offline OP
Member
manic7creations  Offline OP
Member

Joined: Feb 2006
Posts: 126
USA,
Thanks for the help, I'll try some of that.

Last edited by manic7creations; 07/05/07 00:54.

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