IWinApplication.Params

Syntax

Params: IWinApplicationParams;

Description

The Params property returns collection of parameters, with which the platform is started.

Comments

The collection of parameters contains elements that were specified in the startup string. It consists of the keys and parameters passed with the keys.

Fore Example

Executing the example requires a form with a button and the Memo component named Memo1. The form has the SRART_F identifier.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    WinApp: IWinApplication;
    Params: IWinApplicationParams;
    i: Integer;
Begin
    WinApp := WinApplication.Instance;
    Params := WinApp.Params;
    For i := 0 To Params.Count - 1 Do
        Memo1.Lines.Add(i.ToString + ")" + Params.Item(i));
    End For;
End Sub Button1OnClick;

If platform is started using the studio.exe PPRepository/PPRepository@PPRepository:START_F -splash "c:\splash.bmp" -customparam "test" command, after connecting to the repository the form is started. On clicking the button the Memo1 component shows values of separate parameters, which are used in the startup string.

Fore.NET Example

Executing the example requires a .NET assembly, in which a .NET form is set as a startup object. The form contains the TextBox component named TextBox1. The .NET assembly has the SRART_ASSM identifier.

Imports System.Collections.Generic;
Imports Prognoz.Platform.Interop.Ui;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    WinApp: WinApplication = New WinApplicationClass_2();
    Params: IWinApplicationParams;
    ParamV: List<String> = New List<string>();
    i: Integer;
Begin
    Params := WinApp.Params;
    For i := 0 To Params.Count - 1 Do
        ParamV.Add(i.ToString() + ")" + Params.Item[i]);
    End For;
    textBox1.Lines := ParamV.ToArray();
End Sub;

If platform is started using the studio.exe PPRepository/PPRepository@PPRepository:SRART_ASSM -splash "c:\splash.bmp" -customparam "test" command, after connecting to the repository the form is started. On clicking the button the TextBox1 component shows values of separate parameters, which are used in the startup string.

See also:

IWinApplication | Launching Platform from the Command Line Using Keys