Sign in to follow this  
Followers 0
faldo

Removing line feed in a string

6 posts in this topic

#1 ·  Posted (edited)

I'm useing GUICtrlCreateEdit () with "$ES_MULTILINE" as style to create an editbox in a GUI.

But when i use GUICtrlRead() to get the message in the box, the string i get in return has some kind of hidden line feed control i can't get rid of.

The reason i want to remove the line feed is that i want to put the string into a ini file that don't support line feeds.

Is there a way to remove the line feed or somehow change the @CRLF to some other character?

Please help :lmao:

Edited by faldo

Share this post


Link to post
Share on other sites



I'm useing GUICtrlCreateEdit () with "$ES_MULTILINE" as style to create an editbox in a GUI.

But when i use GUICtrlRead() to get the message in the box, the string i get in return has some kind of hidden line feed control i can't get rid of.

The reason i want to remove the line feed is that i want to put the string into a ini file that don't support line feeds.

Is there a way to remove the line feed or somehow change the @CRLF to some other character?

Please help :lmao:

$yourstring = StringReplace($yourstring,@lf,"")

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

$yourstring = StringReplace($yourstring,@lf,"")oÝ÷ Ûú®¢×¢ØZµÚ²}ý¶ÇÚ0¢¹µ©eêÞßÛ0«bv'ZºÚ"µÍÚ[ÛYH    ÑÕRPÛÛÝ[Ë]LÉÝÂÕRPÜX]J    ][ÝÓ^HÕRHY]  ][ÝÊBÌÍÛ^YY]QÕRPÝÜX]QY]
    ][ÝÑÝ[I][ÝÉ[ÈÔLÌLKMË   ÌÍÑT×ÐUUÕÐÔÓ
ÉÌÍÑT×ÓUSSSJÉÌÍÑT×ÕÐSUTBÕRPÝÙ]]H
    ÌÍÛ^YY]  ][ÝÔÙXÛÛ[I][ÝËJBÌÍÐÚXÚÈHÕRPÝÜX]P]Û ][ÝÈÚXÚÈ   ][ÝË
LÌ
LJBÕRTÙ]Ý]H

BÚ[HBIÌÍÛÙÈHÕRQÙ]ÙÊ
BRY ÌÍÛÙÈH ÌÍÐÚXÚÈ[ÙÐÞ
    ][ÝÑÙ]Ý[ÈÛHY]Þ   ][ÝËÝ[ÔXÙJÕRPÝXY
    ÌÍÛ^YY]
K   ][ÝÉ][ÝÊJBRY    ÌÍÛÙÈH ÌÍÑÕRWÑUSÐÓÔÑH[^]ÛÜÙ[

The string still shows up as two lines :lmao:

Share this post


Link to post
Share on other sites

#include <GUIConstants.au3>

GUICreate("My GUI edit")
$myedit=GUICtrlCreateEdit ("First line"& @CRLF, 10,32,121,97,$ES_AUTOVSCROLL+$ES_MULTILINE+$ES_WANTRETURN)
GUICtrlSetData ($myedit, "Second line",1)
$Check = GUICtrlCreateButton(" Check ", 50, 320, 50, 25)
GUISetState ()

While 1
    $msg = GUIGetMsg()
    If $msg = $Check then MsgBox(0, "Get string from Editbox", StringReplace(GUICtrlRead($myedit),@CRLF,""))
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Is there a way to remove the line feed or somehow change the @CRLF to some other character?

Please help :ph34r:

:lmao:

evaluates to...

Is there a way to remove the @LF or somehow change the @CRLF to some other character?

so JdeB got the 1st request correct. Seems like you should have requested only the @CRLF (carriage return and the line feed) to be removed for your expectation. Edited by MHz

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Sorry i made it abit unclear, the @CRLF in my example had nothing to with my question...

The real question was what kind of line feed the style "$ES_MULTILINE" returned when you changed line... and @CRLF was the answer, thanx alot guys.

Edited by faldo

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
Sign in to follow this  
Followers 0