SYSmessage

Top  Previous  Next

usgeben an announcement with mistake treatment.

SYSmessage serves above all the easy treatment of memory-resident announcement texts. By the first call for a certain announcement SYSmessage delivers a buffer with the accompanying text back. If this buffer of the procedure hands over by the next call with the same announcement, no other file access occurs. The announcement number may not fall out higher than 9999.

Parametre

root (PROOT) [IN]

Act on the open data bank.

module (const char *) [IN]

This is the name of the procedure under which the announcement is filed in the file MELDUNG.DAT.

num (int) [IN]

This is the running number of the announcement within a module.

var (const char *) [IN]

This should be a static variable who is initialized with ZERO. Of these variables the result of the procedure should be assigned.

It can be handed over instead of this also always ZERO. The pointer which the function delivers as a result, has to go then immediately with Free are removed.

... [IN]

When other parametres are able like with printf the values for %d, %s... follow.

Result

(char *) [OUT]

If the announcement could be spent successfully, the procedure delivers this string back. The string was requested with Malloc by the system and can be removed either with Free again, or be used by the next call as an input.

Declaration

#include "system.h"

 

char * DLLENTRY SYSmessage (

PROOT root,

const char * module,

int num,

const char * var,

...

);

Example

void gibaus (void) {

static char *meldung1, *meldung2;

meldung1=SYSmessage ("TEST", 3, meldung1);

meldung2=SYSmessage ("TEST", 4, meldung2);

meldung1=SYSmessage ("TEST", 3, meldung1);

meldung2=SYSmessage ("TEST", 4, meldung2);

Free (SYSmessage ("TEST", 5, ZERO);

Free (SYSmessage ("TEST", 6, ZERO, 13);

}

Contents of MELDUNG.DAT:

--- TEST 3

Announcement Number 1

 

--- TEST 4

Announcement Number 4

 

--- TEST 6

Announcement is %d

 

---

Issues:

Announcement Number 1

Announcement Number 4

Announcement Number 1

Announcement Number 4

Announcement is 13