How to....

How to....

Post by Anthony Tsouma » Thu, 22 Feb 2001 23:43:27



HI there,

Can someone show me the code to make my program save to a file i specify??
eg. likethis.abg         <---- is it possible to create my own file
extension??

Thanks for ya help =)

 
 
 

How to....

Post by Chris Newma » Fri, 23 Feb 2001 06:36:37


Hi

You can have any extension you like.  But, if you pick an extension that is
a common one, like .doc, .exe, etc. and you double click on it, you may get
some bizarre results!

Code:

myFile = "fred.dat"
myVariables = "this is a test"
Open myFile for output as 1
    write #1, myVariables
Close 1

This will make a file called "fred.dat" and ut in that file a string "this
is a test"

To get the string back:

Open myFile for input as 1
    input #1, myInputVariable
Close 1

myInputVariable now contains the string "this is a test"

HTH

Chris Newman


Quote:> HI there,

> Can someone show me the code to make my program save to a file i specify??
> eg. likethis.abg         <---- is it possible to create my own file
> extension??

> Thanks for ya help =)