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 

how do i append a string

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
how do i append a string
Guest





PostPosted: Sat Oct 24, 2009 4:20 am    Post subject: how do i append a string Reply with quote

string1+string2? is there a way to do it with regexreplace?
Back to top
tekkie2412



Joined: 22 May 2007
Posts: 73

PostPosted: Sat Oct 24, 2009 4:30 am    Post subject: Reply with quote

Im not sure what youre asking. You might be asking how to join 2 strings?

Code:

var1 = abc
var2 = def
var3 = %var1%%var2%
MsgBox, %var3% ;will output abcdef


You can also add to a string just by assigning to it

Code:

var1 = abc
MsgBox, %var1%def ;will also output abcdef
[/quote]
Back to top
View user's profile Send private message
Guest






PostPosted: Sat Oct 24, 2009 4:30 am    Post subject: Reply with quote

Code:
string1 = abc
string2 = 123

string3 = %string1%%string2%

msgbox, % string3
Back to top
Guest






PostPosted: Sat Oct 24, 2009 4:32 am    Post subject: Reply with quote

i understand now, i was using the wrong operator

var1:="blablabla%var2%"
Back to top
Guest






PostPosted: Sat Oct 24, 2009 4:32 am    Post subject: Reply with quote

thanks guys
Back to top
Guest






PostPosted: Sat Oct 24, 2009 4:56 am    Post subject: Reply with quote

hold on now im still having trouble, the program has no idea what im doing

;files used
ending=\Q\file\E
file=%A_WorkingDir%%ending%

;pictures used

;software dependent pics, tabs and buttons
doubleClickClose:=RegExReplace(folder, "file","doubleClickClose.bmp")
okButton:=RegExReplace(folder, "file","okButton.bmp")
yesButton:=RegExReplace(folder, "file","yesButton.bmp")
saveTaxButton:=RegExReplace(folder, "file","saveTaxButton.bmp")
exploreButton:=RegExReplace(folder, "file","exploreButton.bmp")
trainButton:=RegExReplace(folder, "file","trainButton.bmp")
confirmBuildButton:=RegExReplace(folder, "file","confirmBuildButton.bmp")
Back to top
sinkfaze



Joined: 18 Mar 2008
Posts: 5043
Location: the tunnel(?=light)

PostPosted: Sat Oct 24, 2009 5:08 am    Post subject: Reply with quote

Could you give examples of what the expected output to your variables would be versus what you're actually getting?
_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
tekkie2412



Joined: 22 May 2007
Posts: 73

PostPosted: Sat Oct 24, 2009 5:15 am    Post subject: Reply with quote

Im not real familiar with RegExReplace, but I think you have some syntax issues.

Quote:

NewStr := RegExReplace(Haystack, NeedleRegEx [, Replacement = "", OutputVarCount = "", Limit = -1, StartingPosition = 1])


I think its trying to find "C:\blahblahblah\Q\file\E" in the string "folder". Its not finding it so nothing is happening. Atleast I think thats the problem.

Put a MsgBox at the end of your script, run it, then when the msgbox pops up double click the tray icon. You will be able to see how things were evaluated and see if its doing anything[/code]
Back to top
View user's profile Send private message
Guest






PostPosted: Sat Oct 24, 2009 5:21 am    Post subject: Reply with quote

got it lol thanks guys
Back to top
nostroke



Joined: 22 Oct 2009
Posts: 95

PostPosted: Sat Oct 24, 2009 6:09 am    Post subject: Reply with quote

string string
Hello who is this?

im the guy who asked about how do i append a string

oh can you call back later,
if the phone strings more then 3 times im probably not at home
Bye


later

String a ling String a ling string a ling
sorry the person you are trying to reach is not available,
for more options please press zero

press one for Spanish
press two for Chinese
press three for Japanese
press four if you're unsure of your race
press five if you have a question about autohotkey
Back to top
View user's profile Send private message
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