Jump to content
KickStarter15

EditBox to FileWriteLine() concern

Recommended Posts

KickStarter15

Hi Experts,

I know this is just a small issue for guys out there but can't find how to fix this.

My problem is, when I added text in EditBox with more than one paragraph (I mean not in one line text), FileWriteLine() won't present it as one line when "GUICtrlRead($Edit)" even if using delimiters "|".

I have here the code:

$file = "D:\Programs\Text.ini"

FileWriteLine($file, GUICtrlRead($InputName)&"|"&GUICtrlRead($Count)&"|"&$AllFormat&"|"&GUICtrlRead($Edit)&"|"&@UserName&"|"&$aFormat&"|"&@MON & "/" & @MDAY & "/" & @YEAR&"|"&@HOUR & ":" & @MIN & ":" & @SEC&"|"&$Status&"|"&$Remark)

EditBox text presented as:

This is just a sample text.

This is another text here.

Last text here.

 

FileWriteLine() output is this::'(

ABZ12345|50|Parsing|

This is just a sample text.

This is another text here.

Last text here.|@username|Others|@MON/@MDAY/@YEAR|@HOUR:@MIN:@SEC|Pending|For Fixing

 

The bold font were the one being separated to another line in $file which should be in one line only. Like below:

ABZ12345|50|Parsing|This is just a sample text. This is another text here. Last text here.|@username|Others|@MON/@MDAY/@YEAR|@HOUR:@MIN:@SEC|Pending|For Fixing

 

Any idea guys?:(

Thanks in advance Experts.

KS15

 

  • Like 1

Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.

Share this post


Link to post
Share on other sites
Subz

Use StringReplace(GuiCtrlRead($InputName), @CRLF, " ") or replace it with something indicating the newline.

  • Like 1

Share this post


Link to post
Share on other sites
KickStarter15

@Subz,

It never put up in my mind using StringReplace():sweating:, it worked. Thank you so much, another lesson learn for me.

Edited by KickStarter15

Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.

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

×