Jump to content

WinActivate question


Recommended Posts

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

  • Moderators

@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

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 by eKolin
typo?
Link to comment
Share on other sites

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 :D 

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Link to comment
Share on other sites

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 by AutoBert
Link to comment
Share on other sites

  • Moderators

@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

 

8 minutes ago, SadBunny said:

Apparently :D 

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 by AutoBert
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...