AutoHotkey Community

It is currently May 26th, 2012, 10:18 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: how do i append a string
PostPosted: October 24th, 2009, 5:20 am 
string1+string2? is there a way to do it with regexreplace?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 5:30 am 
Offline

Joined: May 22nd, 2007, 1:06 am
Posts: 73
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]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 5:30 am 
Code:
string1 = abc
string2 = 123

string3 = %string1%%string2%

msgbox, % string3


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 5:32 am 
i understand now, i was using the wrong operator

var1:="blablabla%var2%"


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 5:32 am 
thanks guys


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 5:56 am 
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")


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 6:08 am 
Offline
User avatar

Joined: March 19th, 2008, 12:43 am
Posts: 5480
Location: the tunnel(?=light)
Could you give examples of what the expected output to your variables would be versus what you're actually getting?

_________________
Image
Try Quick Search for Autohotkey or see the tutorial for newbies.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 6:15 am 
Offline

Joined: May 22nd, 2007, 1:06 am
Posts: 73
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]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 6:21 am 
got it lol thanks guys


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 24th, 2009, 7:09 am 
Offline

Joined: October 22nd, 2009, 10:26 pm
Posts: 95
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


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: AndyJenk, Bing [Bot], JSLover, Leef_me, patgenn123, rbrtryn, XstatyK and 71 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