Jump to content

newbie questions...


 Share

Recommended Posts

first, the auto it instructions say, in a control function you can replace ControlID with ClassNameNN Control Handle or Text, but I can't get it to work with either, am I doing something wrong? Do you have to change an option to get it to recognize other identifiers? I use SciTE and it only recognizes numbers as valid.

second... is something like this possible...

dim $check1 = WinExists("Connected")

if $check1 = 1 Then

Global $table = "Connected"

If $check1 =0 Then

Global $window = "Online"

EndIf

EndIf

WinActivate($window)

Or am I barking up the wrong tree?

Link to comment
Share on other sites

first, the auto it instructions say, in a control function you can replace ControlID with ClassNameNN Control Handle or Text, but I can't get it to work with either, am I doing something wrong? Do you have to change an option to get it to recognize other identifiers? I use SciTE and it only recognizes numbers as valid.

second... is something like this possible...

dim $check1 = WinExists("Connected")

if $check1 = 1 Then

Global $window= "Connected"

If $check1 =0 Then

Global $window = "Online"

EndIf

EndIf

WinActivate($window)

Or am I barking up the wrong tree?

TitleMatching isn't my problem... with Control commands it dosn't seem to recognize anything but ControlID, though the manual says you can use Control Handle or ControlNameNN

with that bit of code, I'm trying to set a window name as a variable, then use that varible to identify its coorosponding window in a function

there was still an error in the first bit I posted the $table should have been $window, I changed it in the reply, the reply is what I'm trying to do

really the problem lies with winactivate($window)

Edited by sidewalk6
Link to comment
Share on other sites

I think this is what your trying to achieve with your example.

You can declare variables as global if you want (i guess), but this should work.

I moved the WinActivate INSIDE the IF statements, otherwise it would attempt to activate nothing.

$check1 = WinExists("connected")

If $check1 = 1 Then
    $window = "connected"
    WinActivate($window)
ElseIf $check1 = 0 Then
    $window = "online"
    WinActivate($window)
EndIf
Edited by tAKTelapis
Link to comment
Share on other sites

I think this is what your trying to achieve with your example.

You can declare variables as global if you want (i guess), but this should work.

I moved the WinActivate INSIDE the IF statements, otherwise it would attempt to activate nothing.

$check1 = WinExists("connected")

If $check1 = 1 Then
    $table = "connected"
ElseIf $check1 = 0 Then
    $window = "online"
    WinActivate($window)
EndIf

Yea, I goofed up before...

I want to acheive something like this..

winactivate($var)

and the $var being either a window called "connected" or "Online"

is that possible or do $var have to be numbers only?

Link to comment
Share on other sites

you can set a variable to be anything text / numerical.

$var = "1"

will return "1"

$var = "connected"

will return connected

a good way to check:

MsgBox(0, "test", $var)

will produce a popup giving you the value of $var

so then, winactivate($var) should work and activate window "Online" if $var is set to = "Online"?

should it be Dim $var = "Online" or Dim $Var = Online ?

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...