 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
menaphus
Joined: 28 Nov 2008 Posts: 111 Location: United Kingdom
|
Posted: Thu Dec 18, 2008 7:08 pm Post subject: Need help with 'new line' in 'FileAppend ,' |
|
|
Ok here is my problem,
| Code: |
ButtonADD:
Gui,Submit,Nohide
FileAppend ,
(
;<<<<<<< here
::%AbAddName%::%FullAddName%
), AbbreviationData.ahk
MsgBox, The abbreviation entered has been added to the library.
Reload
Return
|
I need that return( enter pressed ) to make sure that each is saved on a new line, although this leaves a lin blank at the top of the text file, how can I eliminate this empty line ?
Edit: I did post this earlier although it seems to have disappeared from existance _________________ Adam
http://moourl.com/8w0tx
 |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Thu Dec 18, 2008 7:30 pm Post subject: |
|
|
What you had asked for:
| Code: | ButtonADD:
Gui,Submit,Nohide
FileAppend, % (FileExist("AbbreviationData.ahk") ? "`n" : "" )
. "::" AbAddName "::" FullAddName, AbbreviationData.ahk
MsgBox, The abbreviation entered has been added to the library.
Reload
Return |
But this is simpler:
| Code: | ButtonADD:
Gui,Submit,Nohide
FileAppend, % "::" AbAddName "::" FullAddName "`n", AbbreviationData.ahk
MsgBox, The abbreviation entered has been added to the library.
Reload
Return |
_________________ URLGet - Internet Explorer based Downloader |
|
| Back to top |
|
 |
menaphus
Joined: 28 Nov 2008 Posts: 111 Location: United Kingdom
|
Posted: Thu Dec 18, 2008 10:03 pm Post subject: |
|
|
ok sorry for being stupid but what are the "%" and the "`n" doing i just want to understand what im doing so i can use it  _________________ Adam
http://moourl.com/8w0tx
 |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 8688
|
Posted: Fri Dec 19, 2008 2:43 am Post subject: |
|
|
`n is newline ( or linefeed ) Character that helps by folding long sentences
The following two produce identical results
| Code: | MsgBox, % "UserName: " A_UserName "`nComputer: " A_ComputerName
MsgBox, UserName: %A_UserName%`nComputer: %A_ComputerName% |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|