Writing to a file!

Just starting out? Need help? Post your questions and find answers here.
Mindtrick
User
User
Posts: 46
Joined: Tue Jan 16, 2007 7:57 pm
Location: England
Contact:

Writing to a file!

Post by Mindtrick »

Hey!

I am trying to make a little program and I was wondering how I can write variable to a text file!

Here is my gadget code:

Code: Select all

If CreateGadgetList(WindowID(0))
StringGadget(0 , 100 , 50 , 400 , 20 , "")
TextGadget(1 , 20 , 55 , 100 , 20 , "Website Title:")
EditorGadget(2 , 100 , 100 , 400 , 200)
TextGadget(3 , 20 , 105 , 100 , 20 , "Page Text:")
ButtonGadget(4 , 20 , 410 , 600 , 20 , "Compile Webpage!")

  EndIf
And for case 4 I have the following code:

Code: Select all

        Case 4
        
        file$ = SaveFileRequester("Save" , "" , "HTML Files (*.html)|*.html",0)
        OpenFile(0 , file$+".html")
        WriteStringN(0 , "<html>")
        WriteStringN(0 , "<title>")
        WriteStringN(0 , "</html>")
        CloseFile(0)
Now I need to know how I can write the text which is inputted into the string box....

Many regards
Mindtrick
Image
Clutch
User
User
Posts: 52
Joined: Sun Nov 26, 2006 6:11 am
Location: South Florida

Post by Clutch »

Mindtrick,

GetGadgetText() should do the trick...

Code: Select all

WriteStringN(0, "<title>" + GetGadgetText(0) + "</title>")
"Ahead one third... ahead two thirds... Full ahead flank
And out from the belly of the whale came a prophet, Amen"
Mindtrick
User
User
Posts: 46
Joined: Tue Jan 16, 2007 7:57 pm
Location: England
Contact:

Post by Mindtrick »

Wow thank you very much!

There are so many friendly folk around here!!

Many Regards
Mindtrick
Image
oldBear
Enthusiast
Enthusiast
Posts: 121
Joined: Tue Jul 05, 2005 2:42 pm
Location: berrypatch

Post by oldBear »

There are even a few who can read the manual :)
Mindtrick
User
User
Posts: 46
Joined: Tue Jan 16, 2007 7:57 pm
Location: England
Contact:

Post by Mindtrick »

oldBear wrote:There are even a few who can read the manual :)
lol..ssshhh haha thanks a lot nonetheless :lol:

Mindtrick
Image
Post Reply