Jump to content

Write Multiple lines from GUICtrlCreateEdit


Recommended Posts

So I have read a few posts and tried different things but I cant get this working.

I have a GUI with a GUICtrlCreateEdit box so I can type in multiple lines.

I then want to write all these lines to a html file (as separate lines but all together in one block.

The whole script is pretty big, but but these are the bits of code im using.

$GUIExtraInfo = GUICtrlCreateEdit("", 10, 65, 250, 80)

$vExtraInfo = GUICtrlRead($GUIExtraInfo)

If $vExtraInfo > "" Then FileWriteLine($Signature, "<span class=" & ">" & $vExtraInfo & "</span><br />")

It all works - and when I use a msg box to read $vExtraInfo I get the text entered as two lines.

But when writing to the file it all comes out on the one line.

I have tried stringsplit and a few other things but dosent seem to work.

Help appreciated :)

 

Brain wave. Do I a FileWriteLine(........) for each line entered into the GUICtrlCreateEdit????

Not sure how I would implement this.

Edited by badapple89
Link to comment
Share on other sites

I then want to write all these lines to a html file (as separate lines but all together in one block.

What do you mean by all together in one block ?  :huh:

Directly write the whole edit content into a file would exactly do the same thing.

Br, FireFox.

Link to comment
Share on other sites

Firefox I mean when my gui runs and I type

This is line one

This is line two

into the GUICtrlCreateEdit box

That it writes into the html file exactly the same, eg

This is line one

This is line two

That is to say I don't actually need to break up the lines and use them in different parts later on.

 

PlayHD, I had a quick look at that function not sure I understand how it works but I will play around with it monday.

 

Am I even using  GUICtrlCreateEdit in the correct way?

All I need is a multiple line input box for GUI and to write thoes lines back to a file.

Link to comment
Share on other sites

Thanks for the help but used Play's suggestion.

$linecountExtraInfo = _GUICtrlEdit_GetLineCount ($GUIExtraInfo)
;If extrainfo has lines
If $linecountExtraInfo <= 0 Then
 
;For each line
For $i = 0 to $linecountExtraInfo -1
;Write the line to signature
FileWriteLine($Signature, "<span class=" & ">" & _GUICtrlEdit_GetLine($GUIExtraInfo, $i) & "</span><br />")
Next
 

Endif 

Cheers for the help though guys!
Link to comment
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
 Share

×
×
  • Create New...