// *********************************************************************************************************************

// This delphi program displays the complete information about library, models and parameters.

// Each line of retrieved information follows the syntax of windows inifiles:   name=value

//

// Enumerating a list of objects associated with another object is always done in the same simple way:

//             ChildObjectPointer := SimGetSomething(ParentObjectPointer, ChildObjectPointer)

// Passing nil returns the pointer to the first listed object, passing a pointer to the last object returns nil.

// *********************************************************************************************************************

program ShowCapabilies();

 

var psim, pmod, ppar: pointer;

    ptxt: pchar;

 

begin

// Create Simulator

psim := SimCreate();

 

// Retrieve Library Information

// e.g. Name=, Description=, Usage=, Helpfile=, Authors=, Version=, Build=, Date=, Copyright=, Url=, Email=...

ptxt := SimGetInfo(psim, nil); 

while ptxt <> nil do begin

  writeln(ptxt);

  ptxt := SimGetInfo(psim, ptxt); 

end;

 

// Enumerate Models

pmod := SimGetModels(psim, nil);

while pmod <> nil do begin 

 

// Retrieve Model Information

// e.g. Name=, Domain=, Level=, LWave=, RWave=, BWave=

//        Hint=, Description=, Usage=, Helpfile=, Authors=, Version=, Build=, Date=, Copyright=, Url=, Email=, History=...

  ptxt := SimGetInfo(pmod, nil); 

  while ptxt <> nil do begin

    writeln(‘  ‘, ptxt);

    ptxt := SimGetInfo(pmod, ptxt); 

  end;

 

// Enumerate Parameters

  ppar := SimGetParameters(pmod, nil);

  while ppar <> nil do begin 

 

// Retrieve Parameter Information

// e.g. Name=, Group=, Type=, Default=,

//        Hint=, Description=, Usage=, Helpfile=, History=...

    ptxt := SimGetInfo(ppar, nil); 

    while ptxt <> nil do begin

      writeln(‘    ‘, ptxt);

      ptxt := SimGetInfo(ppar, ptxt); 

    end;

 

    ppar := SimGetParameters(pmod, ppar);

  end;

  pmod := SimGetModels(psim, pmod);

end;

 

SimDestroy(psim);

end.