Sign in to follow this  
Followers 0
Laine

chain command ?

6 posts in this topic

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.

Share this post


Link to post
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!

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

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

So... what is your question? Do you need the syntax to have a script call an au3 script? See this post: http://www.autoitscript.com/forum/index.ph...ndpost&p=101407

There are many ways to do that... :-)


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
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

Share this post


Link to post
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.

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