Lyee

Tags trouble

3 posts in this topic

Hello guys,

I'm working on basics with tags but I actually dont know how to do it correct.

The tag $IE will create IE window and this $IE will have his own number $IE+$i but this code is not correct

Code what I basically want:

#include <IE.au3>
$i = 0

IEstart()
IEref()

Func IEstart()
    $LoopCount = 0
    Do
        Global $IE + $i = _IECreate('Google.com')
        $i += 1
        $LoopCount += 1
    Until $LoopCount = 10

EndFunc   ;==>iestart

Func IEref()
    $LoopCount = 0
    Do
        _IEQuit($IE + $i)
        $i += 1
        $LoopCount += 1
    Until $LoopCount = 10
EndFunc   ;==>ieref

Btw I know that I can close this windows with ProcessClose function but I want it like this..

PS: How to tag $IE for second func( IEref() ) special for _IEQuit? That Global function doesnt work :/

Thanks for any help

 

Share this post


Link to post
Share on other sites



Im sorry could you explain what do you need the script to do?

So, start 10 instances of google and leave at 10, is that it?


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

 

Share this post


Link to post
Share on other sites

The reason it's not correct is because

  1. You're declaring your variable to hold the handle from _IECreat inside the for loop and making it global. Declare your global variables outside of functions
  2. $IE is not declared but you're trying to add $i to it
  3. You cannot add to the left hand side of the assignment operator (the =). You can in other languages but not here

Hopefully that makes sense to you. You're better option is to store all of the handles inside an array

#include <IE.au3>
Global $aIeHandles[10]

IEstart()
IEref()

Func IEstart()
    For $i = 0 to UBound($aIeHandles) - 1
        $aIeHandles[$i] = _IECreate('Google.com')
    Next
EndFunc   ;==>iestart

Func IEref()
    For $i = 0 to UBound($aIeHandles) - 1
        _IEQuit($aIeHandles[$i])
    Next
EndFunc   ;==>ieref

 

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