Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (AndrewAMD, TipmyPip, NewbieZorro, Grant), 14,196 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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