Sign in to follow this  
Followers 0
electrico

variable question

6 posts in this topic

Please help me someone how to make multiply values in one variable.

As example:

$inetprocess = iexplore.exe, opera.exe, firefox.exe, chrome.exe

This is not correct. Can someone show me how to do that so one variable includes several meanings. Thanks a lot and sorry for stupid lazy question.

Regards, electrico.

Share this post


Link to post
Share on other sites



Maybe you can explain first what you exactly want to do?

In general: Have a look at Arrays in the Helpfile, which might do what you want.

Jos


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

Thanks Jos for the quick reply. My program code is:

$process[0] = "iexplore.exe"
$process[1] = "opera.exe"
$process[2] = "firefox.exe"
$process[3] = "chrome.exe"
ProcessWait ($process[0,1,2,3])
askpass()
Func askpass()
ProcessClose ("iexplore.exe")
Sleep (3000)
$passw = InputBox ("Password protected", "Enter password:", "", "*")
If $passw = String("password") Then
    ShellExecute ("http://www.google.lv")
Else
    MsgBox (16, "Not permitted!", "Sorry, you are not permitted to do this.")
EndIf
EndFunc
ProcessWaitClose ("iexplore.exe")
runagain()
Func runagain()
    Run ("C:\security.exe")
EndFunc

If you can correct my misstake, please correct it. Thanks a lot "par avace" :}

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

If you can correct my misstake, please correct it. Thanks a lot "par avace" :}

Correct what? You haven't told me what you want and to be honest this posted scriptlet doesn't make much sense to me.

- Why close IExplorer before prompting for a password?

- What is the purpose of the defined array as after that everything is hardcoded?

EDIT: The processWait line could be something like:

Global $process[4]
$process[0] = "iexplore.exe"
$process[1] = "opera.exe"
$process[2] = "firefox.exe"
$process[3] = "chrome.exe"
While 1
    If ProcessExists($process[0]) _
        and ProcessExists($process[1]) _
        and ProcessExists($process[2]) _
        and ProcessExists($process[3]) Then ExitLoop
    Sleep(20)
WEnd
askpass()

Jos

Edited by Jos

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

Thx a lot. What you mean with word "hardcoded"?

Share this post


Link to post
Share on other sites

Thx a lot. What you mean with word "hardcoded"?

http://www.answers.com/topic/hardcoded-computer-jargon

You probably also want to change this:

If $passw = String("password") Then

to

If $passw == "password" Then

Jos


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