AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Replacing `n, square problem

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ReyRey
Guest





PostPosted: Sun May 31, 2009 4:06 pm    Post subject: Replacing `n, square problem Reply with quote

I'm trying to make a dropdown menu with FileRead (reading a file and using the contents to create the dropdown).

Code:
Code:
FileRead,sup,sp.ahk
StringReplace,sup,sup,`n,|,A
Gui,Add,DropDownList,vSuppliers, %sup%
Gui,Show


sp.ahk (file used):
Code:
Some1
Some2
Some3


Result:
Code:
Some1(square) | Some2(square) | Some3(square)


It works ok, but a square is at the end of each of the choices. I know the square represent the new lines, but I can't get rid of it. Is this an AHK problem?
Back to top
ManaUser



Joined: 24 May 2007
Posts: 1121

PostPosted: Sun May 31, 2009 4:08 pm    Post subject: Reply with quote

Try replacing `r`n instead of just `n.
Back to top
View user's profile Send private message
ReyRey
Guest





PostPosted: Sun May 31, 2009 4:10 pm    Post subject: Reply with quote

Nice thanks. Why does this work? Shocked
Back to top
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Sun May 31, 2009 4:52 pm    Post subject: Reply with quote

Typically, Windows files use carriage return and linefeed (`r`n) and Unix files use only linefeed (`n).

You may be better off using the *t option of FileRead.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group