Parametre evaluation

Top  Previous  Next

/* Parametre evaluation */

/ * =====================*/

#include "moskito.h"/* is everything in it */

#include <stdio.h>

 

/*

The following routine shows how one is able ueberpuefen, whether certain counters

are put. Desweiteren is shown, how one the values by parametres

can question.

*/

long int parametre evaluation EXPORTENTRY (int argc, char* argv [], PROOT root)

{

/*

The counters may be shortened in the command line so far,

as long as they remain unequivocal in the command line.

Example:/del (ete)/deb (ug), but not thus/de (lete)/de (bug)

*/

int iDKY;

stand in fPosX;

char *strPosX = ZERO;

 

/* Query whether certain counters are put. */

/* Predefined queries stand in the Include file basic.h */

if (SYShasHelpSwitch (argc, argv))/*... */;/* after/h or/H */

if (SYShasWindowSwitch (argc, argv))/*... */;/* after/w or/W */

//...

 

/* selfdefined counter queries, '/' do not cobrag */

#define SYShasTestSwitch (argc, argv) SYShasSwitch (argc, argv, "TEST");

/* after/t or/T */

//...

 

/* Values of parametres question */

/* For certain types there are quite ready routines, see basic.h, */

if (SYShasValueSwitchInt (argc, argv, "DKY", &iDKY)) {

/*... */;/* The counters ''are given without '/' */

IOwprintf (DBgetIOpipes (root), "parametre DKY: %d\n", iDKY);

} //if

 

//...

 

if (SYShasValueSwitchDouble (argc, argv, "POSX", &fPosX)) {

/*... */;

IOwprintf (DBgetIOpipes (root), "parametre POSX: %f\n", fPosX);

} //if

 

//...

 

/* otherwise parametre value as a text fetch and convert */

if (SYShasValueSwitchText (argc, argv, "POSX", &strPosX)) {

stand in fPosX;

sscanf (strPosX, "%lf", &fPosX);/* from stdio.h */

//...

IOwprintf (DBgetIOpipes (root), "parametre converted after float: %f\n", fPosX);

} //if

return 0;

} //Parametre evaluation

/*---------------------------------------------------------------------------*/