Jump to content

Function and sub-function


JustDoIt
 Share

Recommended Posts

I am still newbie to AutoIt.

I wrote a function that includes a sub-function. The sub-function expects a string variable from the function. I'd like to compile the sub-function into an .exe file My question here is, how do I pass the string variable to the sub-function.exe ? Something like Run(' c:\sub-function.exe "some_string" ') from my Autoit function.

Thanks for your input(s).

Link to comment
Share on other sites

  • Moderators

I would assume that you have the command line argument in the app you want to run, not in the one you are going to pass the string from.

Main app:

;whatever
Run('"' & @HomeDrive & '\myScript.exe" ' & $sStringToPass, "", @SW_MAXIMIZE);Note the space after exe, if your string has spaces, you'll need to wrap that in quotes as well.oÝ÷ Ø
i¶­­ç÷¬
¦jwewºÚ"µÍY    ÌÍÐÛY[VÌH[ÙÐÞ
    ][ÝÚ[É][ÝË ][ÝÔÝ[Î ][ÝÈ  [È ÌÍÐÛY[VÌWJB[Y

Edit:

Blah@Edit Function!

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Main app:

Run('"' & @HomeDrive & '\myScript.exe" ' & $sStringToPass, "", @SW_MAXIMIZE)

App that receives Command line:

If $CmdLine[0] Then

MsgBox(64, "info", "String: " & $CmdLine[1])

EndIf

That works great. Thanks SmOke_N.

Another question: is it possible to get a return value from "myScript.exe" back to the main script that is parsing a parameter to "myScript.exe" ?

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