Sign in to follow this  
Followers 0
acecase

useing vars for function parms

2 posts in this topic

#1 ·  Posted (edited)

Hey,

I am haveing some problem useing vareables as parameters for AutoIt functions.

I have had the problem in some functions and not in others so I wander if its a syntax problem I'm haveing or if these functions just don't support it.

This works fine..

$vAwayMsg = IniRead("chatbt.ini", "Messages", "awayMsg", "I'm away.")

Send("/away ")

ClipPut($vAwayMsg)

Send("^v")

However this doesn't seem to be working..

$vWinTitle = IniRead("chatbt.ini", "Options", "windowTitle", "Klient")

$vFailed = 0

Do

$vFailed = $vFailed + 1

Sleep(1000)

If $vFailed = 7

loadKlient()

EndIf

Until WinActive($vWinTitle) ;have tried this with and without quotes ("$vWinTitle")

$vFailed = 0

Sleep(1000)

WinMove($vWinTitle, "", 0, 0) ;this one too

I have tried this with WinMove useing the actual window title instead of the var and the program just opens and sets there for 7 seconds untill the $vFailed var reaches its exit point so I am assumeing it isn't seeing the rite window title wich i have double checked and it is stored correctly in $vWinTitle.

I dunno, Im sure its something i have looked over.

Thanks for any help offerd

Edited by acecase

Share this post


Link to post
Share on other sites



acecase,

I tried below script and that works fine for me...

Could it be that you need to specify: AutoItSetOption("WinTitleMatchMode", 1) to match anysubstrinfg in the title ?

jos

$vWinTitle = IniRead("chatbt.ini", "Options", "windowTitle", "Untitled - Notepad")

$vFailed = 0

Do

$vFailed = $vFailed + 1

Sleep(1000)

If $vFailed = 7

loadKlient()

EndIf

Until WinActive($vWinTitle)

sleep(1000)

WinMove($vWinTitle, "", 0, 0) ;this one too

Exit(0)

func loadklient()

run("notepad.exe")

return

endif


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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