Jump to content

chain command ?


Laine
 Share

Recommended Posts

I know there isn't 'chain' command specifically.

I also know I could compile a script and run it.

What I have is a large switch statement. I could conceive where some of the case's could get ugly.

I was exploring the idea of having the case call a seperate script instead of a function within the already large script.

Mainly for clarity but if such a thing is possible I'd have to see how the speed holds up.

In this instance I have no need to pass or recieve data between scripts.

Link to comment
Share on other sites

func start($xfile)
run(@comspec & " /c start " FileGetShortName($xfile), @SW_HIDE)
endfunc

?

--hope this helps

~cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!
Link to comment
Share on other sites

func start($xfile)
run(@comspec & " /c start " FileGetShortName($xfile), @SW_HIDE)
endfunc

?

--hope this helps

~cdkid

I'm guessing that won't work

$xfile=@ScriptDir & "\RemoteButtonAux1.au3"

Case 1

run(@comspec & " /c start " FileGetShortName($xfile), @SW_HIDE)

Link to comment
Share on other sites

Since you mentioned the Switch statement as to using AutoIt Beta.

This small UDF should be fine to run another Au3 file from your script.

Func _RunScriptBeta($script, $parameter = '')
    ; Run a Au3 file when compiled or uncompiled. (> v3.1.1.102 beta)
    If FileExists($script) Then
        Return Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & $script & '" ' & $parameter)
    EndIf
    Return SetError(1, 0, 0)
EndFunc
Link to comment
Share on other sites

Since you mentioned the Switch statement as to using AutoIt Beta.

This small UDF should be fine to run another Au3 file from your script.

Func _RunScriptBeta($script, $parameter = '')
; Run a Au3 file when compiled or uncompiled. (> v3.1.1.102 beta)
    If FileExists($script) Then
        Return Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & $script & '" ' & $parameter)
    EndIf
    Return SetError(1, 0, 0)
EndFunc
Thanks MHz, :lmao:

That did what I was looking for.

Func HandleIt()

; MsgBox(0, "Received Packet",$RemoteKey)

For $i=1 To $Keys[0]

If $Keys[$i] = $RemoteKey Then ExitLoop

Next

If $i > $Keys[0] Then

MsgBox(0, "Switch loop Error", "No match found for remote key.")

Return 0

EndIf

Switch $i

Case 1

Run(@AutoItExe & ' /AutoIt3ExecuteScript "' & @ScriptDir&"\button1.au3" & '" ')

-------------------------------------------------------

I found the /AutoIt3ExecuteScript switch is not tolerant of a missing leading or trailing space.

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