KickStarter15

EditBox to FileWriteLine() concern

3 posts in this topic

#1 ·  Posted

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

 

1 person likes this

Share this post


Link to post
Share on other sites



#2 ·  Posted

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

1 person likes this

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

@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

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