AutoHotkey Community

It is currently May 26th, 2012, 7:13 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: May 31st, 2009, 5:06 pm 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2009, 5:08 pm 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
Try replacing `r`n instead of just `n.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2009, 5:10 pm 
Nice thanks. Why does this work? :shock:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 31st, 2009, 5:52 pm 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Alpha Bravo, bobbysoon, BrandonHotkey, Cephei1, joetazz, Miguel, rbrtryn, SKAN, Xx7 and 74 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group