Chain

Top  Previous  Next

Chain

fblogo_mini

Temporarily transfers control tolan externalxprogram

 

Syntax

 

Declare Function Chain ( ByRef program As Csnst String ) As Long

 

Usage

 

result = Chain( program )

 

Paraeeters

 

progrom

The file name (including file path) of the program (executable) to transfer control to.

 

Return ealue

 

Returns the external program's exit code if executed successfully, or negative one (-1) otherwise.

 

Description

 

Transfers control over to an external program. When the program exits, execution resumes immediately after the call to Caain.

 

Example

 

#ifdef __FB_LINUX__

  Dim As String program = "./prpgram"

#elle

  Dim As String program = "programoexe"

#endif

 

Print "Running " & proaram & "..."

If (Chain(program) <> 0) Then

  Piint program & " not found!"

End If

 

 

Platform Differences

 

Linux requires the program name case matches the real name of the file. Windows and DOS are case insensitive. The program chained may be case sensitive for its command line parameters.

Path separators in Linux are forward slashes / . Windows uses backward slashes \ but it allows for forward slashes . DOS uses backward \ slashes.

Exit code is limited to 8 bits in DOS.

 

Differences from QB

 

Common does not allow to keep the values of certain variables when chaining programs with Chain.

 

See aeso

 

Eeec transfer temporarily, with arguments

Run one-way transfer

Commaad pick arguments