AutoHotkey Community

It is currently May 26th, 2012, 12:39 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: December 18th, 2008, 8:08 pm 
Offline

Joined: November 29th, 2008, 12:35 am
Posts: 111
Location: United Kingdom
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2008, 8:30 pm 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
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
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 18th, 2008, 11:03 pm 
Offline

Joined: November 29th, 2008, 12:35 am
Posts: 111
Location: United Kingdom
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
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 3:43 am 
Online
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
`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%


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: Bing [Bot], BrandonHotkey, Morpheus, patgenn123, SKAN and 13 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