Home
Free Midlets
Help

OPEN #

Syntax: OPEN #channel,filename,mode
channel
Channel is a integer value between 0 and 9. Further access to this file is performed by specifying the channel.
filename
This is a string value containing the name of the file to be opened. Local filenames may contain up to 32 characters. Filenames beginning with a "." character are hidden files You can also specify a remote filename that connect to a Internet Service, for example a Java Servlet or other CGI programs.
mode
Mode must be either INPUT or OUTPUT depending on if the file is being used to input or output data.

Example

OPEN #1,"InputFile","INPUT"
OPEN #2,"OutputFile","OUPUT"

Accessing the Internet

The following example illustrates how to access a Internet based service. The source code for the HelloServer servlet can be found in the appendices.
1000 OPEN #1,"http://www.mobilebasic.com/servlet/HelloServer","OUTPUT"
1010 INPUT "Name: ",N$
1020 PRINT #1,N$
1030 INPUT #1,A$
1040 PRINT A$
1050 CLOSE #1