KCssSetResult

C Styled Script
Reference Manual

<< Back  End  Next >>
 
 
INDEX
Introduction
Installation
Using The CSS Executive
Language
Directives
System Library
String Library
Regular Expression Lib.
File Library
Database Library
C API
   Embedding CSS
   Writing Libraries
   API Reference
      KCssAddFunc
      KCssCall
      KCssClose
      KCssEnableTrace
      KCssGet
      KCssGetError
      KCssGetResult
      KCssIsTrace
      KCssLoadLibrary
      KCssLoadScriptFile
      KCssLoadScriptMem
      KCssOpen
      KCssSet
      KCssSetError
      KCssSetResult
      KCssShow
      KCssStartDate
      KCssStartTime
      KCssVarResize
      KCssVarSizeof
C++ API
CSS Links
  
long KCssAPI KCssSetResult(              /* set return result */
   KCssHandle aHandle,                      /* CSS handle */
   const char *aBuffer,                     /* buffer for result */
   long aSize                               /* buffer size, -1 = ASCIZ */
);

Set return value in a C/C++ function implemention.

KCssSetResult will allways return 0 so there is no need for error checking.

Example:

void KCssAPI mthSqrt(KCssHandle aCss)
{
   char buf[40];
   long bufsiz;
 
   // get val
   bufsiz = sizeof(buf);
   if ( KCssGet(aCss, "val", buf, &bufsiz) ) return;
   double val = atof(buf);
 
   if (val < 0.0) {
      KCssSetError(aCss, "val must not be negative!", -1);
      return;
   } // if
 
   // return result
   sprintf(buf, "%f", sqrt(val));
   KCssSetResult(aCss, buf, -1);
} // mthSqrt
 Copyright © IBK LandquartLast revised by Peter Koch, 24.02.00<< Back  Top  Next >>