Jump to content
Sign in to follow this  
RadovanJ

Advanced Window Descriptions

Recommended Posts

RadovanJ

Hi,

is it possible to use variable ($title=My window) in title advanced description ("[TITLE:My Window;") in this example ?

Example:

WinWait("[TITLE:My Window; CLASS:My Class]", "")

Thanks

R.Jencik

Share this post


Link to post
Share on other sites
Tzackel

WinWait("[TITLE:" & $title & "; CLASS:My Class]", "");

like this?

Share this post


Link to post
Share on other sites
RadovanJ

I do not know exactly what does this syntax mean:

" & $title & "

but if strings & allows use variable in this code, then YES.

Thanks

R.Jencik

Share this post


Link to post
Share on other sites
Tzackel

"&" is the operator to join strings

$var="My ";
$var1="Window";
$win="[TITLE:" & $var & $var1 & "]"; = "[TITLE:My Window]"

Share this post


Link to post
Share on other sites
RadovanJ

I am sorry, but when "&" is the operator to join strings, why must i use this, also when a i have single word title ?

For example:

MyWindow without space

I do not want join variables. I have only one variable.

WinWait("[TITLE:" & $title & "; CLASS:My Class]", "");

Thank you very much for explanation.

R. Jencik

Share this post


Link to post
Share on other sites
MHz

I do not want join variables. I have only one variable.

WinWait("[TITLE:" & $title & "; CLASS:My Class]", "");

You are correct. Tzackel broke it down a little too much which may have confused you. I am sure that Tzackel did not mean to confuse you. You can even skip the 2nd parameter (text parameter) as is optional.

Edit:

For learrning about the operator "&"

An example of joining variables, strings, numbers... but is not a concern for your above issue

$variable = 'variable part'
$answer = 'this is a string ' & 'and' & ' this is a ' & $variable & ' number ' & 10
MsgBox(0, '', $answer)

Easy once you get used to the language but learn at your own speed. :)

Edited by MHz

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.