RunProgram

Modified on 2013/05/11 14:30 by Eugene — Categorized as: Community Components

Syntax

public static void RunProgram(this string ProgramName, bool Wait)

public void RunProgram( string ProgramName, bool Wait )

Parameter Description

ProgramNameExecutable file
WaitTrue: resume Strategy execution only after the program terminates;

Description

Executes the specified program file, ProgramName.exe. If the Wait parameter is true, the Strategy resumes executing only after the program terminates. Otherwise it will continue executing immediately after the application is launched.

Example

Example using C# extension methods:


using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Launches Notepad by calling RunProgram string programName = "notepad.exe"; programName.RunProgram( false ); } } }

Legacy syntax example:


using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
using Community.Components; // RunProgram here
/*** Requires installation of Community.Components Extension from www.wealth-lab.com > Extensions ***/

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { // Create an instance of the class and pass WealthScript as "this" Utility u = new Utility( this );

// Launches Notepad by calling RunProgram u.RunProgram( "notepad.exe", false ); } } }