Page 1 of 1

Writing to a file!

Posted: Mon Jan 29, 2007 7:18 pm
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

Posted: Mon Jan 29, 2007 7:29 pm
by Clutch
Mindtrick,

GetGadgetText() should do the trick...

Code: Select all

WriteStringN(0, "<title>" + GetGadgetText(0) + "</title>")

Posted: Mon Jan 29, 2007 8:10 pm
by Mindtrick
Wow thank you very much!

There are so many friendly folk around here!!

Many Regards
Mindtrick

Posted: Mon Jan 29, 2007 10:05 pm
by oldBear
There are even a few who can read the manual :)

Posted: Mon Jan 29, 2007 11:20 pm
by Mindtrick
oldBear wrote:There are even a few who can read the manual :)
lol..ssshhh haha thanks a lot nonetheless :lol:

Mindtrick