#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include "../command.h"
#include "../match.h"
#include "../matchc.h"
Go to the source code of this file.
Data Structures | |
struct | _JoinItem |
struct | _formatParams |
Defines | |
#define | FMT_xMIN 1e-8 |
#define | FMT_xMAX 1e+9 |
#define | FMT_RND 9 |
#define | FMT_xRND 1e+9 |
#define | FMT_xRND2 1e+8 |
#define | INITIALIZE |
#define | CHUNK_SIZE 1024 |
#define | F_MINUS 1 |
#define | F_PLUS 2 |
#define | F_ZERO 4 |
#define | F_BLANK 8 |
#define | F_SHARP 16 |
#define | FORMAT_SYNTAX_ERROR iErrorCode = COMMAND_ERROR_ARGUMENT_RANGE; goto error_escape; |
#define | ASSERT_PARAMETER_COUNT if (iArg >= cParameters) {iErrorCode = COMMAND_ERROR_FEW_ARGS; goto error_escape;} |
#define | CHECK_MEM(x) if (!check_size(¶ms,(x))){iErrorCode = COMMAND_ERROR_MEMORY_LOW; goto error_escape;} |
#define | CHECK_OPERATION(x) if (!x){iErrorCode = COMMAND_ERROR_MEMORY_LOW; goto error_escape;} |
#define | GETNPARAM |
#define | NEXTCHAR STRINGVALUE(RESULT)[ iResult < cbResult ? iResult++ : cbResult ] |
#define | GETLEFTVALUE |
Typedefs | |
typedef _formatParams | formatParams |
typedef _formatParams * | pFormatParams |
Functions | |
static int | SUBSTRCMP (char *a, char *b, long length, int iCase) |
while (s &&lLen) | |
if (memory_IsUndef(Op1)) | |
LONGVALUE (RESULT) | |
while (lLen--) | |
while (lLen &&isspace(*r)) r++ | |
while (lLen) | |
while (lStringLength--) | |
while (lStringLength &&isspace(r[lStringLength-1])) lStringLength-- | |
while (lStringLength) | |
if (lStringLength) | |
if (memory_IsUndef(Op2)) | |
if (nItem) | |
if (memory_IsUndef(Op3)) | |
while (lStart-1<=lLength-lStringLength) | |
if (lLength< lStringLength) | |
if (memory_IsUndef(Op4)) | |
if (memory_IsUndef(Op5)) | |
if (!ReplaceAll &&lCalculatedRepetitions > lRepetitions) lCalculatedRepetitions | |
if (lStart > 1) | |
while (lStart<=lLength) | |
while (lLength) | |
if (STRLEN(Op)==0) | |
if (Op==NULL) | |
if (lCode==0) | |
sprintf (STRINGVALUE(RESULT),"%*X", lLength, lStore) | |
STRLEN (RESULT) | |
while (lStore) | |
if (memory_IsUndef(WholeString)||STRLEN(WholeString)==0L) | |
if (memory_IsUndef(Delimiter)||STRLEN(Delimiter)==0) | |
if (ResultArray==NULL) | |
FREE (Temp) | |
if (!nItem) | |
if (!(CDR(nItem))) | |
while (JoinItem) | |
int | initialize_like (pExecuteObject pEo) |
static int | allocate_MatchSets (pExecuteObject pEo) |
if (memory_IsUndef(Op1)||!match_index(JokerCharacter=*STRINGVALUE(Op1))) | |
match_ModifySet (pLastResult->pThisMatchSets, JokerCharacter, pL,(unsigned char *) p, MATCH_ADDC|MATCH_SSIJ|MATCH_NULS) | |
match_ModifySet (pLastResult->pThisMatchSets, JokerCharacter, pL,(unsigned char *) p, MATCH_ADDC|MATCH_SMUJ|MATCH_NULS) | |
if (cArraySize > pLastResult->cArraySize) | |
if (iErrorCode) | |
if (memcpy((RESULT) STRINGVALUE(Op1)[StringLen-1]== '\n') | |
memcpy (STRINGVALUE(RESULT), pLastResult->ParameterArray[index], pLastResult->pcbParameterArray[index]) | |
if (memory_IsUndef(vOptionValue)) | |
options_Set (pEo, pszOptionName, lOptionValue) | |
CONVERT2ZCHAR (Op1, buffer) | |
FREE (buffer) | |
if (plOptionValue) | |
int | check_size (pFormatParams params, long len) |
int | printInt (pFormatParams params) |
int | printDouble (pFormatParams params) |
int | printChar (pFormatParams params) |
static double | fint (double x) |
static double | frac (double x) |
static int | sgn (double x) |
static int | zsgn (double x) |
static double | fround (double x, int dig) |
static void | fptoa (double x, char *dest) |
static void | rmzeros (char *buf) |
static void | bestfta_p (double x, char *dest, double minx, double maxx) |
static void | bestfta (double x, char *dest) |
static void | expfta (double x, char *dest) |
static void | fmt_nmap (int dir, char *dest, char *fmt, char *src) |
static void | fmt_omap (char *dest, const char *fmt) |
static int | fmt_cdig (char *fmt) |
static int | format_num (char *dest, const char *fmt_cnst, double x) |
while (nItem) | |
if (cParameters) | |
while (size > 0) | |
FREE (pvArgs) | |
if (RESULT==NULL) | |
memcpy (STRINGVALUE(RESULT), params.buf, params.bufPtr) | |
free (params.buf) | |
if (params.buf) free(params.buf) | |
ERROR (iErrorCode) | |
static END unsigned long | TruncatedLength (int lLen, unsigned long iArgStr) |
while (iStr< STRLEN(vFormat)) | |
if (!memory_IsUndef(vRecord)&&!memory_IsUndef(vFormat)) | |
CONVERT2ZCHAR (Argument, pszKey) | |
if (pszSecKey==NULL) | |
if (iError==COMMAND_ERROR_SUCCESS) | |
FREE (pszKey) | |
if (iError||type==CFT_NODE_BRANCH) ERROR(COMMAND_ERROR_ARGUMENT_RANGE) | |
switch (type) | |
Variables | |
static double | nfta_eplus [] |
static double | nfta_eminus [] |
NODE | nItem |
VARIABLE | Op1 |
VARIABLE | Op2 |
long | lFinalStringLength |
long | lLen |
char * | s |
char * | r |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = CONVERT2STRING(_EVALUATEEXPRESSION(CAR(nItem))) | |
ASSERTOKE | |
nItem = CDR(nItem) | |
Op2 = CONVERT2STRING(_EVALUATEEXPRESSION(CAR(nItem))) | |
ASSERTOKE | |
lFinalStringLength = Op1 ? STRLEN(Op1) : 0 | |
lFinalStringLength = Op2 ? STRLEN(Op2) : 0 | |
RESULT = NEWMORTALSTRING(lFinalStringLength) | |
r = STRINGVALUE(RESULT) | |
s = Op1 ? STRINGVALUE(Op1) : NULL | |
lLen = Op1 ? STRLEN(Op1) : 0 | |
s = Op2 ? STRINGVALUE(Op2) : NULL | |
lLen = Op2 ? STRLEN(Op2) : 0 | |
END NODE | nItem |
VARIABLE | Op1 |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
RESULT = NEWMORTALLONG | |
END NODE | nItem |
VARIABLE | Op1 |
char * | r |
unsigned long | lLen |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
RESULT = Op1 | |
r = STRINGVALUE(RESULT) | |
lLen = STRLEN(RESULT) | |
END NODE | nItem |
VARIABLE | Op1 |
char * | r |
unsigned long | lLen |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
RESULT = Op1 | |
r = STRINGVALUE(RESULT) | |
lLen = STRLEN(RESULT) | |
END NODE | nItem |
VARIABLE | Op1 |
char * | r |
char * | s |
unsigned long | lStringLength |
unsigned long | lLen |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
r = STRINGVALUE(Op1) | |
lLen = STRLEN(Op1) | |
lLen | |
s = r | |
lStringLength = 0 | |
RESULT = NEWMORTALSTRING(lStringLength) | |
r = STRINGVALUE(RESULT) | |
Op1 = CONVERT2STRING(Op1) | |
r = STRINGVALUE(Op1) | |
lStringLength = STRLEN(Op1) | |
RESULT = NEWMORTALSTRING(lStringLength) | |
r = STRINGVALUE(RESULT) | |
s = STRINGVALUE(Op1) | |
END NODE | nItem |
VARIABLE | Op1 |
char * | r |
char * | s |
unsigned long | lStringLength |
unsigned long | lLen |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
r = STRINGVALUE(Op1) | |
lLen = STRLEN(Op1) | |
lStringLength = STRLEN(Op1) | |
lLen | |
lStringLength | |
s = r | |
RESULT = NEWMORTALSTRING(lStringLength) | |
r = STRINGVALUE(RESULT) | |
END NODE | nItem |
VARIABLE | Op1 |
VARIABLE | Op2 |
VARIABLE | Op3 |
long | lStart |
long | lLength |
long | lStringLength |
char * | r |
char * | s |
int | iCase = OPTION("compare")&1 |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
nItem = CDR(nItem) | |
lLength = STRLEN(Op1) | |
r = STRINGVALUE(Op1) | |
Op2 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op2 = CONVERT2STRING(Op2) | |
nItem = CDR(nItem) | |
lStringLength = STRLEN(Op2) | |
s = STRINGVALUE(Op2) | |
Op3 = NULL | |
RESULT = NULL | |
RETURN | |
END NODE | nItem |
VARIABLE | Op1 |
VARIABLE | Op2 |
VARIABLE | Op3 |
long | lStart |
long | lLength |
long | lStringLength |
char * | r |
char * | s |
int | iCase = OPTION("compare")&1 |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
nItem = CDR(nItem) | |
lLength = STRLEN(Op1) | |
r = STRINGVALUE(Op1) | |
Op2 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op2 = CONVERT2STRING(Op2) | |
nItem = CDR(nItem) | |
lStringLength = STRLEN(Op2) | |
s = STRINGVALUE(Op2) | |
Op3 = NULL | |
RESULT = NULL | |
RETURN | |
END NODE | nItem |
VARIABLE | Op1 |
VARIABLE | Op2 |
VARIABLE | Op3 |
VARIABLE | Op4 |
VARIABLE | Op5 |
long | lRepetitions |
long | lCalculatedRepetitions |
int | ReplaceAll |
long | l_start |
long | lStart |
long | lLength |
long | lSearchLength |
long | lReplaceLength |
long | lResult |
char * | r |
char * | s |
char * | q |
char * | w |
int | iCase = OPTION("compare")&1 |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
nItem = CDR(nItem) | |
lLength = STRLEN(Op1) | |
r = STRINGVALUE(Op1) | |
Op2 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op2 = CONVERT2STRING(Op2) | |
nItem = CDR(nItem) | |
lSearchLength = STRLEN(Op2) | |
s = STRINGVALUE(Op2) | |
Op3 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op3 = CONVERT2STRING(Op3) | |
lReplaceLength = STRLEN(Op3) | |
nItem = CDR(nItem) | |
w = STRINGVALUE(Op3) | |
Op4 = NULL | |
Op5 = NULL | |
lResult = STRLEN(Op1) + lCalculatedRepetitions * (lReplaceLength-lSearchLength) | |
RESULT = NEWMORTALSTRING(lResult) | |
lStart = l_start | |
q = STRINGVALUE(RESULT) | |
END NODE | nItem |
VARIABLE | Op1 |
VARIABLE | Op2 |
VARIABLE | Op3 |
long | lStart |
long | lLength |
long | lStringLength |
char * | r |
char * | s |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
nItem = CDR(nItem) | |
Op2 = EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
nItem = CDR(nItem) | |
else | lLength = -1 |
lStart | |
lStringLength = STRLEN(Op1) | |
END NODE | nItem |
VARIABLE | Op1 |
long | lLength |
long | lStringLength |
char * | r |
char * | s |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
nItem = CDR(nItem) | |
lLength = LONGVALUE(CONVERT2LONG(EVALUATEEXPRESSION(CAR(nItem)))) | |
ASSERTOKE | |
END NODE | nItem |
VARIABLE | Op1 |
long | lLength |
long | lStringLength |
char * | r |
char * | s |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
nItem = CDR(nItem) | |
lLength = LONGVALUE(CONVERT2LONG(EVALUATEEXPRESSION(CAR(nItem)))) | |
ASSERTOKE | |
RESULT = NEWMORTALSTRING(lStringLength) | |
r = STRINGVALUE(RESULT) | |
END NODE | nItem |
long | lLength |
char * | r |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
lLength = LONGVALUE(CONVERT2LONG(EVALUATEEXPRESSION(CAR(nItem)))) | |
ASSERTOKE | |
END NODE | nItem |
VARIABLE | Op |
long | lLength |
char | cFill |
char * | r |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
lLength = LONGVALUE(CONVERT2LONG(EVALUATEEXPRESSION(CAR(nItem)))) | |
ASSERTOKE | |
r = STRINGVALUE(RESULT) | |
END long | lCharCode |
USE_CALLER_MORTALS | |
lCharCode = LONGVALUE(CONVERT2LONG(EVALUATEEXPRESSION(CAR(PARAMETERLIST)))) | |
ASSERTOKE | |
lCharCode = 256 | |
Op = CONVERT2STRING(Op) | |
lCharCode = (unsigned char)*(STRINGVALUE(Op)) | |
RESULT = NEWMORTALLONG | |
END NODE | nItem |
VARIABLE | Op1 |
long | lStringLength |
char * | r |
char * | s |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
Op1 = _EVALUATEEXPRESSION(CAR(nItem)) | |
ASSERTOKE | |
Op1 = CONVERT2STRING(Op1) | |
s = STRINGVALUE(Op1) | |
lStringLength = STRLEN(Op1) | |
s = lStringLength-1 | |
RESULT = NEWMORTALSTRING(lStringLength) | |
r = STRINGVALUE(RESULT) | |
END VARIABLE | Op |
USE_CALLER_MORTALS | |
Op = _EVALUATEEXPRESSION(CAR(PARAMETERLIST)) | |
ASSERTOKE | |
RESULT = CONVERT2STRING(Op) | |
END unsigned long | lCode |
unsigned long | lLength |
unsigned long | lStore |
VARIABLE | Op |
USE_CALLER_MORTALS | |
Op = EVALUATEEXPRESSION(CAR(PARAMETERLIST)) | |
ASSERTOKE | |
lCode = LONGVALUE(CONVERT2LONG(Op)) | |
lStore = lCode | |
lLength = 0 | |
RESULT = NEWMORTALSTRING(lLength+1) | |
END unsigned long | lCode |
unsigned long | lLength |
unsigned long | lStore |
char * | s |
VARIABLE | Op |
USE_CALLER_MORTALS | |
Op = EVALUATEEXPRESSION(CAR(PARAMETERLIST)) | |
ASSERTOKE | |
lCode = LONGVALUE(CONVERT2LONG(Op)) | |
lStore = lCode | |
lLength = 0 | |
RESULT = NEWMORTALSTRING(lLength) | |
s = STRINGVALUE(RESULT) + lLength -1 | |
END VARIABLE | WholeString |
END VARIABLE | Delimiter |
END VARIABLE | Quoter |
END VARIABLE | ResultArray |
LEFTVALUE | Array |
unsigned long | i |
unsigned long | lChunkCounter |
unsigned long | iStart |
unsigned long | iCount |
long | refcount |
char * | Temp |
WholeString = CONVERT2STRING(_EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
Delimiter = CONVERT2STRING(_EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
Quoter = CONVERT2STRING(_EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
Array = EVALUATELEFTVALUE_A(PARAMETERNODE) | |
ASSERTOKE | |
* | Array = ResultArray |
END VARIABLE | WholeString |
END VARIABLE | Delimiter |
END VARIABLE | ResultArray |
LEFTVALUE | Array |
unsigned long | i |
unsigned long | lChunkCounter |
unsigned long | iStart |
long | refcount |
WholeString = CONVERT2STRING(_EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
Delimiter = CONVERT2STRING(_EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
Array = EVALUATELEFTVALUE_A(PARAMETERNODE) | |
ASSERTOKE | |
* | Array = ResultArray |
END NODE | nItem |
VARIABLE | WholeString |
VARIABLE | Delimiter |
LEFTVALUE | LeftValue |
unsigned long | i |
unsigned long | iStart |
long | refcount |
WholeString = CONVERT2STRING(EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
Delimiter = CONVERT2STRING(EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
nItem = PARAMETERNODE | |
char * | s |
VARIABLE | vJoiner |
VARIABLE | vStringArray |
int | iFirstLoop |
_JoinItem * | JoinItem |
_JoinItem ** | pJoinItem |
_JoinItem * | JoinFree |
unsigned long | lResultLength |
unsigned long | lItemNumber |
unsigned long | i |
JoinItem = NULL | |
pJoinItem = &JoinItem | |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
vJoiner = CONVERT2STRING(_EVALUATEEXPRESSION(CAR(nItem))) | |
ASSERTOKE | |
nItem = CDR(nItem) | |
RESULT = NEWMORTALSTRING(lResultLength) | |
s = STRINGVALUE(RESULT) | |
VARIABLE | Op1 |
VARIABLE | Op2 |
pPatternParam | pLastResult |
char | JokerCharacter |
char * | p |
unsigned long | pL |
INITIALIZE | |
Op1 = CONVERT2STRING(_EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
Op2 = CONVERT2STRING(_EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
END VARIABLE | Op1 |
END VARIABLE | Op2 |
pPatternParam | pLastResult |
char | JokerCharacter |
char * | p |
unsigned long | pL |
INITIALIZE | |
Op1 = CONVERT2STRING(_EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
Op2 = CONVERT2STRING(_EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
END VARIABLE | Op1 |
pPatternParam | pLastResult |
char | JokerCharacter |
INITIALIZE | |
Op1 = CONVERT2STRING(_EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
iError | |
StringLen = STRLEN(Op1) | |
index | |
RESULT = NEWMORTALSTRING(pLastResult->pcbParameterArray[index]) | |
END char * | pszOptionName |
long | lOptionValue |
VARIABLE | vOptionValue |
pszOptionName = pEo->StringTable+pEo->CommandArray[_ActualNode-1].Parameter.CommandArgument.Argument.szStringValue | |
NEXTPARAMETER | |
vOptionValue = CONVERT2LONG(EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
lOptionValue = LONGVALUE(vOptionValue) | |
END VARIABLE | Op1 |
unsigned long * | plOptionValue |
char * | buffer |
USE_CALLER_MORTALS | |
Op1 = CONVERT2STRING(_EVALUATEEXPRESSION(CAR(PARAMETERLIST))) | |
ASSERTOKE | |
plOptionValue = OPTIONR(buffer) | |
else | RESULT = NULL |
unsigned long | cParameters |
unsigned long | iArg |
char * | ptr |
char * | p |
long | size |
formatParams | params |
VARIABLE | vFormat |
VARIABLE * | pvArgs |
NODE | nItem |
char | fmt [128] |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
vFormat = CONVERT2STRING(_EVALUATEEXPRESSION(CAR(nItem))) | |
ASSERTOKE | |
nItem = CDR(nItem) | |
cParameters = 0 | |
else | pvArgs = NULL |
nItem = CDR(PARAMETERLIST) | |
iArg = 0 | |
iArg = 0 | |
params | buf = (char*)malloc(CHUNK_SIZE) |
params | bufSize = CHUNK_SIZE |
params | bufPtr = 0 |
ptr = STRINGVALUE(vFormat) | |
size = STRLEN(vFormat) | |
RESULT = NEWMORTALSTRING(params.bufPtr) | |
RETURN | |
error_escape | __pad0__ |
NODE | nItem |
VARIABLE | vFormat |
VARIABLE * | pvArgs |
unsigned long | cParameters |
unsigned long | cbResult |
unsigned long | iArg |
unsigned long | iStr |
unsigned long | iArgStr |
unsigned long | iResult |
unsigned long | lLen |
unsigned long | lLenS |
long | lParam |
unsigned long | uParam |
int | fLen |
char | cChar |
double | dParam |
unsigned char * | pszD |
USE_CALLER_MORTALS | |
nItem = PARAMETERLIST | |
vFormat = CONVERT2STRING(_EVALUATEEXPRESSION(CAR(nItem))) | |
ASSERTOKE | |
nItem = CDR(nItem) | |
cParameters = 0 | |
else | pvArgs = NULL |
nItem = CDR(PARAMETERLIST) | |
iArg = 0 | |
iStr = 0 | |
iArg = 0 | |
cbResult = 0 | |
RESULT = NEWMORTALSTRING(cbResult) | |
iStr = 0 | |
iArg = 0 | |
iResult = 0 | |
NODE | nItem |
VARIABLE | vRecord |
VARIABLE | vFormat |
LEFTVALUE | LeftValue |
unsigned long | lLen |
unsigned long | iStr |
unsigned long | iRec |
unsigned long | lLenS |
unsigned long | lMag |
unsigned long | i |
int | fLen |
int | iThisChar |
long | refcount |
vRecord = CONVERT2STRING(EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
vFormat = CONVERT2STRING(EVALUATEEXPRESSION(PARAMETERNODE)) | |
ASSERTOKE | |
NEXTPARAMETER | |
nItem = PARAMETERNODE | |
END char * | pszConf |
long | lConf |
double | dConf |
int | type |
int | iError |
char * | pszKey |
char * | pszSecKey |
VARIABLE | Argument |
int | i |
int | j |
Argument = EVALUATEEXPRESSION(CAR(PARAMETERLIST)) | |
ASSERTOKE | |
Argument = CONVERT2STRING(Argument) | |
pszSecKey = ALLOC(STRLEN(Argument)+2) | |
iError = cft_GetEx(pEo->pConfig,pszSecKey,NULL,&pszConf,&lConf,&dConf,&type) | |
iError = cft_GetEx(pEo->pConfig,pszKey,NULL,&pszConf,&lConf,&dConf,&type) | |
END | NOTIMPLEMENTED |
END | NOTIMPLEMENTED |
END | NOTIMPLEMENTED |
END | NOTIMPLEMENTED |
END | NOTIMPLEMENTED |
END | NOTIMPLEMENTED |
END | NOTIMPLEMENTED |
END | NOTIMPLEMENTED |
END | NOTIMPLEMENTED |
|
Definition at line 2551 of file string.c. Referenced by while(). |
|
Definition at line 2552 of file string.c. Referenced by while(). |
|
Definition at line 2553 of file string.c. Referenced by while(). |
|
Definition at line 2544 of file string.c. Referenced by check_size(). |
|
Definition at line 2548 of file string.c. Referenced by printDouble(), printInt(), and while(). |
|
Definition at line 2545 of file string.c. Referenced by printChar(), printDouble(), printInt(), and while(). |
|
Definition at line 2546 of file string.c. Referenced by printDouble(), printInt(), and while(). |
|
Definition at line 2549 of file string.c. Referenced by printDouble(), printInt(), and while(). |
|
Definition at line 2547 of file string.c. Referenced by printChar(), printDouble(), printInt(), and while(). |
|
|
|
Definition at line 32 of file string.c. Referenced by bestfta(). |
|
Definition at line 31 of file string.c. Referenced by bestfta(). |
|
|
|
|
|
Definition at line 2550 of file string.c. Referenced by while(). |
|
Value: if( nItem ){LeftValue = EVALUATELEFTVALUE_A(CAR(nItem));\ ASSERTOKE;\ DEREFERENCE(LeftValue);\ if( *LeftValue != NULL )\ memory_ReleaseVariable(pEo->pMo,*LeftValue);\ nItem = CDR(nItem);}else LeftValue = NULL; Definition at line 3845 of file string.c. Referenced by if(). |
|
Value: lLen = 0; fLen = 0;\ while( iStr < STRLEN(vFormat) && isdigit(STRINGVALUE(vFormat)[iStr]) ){\ lLen = 10*lLen + STRINGVALUE(vFormat)[iStr] - '0';\ fLen=1;\ iStr++;\ } |
|
Value: if( initialize_like(pEo) )ERROR(COMMAND_ERROR_MEMORY_LOW); \ pLastResult = (pPatternParam)PARAMPTR(CMD_LIKEOP); |
|
|
|
|
|
|
|
Definition at line 1949 of file string.c. References ALLOC, COMMAND_ERROR_MEMORY_LOW, match_InitSets(), and pLastResult. |
|
Definition at line 2888 of file string.c. References bestfta_p(), FMT_xMAX, and FMT_xMIN. Referenced by format_num(). |
|
Definition at line 2777 of file string.c. References buf, E, nfta_eminus, nfta_eplus, sgn(), and strcpy(). |
|
Definition at line 2569 of file string.c. References _formatParams::buf, _formatParams::bufPtr, _formatParams::bufSize, CHUNK_SIZE, free(), params, and ptr. Referenced by printChar(), printDouble(), and printInt(). |
|
|
|
|
|
|
|
Definition at line 2896 of file string.c. References bestfta_p(). |
|
Definition at line 2698 of file string.c. Referenced by frac(). |
|
Definition at line 3008 of file string.c. References count. Referenced by format_num(). |
|
Definition at line 2908 of file string.c. Referenced by format_num(). |
|
Definition at line 2984 of file string.c. Referenced by format_num(). |
|
Definition at line 3040 of file string.c. References bestfta(), fmt, fmt_cdig(), fmt_nmap(), fmt_omap(), free(), fround(), sprintf(), and strcpy(). Referenced by while(). |
|
Definition at line 2744 of file string.c. References sprintf(). |
|
Definition at line 2706 of file string.c. References fint(). Referenced by execute_IsStringInteger(). |
|
|
|
|
|
|
|
|
|
|
Definition at line 2730 of file string.c. Referenced by format_num(). |
|
|
|
|
|
|
|
Definition at line 3880 of file string.c. References COMMAND_ERROR_MEMORY_LOW, ERROR(), GETLEFTVALUE, GETNPARAM, LONGVALUE(), memcpy(), STRINGVALUE(), and STRLEN(). |
|
|
|
Definition at line 3427 of file string.c. References _formatParams::buf, COMMAND_ERROR_MEMORY_LOW, ERROR(), free(), and params. |
|
Definition at line 3241 of file string.c. References ALLOC, COMMAND_ERROR_MEMORY_LOW, and ERROR(). |
|
Definition at line 2535 of file string.c. References LONGVALUE(). |
|
Definition at line 2495 of file string.c. References options_Reset(), pEo, and RETURN. |
|
Definition at line 2401 of file string.c. References INITIALIZE. |
|
|
|
Definition at line 2318 of file string.c. References ALLOC, COMMAND_ERROR_MEMORY_LOW, ERROR(), and FREE. |
|
|
|
Definition at line 1852 of file string.c. References ASSERTOKE. |
|
|
|
|
|
Definition at line 1455 of file string.c. References STRLEN(). |
|
Definition at line 1449 of file string.c. References memory_ReleaseVariable(), pEo, and RETURN. |
|
|
|
Definition at line 1273 of file string.c. References RETURN. |
|
Definition at line 1188 of file string.c. References RETURN. |
|
Definition at line 708 of file string.c. References memcpy(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 464 of file string.c. References ASSERTOKE. |
|
|
|
|
|
|
|
Definition at line 1928 of file string.c. References ALLOC, COMMAND_ERROR_MEMORY_LOW, and pLastResult. Referenced by collect_dirs(). |
|
|
|
|
|
Referenced by modu_Init(). |
|
|
|
|
|
Referenced by modu_Init(), and RaiseError(). |
|
Definition at line 2644 of file string.c. References _formatParams::buf, _formatParams::bufPtr, check_size(), F_MINUS, F_ZERO, _formatParams::flags, memcpy(), memset(), params, _formatParams::prec, size, _formatParams::vSize, _formatParams::vString, and _formatParams::width. Referenced by while(). |
|
Definition at line 2616 of file string.c. References _formatParams::buf, buf, _formatParams::bufPtr, check_size(), F_BLANK, F_MINUS, F_PLUS, F_SHARP, F_ZERO, _formatParams::flags, flags, len, params, _formatParams::prec, sprintf(), _formatParams::type, _formatParams::vDouble, and _formatParams::width. Referenced by while(). |
|
Definition at line 2584 of file string.c. References _formatParams::buf, buf, _formatParams::bufPtr, check_size(), F_BLANK, F_MINUS, F_PLUS, F_SHARP, F_ZERO, _formatParams::flags, flags, len, params, _formatParams::prec, sprintf(), _formatParams::type, _formatParams::vLong, and _formatParams::width. Referenced by while(). |
|
|
|
Definition at line 2714 of file string.c. Referenced by bestfta_p(). |
|
|
Referenced by basext_GetArgsF(), besFUNCTION(), CHECK_OPTION(), FileIsSecure(), if(), memory_CopyArray(), return(), serconv(), serconvXML(), SPrintVariable(), STRCMP(), switch(), varcmp(), varhashpjw(), and while(). |
|
Definition at line 68 of file string.c. Referenced by while(). |
|
Definition at line 4123 of file string.c. References ERROR(), LONGVALUE(), memcpy(), STRINGVALUE(), and STRLEN(). |
|
Definition at line 3452 of file string.c. Referenced by while(). |
|
Definition at line 3596 of file string.c. References GETNPARAM, STRINGVALUE(), STRLEN(), and TruncatedLength(). |
|
|
|
|
Definition at line 1906 of file string.c. References FREE, memcpy(), STRINGVALUE(), and STRLEN(). |
|
|
|
|
|
Definition at line 712 of file string.c. References memcpy(), and SUBSTRCMP(). |
|
Definition at line 481 of file string.c. References LONGVALUE(), RETURN, and SUBSTRCMP(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 3263 of file string.c. Referenced by besFUNCTION(), bestfta_p(), brushup(), ftp_report(), GuardThread(), httpd_report(), main(), MyFiles(), tty::open_output_mutex(), pathdialog(), printDouble(), printInt(), and SPrintVariable(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FORMAT =section string =title FORMAT() =display FORMAT() The function format accepts variable number of arguments. The first argument is a format string and the rest of the arguments are used to create the result string according to the format string. This way the function T<format> is like the C function T<sprintf>. The format string can contain normal characters and control substrings. The control substring have the form T<%[flags][width][.precision]type>. It follows the general T<sprintf> format except that type prefixes are not required or allowed and type can only be "dioxXueEfgGsc". The T<*> for width and precision is supported. An alternate format BASIC-like for numbers has the form T<~format~> where T<format> can be: # Digit or space 0 Digit or zero ^ Stores a number in exponential format. Unlike QB's USING format this is a place-holder like the #. . The position of the decimal point. , Separator.
+ Stores the sign of the number. Acknowledgement: the function T<format> was implemented by Paulo Soares <psoares@consiste.pt> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 3224 of file string.c. Referenced by format_num(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 431 of file string.c. Referenced by execute_LeftValueSarray(). |
|
|
|
|
|
|
|
|
|
Initial value: match_match(p, pL, s, sL, pLastResult->ParameterArray, pLastResult->pcbParameterArray, pLastResult->pszBuffer, pLastResult->cArraySize, pLastResult->cbBufferSize, !(OPTION("compare")&1), pLastResult->pThisMatchSets, &(pLastResult->iMatches)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 4078 of file string.c. Referenced by __pprint(), _ex_pprint(), _GetParam(), _ScriptName(), brushupinline(), build_Build_r(), build_SaveCCode(), c_flatc(), cgi_ReadHeader(), cgi_ShiftBuffer(), close_directory_list(), comm_List(), comm_WeAreAt(), Decode(), DeleteFromPath(), Encode(), ex_CleanNamePath(), GetSourceLineNumber(), HandleHttpHit(), httpd(), main(), modu_LoadModule(), MyExecBefore(), pow10(), sort_dirs(), and uudecode(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 1989 of file string.c. Referenced by match_index(). |
|
|
|
|
|
|
|
|
|
|
|
CHR =section string =display CHR() =title CHR(code) Return a one character string containing a character of ASCII code T |
|
|
|
|
|
|
|
OCT =section string =title OCT(n) =display OCT() Take the argument as a long value and convert it to a string that represents the value in octal form. |
|
|
|
HEX =section string =display HEX() =title HEX(n) Take the argument as a long value and convert it to a string that represents the value in hexadecimal form. The hexadecimal form will contain upper case alpha character if there is any alpha character in the hexadecimal representation of the number. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 103 of file string.c. Referenced by build_StringIndex(), and reader_RelateFile(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 429 of file string.c. Referenced by comm_GetCommand(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Initial value: { 1e-8, 1e-16, 1e-24, 1e-32, 1e-40, 1e-48, 1e-56, 1e-64, 1e-72, 1e-80, 1e-88, 1e-96, 1e-104, 1e-112, 1e-120, 1e-128, 1e-136, 1e-144, 1e-152, 1e-160, 1e-168, 1e-176, 1e-184, 1e-192, 1e-200, 1e-208, 1e-216, 1e-224, 1e-232, 1e-240, 1e-248, 1e-256, 1e-264, 1e-272, 1e-280, 1e-288, 1e-296, 1e-304 } Definition at line 46 of file string.c. Referenced by bestfta_p(). |
|
Initial value: { 1e+8, 1e+16, 1e+24, 1e+32, 1e+40, 1e+48, 1e+56, 1e+64, 1e+72, 1e+80, 1e+88, 1e+96, 1e+104, 1e+112, 1e+120, 1e+128, 1e+136, 1e+144, 1e+152, 1e+160, 1e+168, 1e+176, 1e+184, 1e+192, 1e+200, 1e+208, 1e+216, 1e+224, 1e+232, 1e+240, 1e+248, 1e+256, 1e+264, 1e+272, 1e+280, 1e+288, 1e+296, 1e+304 } Definition at line 37 of file string.c. Referenced by bestfta_p(). |
|
|
|
UNPACK =section string =display UNPACK =title UNPACK string BY format TO v1,v2,...,vn Unpack the binary string T<string> using the format string into the variables. The format string should have the same format as the format string the in the function R<PACK>. |
|
|
|
|
|
|
|
PACK =section string =display PACK() =title pack("format",v1,v2,...,vn) Pack list of arguments into a binary string. The format strings can contain the packing control literals. Each of these characters optionally take the next argument and convert to the specific binary string format. The result is the concatenated sum of these strings. Some control characters do not take argument, but result a constant string by their own. =itemize =item T<SZ> the argument is stored as zero terminated string. If the argument already contains zchar that is taken as termnator and the rest of the string is ignored. =item T<S1> the argument is stored as a string. One byte length and maximum 255 byte strings. If the argument longer than 255 bytes only the first 255 bytes are used, and the rest is ignored. =item T<S2> same as T<S1> but with two bytes for the length. =item T<S3> same as T<S1> but with three bytes for the length. =item T<S4> same as T<S1> but with four bytes for the length. =item T<S5..8> the same as T<S1> but with 5..8 bytes for the length. =item T<Zn> one or more zero characters, does not take argument. T<n> can be 1,2,3 ... positive numbers =item T<In> integer number stored on n bytes. Low order byte first. If the number does not fit into n bytes the higher bytes are chopped. If the number is negative the high overflow bytes are filled with FF. =item T<C> character (same as T<I1>) =item T<Un> same as T<In> but for unsigned numbers. =item T<An> store the argument as string on n bytes. If the argument is longer than n bytes only the first n bytes are stored. If the argument is shorter than n bytes the higher bytes are filled with space. =item T<R> a real number. =noitemize See also R<UNPACK> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SPLIT =section string =title SPLIT string BY string TO var_1,var_2,var_3,...,var_n Takes the string and splits into the variables using the second string as delimiter. |
|
|
|
STRREVERTE =section string =display STRREVERSE() =title STRREVERSE(string) Return the reversed string (aka. all the characters in the string in reverse order). |
|
|
|
STRING =section string =title STRING(n,code) =display STRING()
Create a string of length T<n> containing characters T |
|
|
|
SPACE =section string =display SPACE() =title SPACE(n) Return a string of length T<n> containing spaces. |
|
|
|
|
|
RIGHT =section string =display RIGHT() =title RIGHT(string,len) Creates the right of a string. The first argument is the string. The second argument is the number of characters that should be put into the result. If this value is larger than the number of characters in the string then all the string is returned. See also R<MID>, R<LEFT>. =details T<RIGHT(x,y)> cuts out a substring of T<y> characters from the right of the string T<x>. If the first argument is not defined the result is also T<undef>. Otherwise the first argument is converted to string and the second argument is converted to integer value. If the second argument is not defined or has negative value it is treated as numeric zero and as such the result string will be empty string. For compatibility reasons you can append a dollar (T<$>) sign to the end of the function identifier. |
|
|
|
|
|
LEFT =section string =display LEFT() =title LEFT(string,len) Creates the left of a string. The first argument is the string. The second argument is the number of characters that should be put into the result. If this value is larger than the number of characters in the string then all the string is returned. See also R<MID>, R<RIGHT> =details T<left(x,y)> cuts out a substring of T<y> characters from the left of the string T<x>. If the first argument is not defined the result is also T<undef>. Otherwise the first argument is converted to string and the second ar-gument is converted to integer value. If the second argument is not defined or has negative value it is treated as numeric zero and as such the result string will be empty string. For compatibility reasons you can append a dollar (T<$>) sign to the end of the function identifier. Example =verbatim a$ = _ "superqualifragilisticexpialidosys" print "*",left(a$,undef),"*" print "*",left(a$,7),"*" print "*",left(a$,-6),"*" print "*",left(a$,0),"*" print left(undef,"66") =noverbatim will print =verbatim superqu* undef =noverbatim |
|
|
|
|
|
|
|
MID =section string =display MID() =title MID(string,start [ ,len ]) Return a subpart of the string. The first argument is the string, the second argument is the start position. The third argument is the length of the sub-part in terms of characters. If this argument is missing then the subpart lasts to the last character of the argument T<string>. See also R<LEFT>, R<RIGHT>. =details T<mid(x,y,[z])> cuts out a sub-string from the string T<x>. If the first argument of the function is undefined the result is T<undef>. Otherwise the first argument is converted to string and the second and third arguments are converted to numeric value. The third argument is optional. The second argument specifies the start position of the resulting substring in the original string x; and the last argument specifies the number of characters to take from the original string T<x>. If the third argument is missing the substring lasts from the start position to the end of the string. If the second argu-ment is not defined the start of the substring is at the start of the original string. In other words if the second argument is missing it is the same as value 1. If the second argument is zero or negative it will specify the start position counting the characters from the end of the string. If the staring position T<y> points beyond the end of the string the result is empty string. If the length of the substring is larger than the number of characters between the starting position and end of the original string then the result will be the substring between the start position and the end of the original string. If the length of the substring is negative the characters before the starting position are taken. No more than the available characters can be taken in this case either. In other words if the length is negative and is larger in absolute value than the starting position the resulting sub-string is the character between the position specified by the second argument and the start of the string. Note that the order of the characters is never changed even if some position or length parameters are negative. For compatibility reasons you can append a dollar (T<$>) sign to the end of the function identifier. Example: =verbatim a$ = "superqualifragilisticexpialidosys" print mid(a$,undef) print mid(a$,1,5) print mid(a$,undef,6) print mid(a$,6,5) print mid(a$,"-3") print "*",mid(a$,0),"*" print mid(undef,"66") print mid(a$,6,-3) print mid(a$,6,3) print mid(a$,-4,-3) print mid(a$,-4,3) =noverbatim will print =verbatim superqualifragilisticexpialidosys super superq quali sys undef erq qua ido osy =noverbatim |
|
|
|
|
|
|
|
|
|
REPLACE =section string =title REPLACE(base_string,search_string,replace_string [,number_of_replaces] [,position]) =display REPLACE() This function replaces one or more occurrences of a sub-string in a string. T<REPLACE(a,b,c)> searches the string T seeking for occurrences of sub-string T and replaces each of them with the string T<c>. The fourth and fifth arguments are optional. The fourth argument specifies the number of replaces to be performed. If this is missing or is T<undef> then all occurrences of string T will be replaced. The fifth argument may specify the start position of the operation. For example the function call =verbatim REPLACE("alabama mama", "a","x",3,5) =noverbatim will replace only three occurrences of string T<"a"> starting at position 5. The result is T<"alabxmx mxma">. |
|
|
|
|
|
|
|
INSTRREV =section string =display INSTRREV() =title INSTRREV(base_string,search_string [ ,position ] ) This function can be used to search a sub-string in a string in reverse order starting from the end of the string. The first argument is the string we are searching in. The second argument is the string that we actually want to find in the first argument. The third optional argument is the position where the search is to be started. If this argument is missing the search starts with the last character position of the string. The function returns the position where the sub-string can be found in the first string. If the searched sub-string is not found in the string then the return value is undef. See R<INSTR> |
|
|
|
|
|
|
|
INSTR =section string =title INSTR(base_string,search_string [ ,position ] ) =display INSTR() This function can be used to search a sub-string in a string. The first argument is the string we are searching in. The second argument is the string that we actually want to find in the first argument. The third optional argument is the position where the search is to be started. If this argu-ment is missing the search starts with the first character position of the string. The function returns the position where the sub-string can be found in the first string. If the searched sub-string is not found in the string then the return value is undef. See R<INSTRREV> |
|
|
|
TRIM =section string =title TRIM() =display TRIM() Remove the space from both ends of the string. |
|
|
|
LTRIM =section string =title LTRIM() =display LTRIM() Remove the space from the left of the string. |
|
|
|
LCASE =title LCASE() =display LCASE() =section string Lowercase a string. |
|
|
|
UCASE =title UCASE() =display UCASE() =section string Uppercase a string. |
|
|
|
LEN =section string =display LEN() =title LEN() This function interprets its argument as a string and returns the length of the string. In ScriptBasic strings can hold any value thus the length of the string is the number of characters contained in the string containing any binary characters, even binary zero. If the argument is not a string it is converted to string automatically and the length of the converted string is returned. The only exception is T<undef> for which the result is also T<undef>. |
|
|
|
|
|
CONCATENATE =section string =display & =title Concatenate operator & This operator concatenates two strings. The resulting string will contain the characters of the string standing on the left side of the operator followed by the characters of the string standing on the right hand side of the operator. The ScriptBasic interpreter automatically allocates the resulting string. |
|
MKL =section planned =display MKL() This is a planned function. Converts the long-integer number "n" into an 4-byte string so it can later be retrieved from a random-access file as a numeric value. |
|
MKS =section planned =display MKS() This is a planned function. Converts the single-precision number "n" into an 4-byte string so it can later be retrieved from a random-access file as a numeric value. |
|
MKI =section planned =display MKI() This is a planned function to convert the argument integer number to an 2 byte string. Converts the integer number "n" into an 2-byte string so it can later be retrieved from a random-access file as a numeric value. |
|
MKD =section planned =display MKD() This is a planned function to convert the argument real number to an 8 byte string. Converts the double-precision number "n" into an 8-byte string so it can later be retrieved from a random-access file as a numeric value. |
|
CVS =section planned =display CVS() This is a planned function to convert the argument string into an integer. Converts a passed in string "str$" to a single precision number. The passed string must be four (4) bytes or longer. If less than 4 bytes long, an error is generated. If more than 4 bytes long, only the first 4 bytes are used. |
|
CVL =section planned =display CVL() This is a planned function to convert the argument string into an integer. Converts a passed in string "str$" to a long-integer number. The passed string must be four (4) bytes or longer. If less than 4 bytes long, an error is generated. If more than 4 bytes long, only the first 4 bytes are used. |
|
CVI =section planned =display CVI() This is a planned function to convert the argument string into an integer. Converts a passed in string "str$" to an integer number. The passed string must be two (2) bytes or longer. If less than 2 bytes long, an error is generated. If more than 2 bytes long, only the first 2 bytes are used. |
|
CVD =section planned =display CVD() This is a planned function to convert the argument string into a real number. Converts a passed in string "str$" to a double-precision number. The passed string must be eight (8) bytes or longer. If less than 8 bytes long, an error is generated. If more than 8 bytes long, only the first 8 bytes are used. |
|
BIN =section planned =display BIN() This is a planned function to convert the argument number to binary format. (aka. format as a binary number containing only 0 and 1 characters and return this string) |
|
|
|
|
|
|
|
|
|
|
|
STR =section string =title STR(n) =display STR() Converts a number to string. This function is rarely needed, because conversion is done automatically. =details Converts a number to string. This function is rarely needed, because conversion is done automatically. However you may need =verbatim STRING(13,STR(a)) =noverbatim to be sure that the value T is interpreted as string value. |
|
|
|
|
|
|
|
OPTIONF =section misc =display OPTION() =title OPTION("symbol") Retrieve the actual value of an option symbol as an integer or T<undef> if the option was not set. Unlike in the command R<OPTION> the argument of this function should be double quoted. |
|
|
|
|
|
|
|
SETWILD =title SET WILD "c" TO "abcdefgh..." =display SET [NO] WILD =section string pattern Set a wild character to match certain characters when using the R<LIKE> operator. The wild character T<"c"> can be one of the following characters =verbatim # $ @ ? & % ! + / | < > =noverbatim The string after the keyword T<TO> should contain all the characters that the wild card character should match. To have the character to match only itself to be a normal character say =verbatim SET NO WILD "c" =noverbatim See also R<SETJOKER>, R<LIKE> (details), R<JOKER> |
|
|
|
SETJOKER =title SET JOKER "c" TO "abcdefgh..." =display SET [NO] JOKER =section string pattern Set a joker character to match certain characters when using the R<LIKE> operator. The joker character T<"c"> can be one of the following characters =verbatim # $ @ ? & % ! + / | < > =noverbatim The string after the keyword T<TO> should contain all the characters that the joker character should match. To have the character to match only itself to be a normal character say =verbatim SET NO JOKER "c" =noverbatim See also R<SETWILD>, R<LIKE> (details), R<JOKER> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 3221 of file string.c. Referenced by check_size(), if(), printChar(), printDouble(), printInt(), and while(). |
|
|
|
|
|
|
|
Definition at line 1991 of file string.c. Referenced by basext_GetArgsF(), build_CountSymbolBytes(), collect_dirs_r(), and reader_ReadLines_r(). |
|
|
|
|
|
Definition at line 1988 of file string.c. Referenced by allocate_MatchSets(), collect_dirs_r(), and initialize_like(). |
|
|
|
|
|
CONF =section string =display CONF() =title CONF("conf.key") This function can be used to retrieve ScriptBasic configuration parameters. This is rarely needed by general programmers. This is needed only for scripts that maintain the ScriptBasic setup, for example install a new module copying the files to the appropriate location. The argument T<"conf.key"> should be the configuration key string. If this key is not on the top level then the levels should be separated using the dot chatacter, like T<conf("preproc.internal.dbg")> to get the debugger DLL or SO file. The return value of the function is the integer, real or string value of the configuration value. If the key is not defined or if the system manager set the key to be hidden (see later) then the function will raise an error T<(0): error &H8:The argument passed to a module function is out of the accepted range.> Some of the configuration values are not meant to be readable for the BASIC programs for security reasons. A typical example is the database connection password. The system manager can insert extra "dummy" configuration keys that will prevent the BASIC program to get the actual value of the configuration key. The extra configuration key has to have the same name as the key to be hidden with a T<$> sign prepended to it. For example the MySQL connection named T<test> has the connection password under the key T<mysql.connections.test.password>. If the key in the compiled configuration file T<mysql.connections.test.$password> exists then the BASIC function T<conf()> will result error. The value of this extra key is not taken into account. The system manager can configure whole configuration branches to be hidden from the BASIC programs. For example the configuration key T<mysql.connections.$test> defined with any value will prevent access of BASIC programs to any argument of the connection named T<test>. Similarly the key T<mysql.$connections> will prevent access to any configuration value of any MySQL connections if defined and finally the key T<$mysql> will stop BASIC programs to discover any MySQL configuration information if defined. The current implementation does not examine the actual value of the extra security key. However later implementations may alter the behaviour of this function based on the value of the key. To remain compatible with later versions it is recommended that the extra security key is configured to have the value T<1>. |
|
|
|
|
|
|
|
OPTION =section misc =title OPTION symbol value Set the integer value of an option. The option can be any string without the double quote. Option names are case insensitive in ScriptBasic. This command has no other effect than storing the integer value in the option symbol table. The commands or extenal modules may access the values and may change their behavior accoring to the actual values associated with option symbols. You can retrieve the actual value of an option symbol using the function R<OPTIONF> |
|
|
|
|
|
|
|
Definition at line 3219 of file string.c. Referenced by check_size(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 3220 of file string.c. Referenced by hook_Init(), printChar(), return(), scriba_NewSbArgs(), serconv(), and serconvXML(). |
|
Definition at line 2399 of file string.c. Referenced by unserconv(). |
|
|
|
Definition at line 4073 of file string.c. Referenced by cft_GetString(), if(), scriba_CallArgEx(), scriba_DestroySbArgs(), and scriba_NewSbArgs(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 614 of file string.c. Referenced by alloc_Wrapper(), besFUNCTION(), c_symcmp(), cgi_ReadHeader(), cgi_ReadHttpRequest(), delete_Wrapper(), if(), and lex_RemoveComments(). |
|
|
|
|
|
|
|
SPLITA =section string =title SPLITA string BY string TO array Split a string into an array using the second string as delimiter. If the string has zero length the array becomes undefined. When the delimiter is zero length string each array element will contain a single character of the string. See also R<SPLIT> |
|
|
|
SPLITAQ =section string =title SPLITAQ string BY string QUOTE string TO array Split a string into an array using the second string as delimiter. The delimited fields may optionally be quoted with the third string. If the string to be split has zero length the array becomes undefined. When the delimiter is a zero length string each array element will contain a single character of the string. Leading and trailing delimiters are accepted and return an empty element in the array. For example :- =verbatim SPLITAQ ",'A,B',C," BY "," QUOTE "'" TO Result =noverbatim will generate =verbatim Result[0] = "" Result[1] = "A,B" Result[2] = "C" Result[3] = "" =noverbatim Note that this kind of handling of trailing and leading empty elements is different from the handling of the same by the command R<SPLIT> and R<SPLITA> which do ignore those empty elements. This command is useful to handle lines exported as CSV from Excel or similar application. The QUOTE string is really a string and need not be a single character. If there is an unmatched quote string in the string to be split then the rest of the string until its end is considered quoted. If there is an unmatched See also R<SPLITA> This command was suggested and implemented by Andrew Kingwell (T<Andrew.Kingwell@idstelecom.co.uk>) |