Re: A problem with this bgt game
open
file object
This method will open a file for reading or writing.
bool open(string filename, string open_mode)
Parameters:
filename
The file to open. This can be either an absolute path, a relative path or
the file name on its own.
open_mode
The mode in which the file should be opened (see remarks).
Return value:
true on success, false on failure.
Remarks:
When specifying a filename, remember that both \ and / can be used to
specify paths.
The following is a list of valid open modes.
* "a"=append
* "r"=read
* "w"=write
If the file does not exist and is opened in write or append mode, it will
be created as long as the directory that should contain the file exists.
If the file is being opened in read mode then both directory and file
must exist for the operation to succeed.
To open a file in binary mode, simply append b to the open mode string.
For example, "wb" will open a file to be written in binary mode, while
"rb" opens a file to be read in binary mode.
Example:
// Write some text into a file.
void main()
{
file test;
test.open("c:\\test.txt", "w");
test.write("I am a text file!");
test.close();
}
Function Reference
string_to_number
This function converts the given string into a number.
double string_to_number(string the_string)
Parameters:
the_string
The string to convert.
Return value:
The number stored in the string on success, 0 on failure.
Remarks:
When converting a string to a number the function will ignore any spaces
that may appear before the actual number, as well as any additional text
that may come after the last numeric character that can be interpreted.
The function will also include any plus or minus sign appearing in the
beginning of the string, as well as any decimals that are present.
Example:
void main()
{
string my_string="-35.6";
double my_number=string_to_number(my_string);
}
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector