Jump to content

Default for standard_i/o_flag in Run() ?


 Share

Recommended Posts

Is there a default value for the standard_i/o_flag in Run()? If I set it to -1 then some Run()-commands fail to start. Do I set it to 0 everything works fine.

For example:

Run(@ComSpec, "", @SW_MAXIMIZE, -1)

Of course, this is only an optional parameter, but I need to specify a default value for it if I use some kind of MyRun() wrapper function.

Link to comment
Share on other sites

I would suggest selecting one of the values from the help:

standard_i/o_flag [optional]Provide a meaningful handle to one or more STD I/O streams of the child process.

  1 ($STDIN_CHILD) = Provide a handle to the child's STDIN stream

  2 ($STDOUT_CHILD) = Provide a handle to the child's STDOUT stream

  4 ($STDERR_CHILD) = Provide a handle to the child's STDERR stream

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Is there a default value for the standard_i/o_flag in Run()?

It's an optional parameter, so if you want the default behavior (no input or output redirected) don't provide an argument at all. :)

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

As an addition to what the people above me said.

Here's an example how I do it.

Func GlobalVarsDelete($VarName = '', $Section = 'Other')
   If $VarName = '' Then
      Return INIDelete(@TempDir & '\GlobalVars.ini', $Section)
   Else
      Return INIDelete(@TempDir & '\GlobalVars.ini', $Section, $VarName)
   EndIf
EndFunc

You can change $VarName = '' to $VarName = Default (should work).

Link to comment
Share on other sites

We called that a "mave" back when I played MUD games, Slim. :)

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

Of course, this is only an optional parameter, but I need to specify a default value for it if I use some kind of MyRun() wrapper function.

Optional UDF parameter variables are usually set to 0 ( i.e. $IOFlags = 0)

so long as 0 wouldn't be a valid input for that parameter.

Edited by quaizywabbit
[u]Do more with pre-existing apps![/u]ANYGUIv2.8
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...