eKolin Posted July 13, 2016 Share Posted July 13, 2016 Hello. I want to include a variable in WinActivate() form. I'm getting an error badly formatted variable or macro. I've tried to: $a="John" $b="User's"$a"control panel" WinActivate($b) and $a="John" WinActivate("User's"$a"control panel") Any tips? It's pretty clear that i have no clue how to insert a variable in a string =/ Link to comment Share on other sites More sharing options...
SadBunny Posted July 13, 2016 Share Posted July 13, 2016 Welcome to the wondrous world of & $firstName = "John" $lastName = "Johnson" $fullName = $firstName & " " & $lastName MsgBox(64, "name", $fullName) eKolin 1 Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 13, 2016 Moderators Share Posted July 13, 2016 @eKolin still unwilling to crack open the help file I see. To concatenate a string you use the & symbol. "User's" & $a & "control panel" "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
eKolin Posted July 13, 2016 Author Share Posted July 13, 2016 (edited) 5 minutes ago, SadBunny said: Welcome to the wondrous world of & $firstName = "John" $lastName = "Johnson" $fullName = $firstName & " " & $lastName MsgBox(64, "name", $fullName) Thanks. Seems strange that i didin't need "&" for like a month. 3 minutes ago, JLogan3o13 said: @eKolin still unwilling to crack open the help file I see. To concatenate a string you use the & symbol. "User's" & $a & "control panel" Well, I've started doing it every time before I post. This time i've failed to find it, because i didin't know what to search for exactly. Edited July 13, 2016 by eKolin typo? Link to comment Share on other sites More sharing options...
SadBunny Posted July 13, 2016 Share Posted July 13, 2016 1 minute ago, eKolin said: Well, I've started doing it every time before I post. This time i've failed to find it, because i didin't know what to search exactly. Stitching strings together is called concatenation. & (and &=) are concatenation operators. Check the helpfile for "Language Reference - Operators": Quote Concatenation operators & Concatenates/joins two strings. e.g. "one" & 10 (equals "one10") &= Concatenation assignment. e.g. $vVar = "one", and then $vVar &= 10 ($vVar now equals "one10") 2 minutes ago, eKolin said: Thanks. Seems strange that i didin't need "&" for like a month. Indeed eKolin 1 Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
AutoBert Posted July 13, 2016 Share Posted July 13, 2016 (edited) 19 minutes ago, JLogan3o13 said: still unwilling to crack open the help file i never know that reading helpfile is a cracking contest. Who i the judge: i don't realy know why, but every time i press F1 it's opened and give good advice. So, the pot is mine. And yes i can reproduce this feeeature. Edited July 13, 2016 by AutoBert Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 13, 2016 Moderators Share Posted July 13, 2016 @AutoBert what really scares me is the fact that I believe that sentence makes some sort of sense to you... "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
SadBunny Posted July 13, 2016 Share Posted July 13, 2016 9 minutes ago, AutoBert said: So, the pot is mine. Apparently Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
AutoBert Posted July 13, 2016 Share Posted July 13, 2016 (edited) 8 minutes ago, SadBunny said: Apparently i'm not sure seems that JLogan3o13 is also one how knows about and i didn't know time of contest start and contest end. 17 minutes ago, JLogan3o13 said: @AutoBert what really scares me is the fact that I believe that sentence makes some sort of sense to you... the google translation wasn't very helpfull but i am afraid it means the contenst is already closed. Edited July 13, 2016 by AutoBert Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 13, 2016 Moderators Share Posted July 13, 2016 How about we not derail the OP's topic any further, please. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now