Sign in to follow this  
Followers 0
RadovanJ

Advanced Window Descriptions

6 posts in this topic

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



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

like this?

Share this post


Link to post
Share on other sites

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

"&" 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

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

#6 ·  Posted (edited)

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  
Followers 0