3.43 DM_LoadProfile

Using this function, you can read variables which can be changed by the end user and processed by the DM. This facility enables end users to influence the dialog behavior when the dialog source or the DM are not available.

DM_Boolean DML_default DM_EXPORT DM_LoadProfile
(
  DM_ID dialog,
  DM_String filename,
  DM_Options options
)

Parameters

-> DM_ID dialog

This is the identifier of the dialog for which the specified profile is to be read.

-> DM_String filename

This name denotes the profile file.

As is usual with all file accesses, the specified name may have the following structure:

environment variable:name of dialog file

The preceding environment variable serves as path on which the dialog file is to be searched.

The dialog description looks, for example, as follows:

config variable integer HUGO;

This variable now is to be set by means of the profile. The file then looks like this:

HUGO := 5;

-> DM_Options options

Currently not used. Please specify with 0.

Return Value

TRUE

File could be read.

FALSE

File could not be read.

Example

Dialog File

dialog YourDialog

{

    .xraster 10;

    .yraster 16;

}

config variable string WindowText := "Sorry no profile";

config variable integer WindowXPos := 5;

config variable integer WindowYPos := 5;

 

window W1

{

    .xleft 4;

    .ytop 6;

    .width 25;

    .title "Testwindow";

    .visible false;

    .xraster 10;

    .yraster 16;

    .posraster true;

    .sizeraster true;

    child pushbutton End

 

    {

    .xleft 7;

    .width 9;

    .ytop 6;

    .height 2;

    .text "End";

    .visible true;

    .sizeraster true;

    }

}

on End select

{

    exit ();

}

 

on dialog start

{

    W1.xleft :=WindowXPos;

    W1.ytop :=WindowYPos;

    W1.title :=WindowText;

    W1.visible :=true;

}

Profile

WindowXPos:=10;

WindowYPos:=5;

WindowText:="Out Of Profile";

Note

This profile can only be loaded in the application via DM_LoadProfile or it can be loaded in the simulator via -profile <filename>.

Furthermore, you have to note that DM_LoadProfile has to be called before DM_StartDialog and DM_EventLoop.

See also

C function DM_SaveProfile

Built-in function loadprofile()