/* * $Id$ */ /* * SixAPI Project source code: * * Copyright 2010 Andi Jahja * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). */ #ifndef __SIXAPI__ #define __SIXAPI__ #command SET INDEX TO [ <(index1)> [, <(indexn)>]] [] ; ; => if !<.add.> ; sx_CloseIndexes() ; end ; ; [; sx_IndexOpen( <(index1)> )] ; [; sx_IndexOpen( <(indexn)> )] #command SET RELATION TO => sx_ClearRelation() #command SET RELATION ; [] ; [TO INTO <(alias1)> [, [TO] INTO <(aliasn)>]] ; ; => if ( !<.add.> ) ; ; sx_ClearRelation() ; ; end ; ; ; sx_SetRelation( <(alias1)>, <"key1"> ) ; [; sx_SetRelation( <(aliasn)>, <"keyn"> )] #command APPEND [FROM ] ; [FOR ] ; [VIA ] ; ; => sx_AppendFrom( ; , ; ,<(for)> ; ) #command REPLACE [ WITH [, WITH ] ] ; [FOR ] ; [WHILE ] ; [AREA ] ; [NEXT ] ; [RECORD ] ; [] ; [ALL] ; ; => sx_DBEval( ; {|| sx_Replace(<(f1)>,) [, sx_Replace(<(fn)>,)]}, ; <{for}>, <{while}>, , , <.rest.>,<(alias)> ; ) #command DELETE ; [FOR ] ; [WHILE ] ; [AREA ] ; [NEXT ] ; [RECORD ] ; [] ; [ALL] ; ; => sx_DBEval( ; {|| sx_Delete()}, ; <{for}>, <{while}>, , , <.rest.>,<(alias)> ; ) #command RECALL ; [FOR ] ; [WHILE ] ; [AREA ] ; [NEXT ] ; [RECORD ] ; [] ; [ALL] ; ; => sx_DBEval( ; {|| sx_Recall()}, ; <{for}>, <{while}>, , , <.rest.>,<(alias)> ; ) #command COUNT [TO ] ; [FOR ] ; [WHILE ] ; [AREA ] ; [NEXT ] ; [RECORD ] ; [] ; [ALL] ; ; => := 0 ; ; sx_DBEval( ; {|| := + 1}, ; <{for}>, <{while}>, , , <.rest.>,<(alias)> ; ) #command SUM [ [, ] TO [, ] ] ; [FOR ] ; [WHILE ] ; [AREA ] ; [NEXT ] ; [RECORD ] ; [] ; [ALL] ; ; => := [ := ] 0 ; ; sx_DBEval( ; {|| := + sx_GetValue(<(x1)>) [, := + sx_GetValue(<(xn)>)]},; <{for}>, <{while}>, , , <.rest.>, <(alias)> ; ) #xtranslate AVERAGE [ [, ] TO [, ] ] ; [FOR ] ; [WHILE ] ; [AREA ] ; [NEXT ] ; [RECORD ] ; [] ; [ALL] ; ; => M->__Avg := := [ := ] 0 ; ; sx_DBEval( ; {|| M->__Avg := M->__Avg + 1, ; := + sx_GetValue(<(x1)>) [, := + sx_GetValue(<(xn)>)] },; <{for}>, <{while}>, , , <.rest.>, <(alias)>) ; ; := / M->__Avg [; := / M->__Avg ] #command TOTAL [TO <(file)>] [ON ] ; [FIELDS ] ; [FOR ] ; [WHILE ] ; [NEXT ] ; [RECORD ] ; [] ; [ALL] ; ; => __sx_dbTotal( ; <(file)>, <{key}>, { <(fields)> }, ; <{for}>, <{while}>, , , <.rest.> ; ) #command COPY [STRUCTURE] [TO <(file)>] [FIELDS ] ; => sx_CopyStructure( <(file)>, { <(fields)> } ) #command COPY [STRUCTURE] EXTENDED [TO <(file)>] ; => sx_CopyStructureExtended (<(file)>) #command COPY [TO <(file)>] [DELIMITED [WITH <*delim*>]] ; [FIELDS ] ; [FOR ] ; [WHILE ] ; [AREA ] ; [NEXT ] ; [RECORD ] ; [] ; [ALL] ; ; => __sx_dbDelim( ; <(file)>, , { <(fields)> }, ; <{for}>, <{while}>, , , <.rest.>, ; <(alias)> ; ) #command COPY [TO <(file)>] [SDF] ; [FIELDS ] ; [FOR ] ; [WHILE ] ; [AREA ] ; [NEXT ] ; [RECORD ] ; [] ; [ALL] ; ; => __sx_dbDelim( ; <(file)>, "SDF", { <(fields)> }, ; <{for}>, <{while}>, , , <.rest.>, ; <(alias)> ; ) #command COPY [TO <(file)>] ; [FIELDS ] ; [FOR ] ; [WHILE ] ; [AREA ] ; [NEXT ] ; [RECORD ] ; [] ; [VIA ] ; [ALL] ; ; => __sx_dbCopy( ; <(file)>, { <(fields)> }, ; <{for}>, <{while}>, , , <.rest.>, , ; <(alias)> ; ) #command CREATE <(file1)> ; [FROM <(file2)>] ; [ <(rdd)>] ; [ALIAS ] ; => sx_CreateFrom( <(file1)>, <(a)>, <(file2)>, <(rdd)> ) #command COPYTEXT TO <(cTextFile)> [DELIMITED WITH ] [ALIAS ] => ; ; sx_CopyFileText( <(cTextFile)>, , <(alias)> ) #command SORT [TO <(file)>] [ON ] ; [FOR ] ; [WHILE ] ; [AREA ] ; [NEXT ] ; [RECORD ] ; [] ; [] ; [] ; [ALL] ; ; => __sx_dbSort( ; <(file)>, { <(fields)> }, ; <{for}>, <{while}>, , , <.rest.>,<(rdd)>, ; <.descend.>, <(alias)> ; ) #command USE [ALIAS <(cAlias)>] [ <(cRDD)>] [VAR ] [COMMITLEVEL ] [<(cOpenMode)>] =>; [ :=]; sx_Use(; ,; [<(cAlias)>],; [<(cOpenMode)>],; [<(cRDD)>],; []; ) #command CREATE [VAR ] [ ] [ALIAS ] [COMMITLEVEL ] =>; [ :=]; sx_DbCreate(; ,; ,; [<(cDriver)>],; [<(cAlias)>],; []) #command SET DATE =>; sx_SetDateFormat(<(cCountry)>) #command REPLACE [ALIAS ] WITH ; [, [ALIAS ] WITH ] => ; ; sx_Replace( <(cField)>, , <(alias)> ) ; [; sx_Replace( <(cFieldN)>, , <(aliasN)> ) ] #command INDEX ON TO [ FOR ] [] [] =>; sx_Index(; <(cIndexFile)>,; <(cExpression)>,; [<(mod)>],; [<.order.>],; [<(cCondition)>]) #command SET COMMITLEVEL [TO] => Sx_CommitLevel() #command SET ERRORLEVEL [TO] => Sx_ErrorLevel() #command SET RDD [TO] <(rdd)> => Sx_RddsetDefault(<(rdd)>) #command SET TRIM => Sx_SetGetTrimmed(<(ON)>) #command SET SOFTSEEK => Sx_SetSoftSeek(<(ON)>) #command SET CENTURY => Sx_SetCentury(<(ON)>) #command SET EXACT => Sx_SetExact(<(ON)>) #command SET DELETED => Sx_SetDeleted(<(ON)>) #command SET EPOCH [TO] => Sx_SetEpoch() #command SET LOCK TIMEOUT => Sx_SetLockTimeOut() #command SET [FILE] HANDLE [TO] => Sx_SetHandles() #command RECALL => sx_Recall() #command DELETE => sx_Delete() #command SKIP [] => sx_Skip([]) #command SELECT => sx_Select(sx_WorkArea( <(selectarea)> )) #xtranslate Seek() => sx_Seek() #xtranslate Found() => sx_Found() #xtranslate dbSkip() => sx_Skip() #xtranslate Bof() => sx_Bof() #xtranslate Eof() => sx_Eof() #xtranslate Deleted() => sx_Deleted() #xtranslate RecCount() => sx_RecCount() #xtranslate SetSoftSeek([]) => sx_SetSoftSeek([]) #xtranslate RecNo() => sx_RecNo() #xtranslate SetDateFormat( ) => ; sx_SetDateFormat(<(cDateFormat)>) #xtranslate Alias() => sx_Alias() #xtranslate FCount() => sx_FieldCount() #xtranslate FieldPut(,) => sx_Replace(<(x)>,) #xtranslate FieldGet() => sx_GetValue(<(x)>) #xtranslate FieldGetStr() => sx_GetValueStr(<(x)>) #xtranslate FieldGetDtos() => sx_GetValueDtos(<(x)>) #xtranslate FieldGetJulian() => sx_GetDateJulian(<(x)>) #xtranslate FieldPos() => sx_FieldNum(<(x)>) #xtranslate FieldName() => sx_FieldName() #xtranslate FieldType() => sx_FieldType(<(x)>) #xtranslate FieldWidth() => sx_FieldWidth(<(x)>) #xtranslate FieldOffset() => sx_FieldOffset(<(x)>) #xtranslate FieldDecimals() => sx_FieldDecimals(<(x)>) #xcommand APPEND BLANK [TO <(cArea)>] [] => sx_Append([<(cArea)>],) #xcommand GO [TO] [ALIAS ] => sx_Go(,<(alias)>) #xcommand GOTO [ALIAS ] => sx_Go(,<(alias)>) #xcommand GO TOP [ALIAS ] => sx_GoTop(<(alias)>) #xcommand GO TO TOP [ALIAS ] => sx_GoTop(<(alias)>) #xcommand GOTOP [ALIAS ] => sx_GoTop(<(alias)>) #xcommand GO BOTTOM [ALIAS ] => sx_GoBottom(<(alias)>) #xcommand GO TO BOTTOM [ALIAS ] => sx_GoBottom(<(alias)>) #xcommand GOBOTTOM [ALIAS ] => sx_GoBottom(<(alias)>) #xcommand ZAP [] => sx_Zap(<(alias)>) #xcommand COMMIT [ALIAS ] => sx_Commit(<(alias)>) #xcommand CLOSE ALL => sx_CloseAll() #xcommand CLOSE [DATABASE] [ALIAS ] => sx_Close(<(alias)>) #xcommand CLOSE DATA => sx_CloseAll() #xcommand CLOSE INDEXES => sx_CloseIndexes() #xcommand PACK [] => sx_Pack(<(alias)>) #xcommand BROWSE => sx_Browse() #xcommand PAUSE => inkey(0) #define INDEX_STANDARD 1 #define INDEX_STANDARD_UNIQUE 2 #define INDEX_CONDITIONAL 3 #define INDEX_CONDITIONAL_UNIQUE 4 #define COMMA_DELIM 21 #define SDF_FILE 22 #define TAB_DELIM 23 #define SPACE_DELIM 24 #endif /* __SIXAPI__ */