Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,507 guests, and 12 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Better file-reading system #100350
11/28/06 17:41
11/28/06 17:41
Joined: Nov 2004
Posts: 888
B
beegee Offline OP
User
beegee  Offline OP
User
B

Joined: Nov 2004
Posts: 888
Well, I don't like the "file_str_read"-command. In the manual it stands: "Reads text from the file with the given handle into the given string, until a delimiter is reached." Okay it reads until a delimiter. First of all it reads generally one byte from a file. Then it reads until a del. is reached. And that is the negative point. Example: There is a user input, which the player can insert several facts. In some inkeys the player types nothing in.

---------------
Text1
Text2

Text4

Text6
---------------

So there are two user inputs the player wrote nothing in. The programs save it. Later it loads the facts. But the GS-Command as mentioned above does read in all cases first of all one byte from the file. And this doesn't make any sense. Plz. change this.

And here I've programmed a new "file_str_read"-command in c-scrpit:

Code:
 ///////////    *****       Inteligent Text-Reading       *****		//////////

string str_Conversation; string delimit_strS","; // del.string is comma
function file_str_readS(handle, string)
{
var asc_return; var delimit_VarS; str_cpy(string,""); delimit_VarS= str_to_asc(delimit_strS);

while(asc_return != 10) && (asc_return != -1) && (asc_return != delimit_VarS) // read till del. expr.
{
// Read out the next ascII-char
asc_return = file_asc_read(handle);

// Write the char into the string if the expr. is true
if(asc_return!=10) && (asc_return != -1) && (asc_return != 13) && (asc_return != delimit_VarS)
{
str_cpy(str_Conversation, "");
str_for_asc(str_Conversation, asc_return);
str_cat(string,str_conversation);
}
}
}



Much thanks,
Benjamin Gentner


Fratch - Newer statistics panel for GameStudio
Re: Better file-reading system [Re: beegee] #100351
11/29/06 11:13
11/29/06 11:13
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
file_str_read intentionally skips tabs and line feeds at the beginning. But it indeed also skipped over a delimiter in the very first byte. This will be fixed.

Re: Better file-reading system [Re: jcl] #100352
11/29/06 13:30
11/29/06 13:30
Joined: Nov 2004
Posts: 888
B
beegee Offline OP
User
beegee  Offline OP
User
B

Joined: Nov 2004
Posts: 888
Nice to hear this, thanks.


Fratch - Newer statistics panel for GameStudio

Moderated by  aztec, 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