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