SYSfullPath

Top  Previous  Next

Generates a path name from Environmentvariablen.

As inputs SYSfullPath receives the name of an Environmentvariablen, steady parts of the path name, the user input and a Defaultextension. With this procedure the user receives the greatest possible freedom with the information from files without renouncing basic settings. If a name is given without extension, a file with the Defaultextension is generated. If the path which the user gives is relative, it is put the Environmentvariable before this path. If the path of the user begins with a disk drive name or '\'or'. \', so the path information is not modified.

Parametre

envVar (const char *) [IN]

If here the name of an Environmentvariablen is given, this is used as a beginning of the generated path name. This information is only used if the user path is relative.

vorname (const char *) [IN]

If the path about the Environmentvariable is changed, this path portion is copied behind the variable.

name (const char *) [IN]

This is the input made by the user for the file name.

extension (const char *) [IN]

If the name specified by the user contains no extension, this extension is suspended. The extension must contain the point before it.

ergebnis (char *) [IN / OUT]

The entire path name is put down as a result on this buffer. The variable must point at an enough big buffer.

defaultPath (const char *) [IN]

Herewith a path name can be given which is used, if in the Enviromentvariablen envVar no valid path stands.

initially (const char *) [IN]

With a surroundings variable can be given initially. Then about these surroundings variables a before opposed path is demanded. It is used no surroundings variables, ZERO or an empty sign chain can be handed over.

forceExtension (int) [IN]

With TRUE a file ending is forced, so angehangen. If here FALSE hands over, no file ending angehangen needs to become.

Declaration

#include "basic.h"

 

void DLLENTRY SYSfullPath (

const char * envVar,

const char * vorname,

const char * name,

const char * extension,

char * ergebnis,

const char * defaultpath,

const char * initially

int forceExtension

);

Example

char ergebnis [200];

setenv ("ENVI", "pfad");

SYSfullpath ("ENVI","VORNAME","USERNAME","EXT",ergebnis,"","",TRUE);

Result includes: "pfad\VORNAME\USERNAME.EXT"

SYSfullpath ("ENVI"".\VORNAME", "USER'S NAME", "EXT", ergebnis"""", TRUE);

Result includes: ".\VORNAME\USERNAME.EXT"

SYSfullpath ("ENVI","C:VORNAME","USERNAME","EXT",ergebnis,"","",TRUE);

Result includes: "C:VORNAME\USERNAME.EXT"

SYSfullpath ("ENVI""", "USERNAME.X", "EXT", ergebnis"""", FALSE);

Result includes: "pfad\USERNAME.X"