Sign in to follow this  
Followers 0
theguy0000

saving and opening files

6 posts in this topic

how do i save and open files?


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites



save what type of file for what type of use... ini, txt,etc

and

open to use as ???

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i would need to use .txtand .mod files (.mod is basically .txt with a different exotension).

ok heres what i need:

have the user enter a few things in a GUI, then add a few things before and after what the user enters. confused? how about an example:

the user enters Joe. save this as a txt file: Your name is Joe!

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

heres a test for ya

$answer = InputBox("Question", "Where were you born?", "Planet Earth", "", _
    -1, -1, 0, 0)
FileOpen("text.txt", 1); to write
FileWriteLine("Test.txt", "You were born on " & $answer & ", and your mama too!");lol
FileClose("text.txt")

; later

$file = FileOpen("test.txt", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

; Read in lines of text until the EOF is reached
While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop
    MsgBox(0, "Line read:", $line)
Wend

FileClose($file)

hope it helps

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

works perfect, thanks!


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

FileOpen("text.txt", 1); to write
FileWriteLine("Test.txt", "You were born on " & $answer & ", and your mama too!");lol
FileClose("text.txt")

IIRC it should be

$h_file = FileOpen("text.txt", 1); to write
FileWriteLine($h_file, "You were born on " & $answer & ", and your mama too!");lol
FileClose($h_file)

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0