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
0 registered members (), 18,008 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
Question about "file_str_read" #69788
04/05/06 13:50
04/05/06 13:50
Joined: Jun 2004
Posts: 73
Switzerland, Basel
D
Des_Tiny Offline OP
Junior Member
Des_Tiny  Offline OP
Junior Member
D

Joined: Jun 2004
Posts: 73
Switzerland, Basel
Hi,

I want to read out of a *.txt file. The manual tells, that I have to give a handle and a string:
file_str_read (handle, string)
My Code:
string save_nr;
var_nsave fhandle_save;
...
fhandle_save = file_open_read("save.txt");
file_str_read(fhandle_save, save_nr);

The "save.txt" file is simply 1 character: "1"
When I start the game, I get an error: "Read-only save_nr"
Can I use a variable and not a string?

Animorphs


_______________________________________________ GameStudio 6 Extra Edition Processor: 2.80 Ghz RAM: 2046MB Graficcard: Radeon X600 256MB DOWNLOAD PONG FIGHT
Re: Question about "file_str_read" [Re: Des_Tiny] #69789
04/05/06 15:56
04/05/06 15:56
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
I don't have any error with your codes running
both in 6.31.4 and 6.40.2

What is your GS version?
Did the save.txt located in the same directory
of your program.

Re: Question about "file_str_read" [Re: vlau] #69790
04/05/06 16:09
04/05/06 16:09
Joined: Jun 2004
Posts: 73
Switzerland, Basel
D
Des_Tiny Offline OP
Junior Member
Des_Tiny  Offline OP
Junior Member
D

Joined: Jun 2004
Posts: 73
Switzerland, Basel
i changed the code, now it should work, but I have an other prob:
If I write
while("a" != "a"){...}
then it goes into the loop.
Or if I write
if("a" == "a"){...}
then it does not go into the loop...

the txt file is in the SAVEDIR.
I have the 6.10.2 version, but the one from Sybex

Last edited by Animorphs; 04/05/06 16:10.

_______________________________________________ GameStudio 6 Extra Edition Processor: 2.80 Ghz RAM: 2046MB Graficcard: Radeon X600 256MB DOWNLOAD PONG FIGHT
Re: Question about "file_str_read" [Re: Des_Tiny] #69791
04/05/06 16:21
04/05/06 16:21
Joined: Jun 2004
Posts: 73
Switzerland, Basel
D
Des_Tiny Offline OP
Junior Member
Des_Tiny  Offline OP
Junior Member
D

Joined: Jun 2004
Posts: 73
Switzerland, Basel
[censored], I've found "str_cmp()". Last time i used GS was 4 months ago.


_______________________________________________ GameStudio 6 Extra Edition Processor: 2.80 Ghz RAM: 2046MB Graficcard: Radeon X600 256MB DOWNLOAD PONG FIGHT
Re: Question about "file_str_read" [Re: Des_Tiny] #69792
04/05/06 16:26
04/05/06 16:26
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
You need str_cmp or str_cmpi to compare two strings
or characters instead of what you did.

I think 6.10.2 is too old, update your GS version
if you can.

Re: Question about "file_str_read" [Re: vlau] #69793
04/05/06 17:43
04/05/06 17:43
Joined: Jun 2004
Posts: 73
Switzerland, Basel
D
Des_Tiny Offline OP
Junior Member
Des_Tiny  Offline OP
Junior Member
D

Joined: Jun 2004
Posts: 73
Switzerland, Basel
I think I cant update, cause I have the Sybex version.


_______________________________________________ GameStudio 6 Extra Edition Processor: 2.80 Ghz RAM: 2046MB Graficcard: Radeon X600 256MB DOWNLOAD PONG FIGHT

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