Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/Common/FoxProCmd.xh
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,32 @@
#command CREATE DATABASE <(db)> => XSharp.RDD.Dbc.Create( <(db)>)
#command DELETE DATABASE <(db)> [<del:DELETETABLES>] [<rec:RECYCLE>] => XSharp.RDD.Dbc.Delete( <(db)>, <.del.>, <.rec.>)

// CLOSE DATABASES [ALL] and CLOSE TABLES [ALL]
// Implemented in XSharp.VFP\Database\DatabaseCommands.prg

#command CLOSE DATABASES [<all:ALL>] => __VFPCloseDatabases( <.all.> )
#command CLOSE TABLES [<all:ALL>] => __VFPCloseTables( <.all.> )

// ADD TABLE TableName [NAME LongTableName]
// Links an existing free .DBF to the currently active database.
// Implemented in XSharp.VFP\Database\DatabaseCommands.prg
// The NAME variant is defined last (tried first) to correctly consume the NAME clause.
#command ADD TABLE <(file)> => __VFPAddTable( <(file)>, "")
#command ADD TABLE <(file)> NAME <(name)> => __VFPAddTable( <(file)>, <(name)>)

// REMOVE TABLE TableName [DELETE] [RECYCLE]
// Unlinks a table from the active database; optionally deletes the .DBF file.
// Implemented in XSharp.VFP\Database\DatabaseCommands.prg
// Precedence: most-specific forms defined last = tried first.
#command REMOVE TABLE <(name)> => __VFPRemoveTable( <(name)>, .F., .F.)
#command REMOVE TABLE <(name)> DELETE => __VFPRemoveTable( <(name)>, .T., .F.)
#command REMOVE TABLE <(name)> RECYCLE => __VFPRemoveTable( <(name)>, .F., .T.)

// RENAME TABLE OldName TO NewName
// Changes the logical name in the DBC; does not rename the physical .DBF.
// Implemented in XSharp.VFP\Database\DatabaseCommands.prg
#command RENAME TABLE <(old)> TO <(new)> => __VFPRenameTable( <(old)>, <(new)>)

// connection commands
#command CREATE CONNECTION <(conn)> ;
[DATASOURCE <(Dsn)>] ;
Expand Down
44 changes: 37 additions & 7 deletions src/Common/dbcmd.xh
Original file line number Diff line number Diff line change
Expand Up @@ -432,29 +432,31 @@
<{lfor}>, <{lwhile}>, <nnext>, <rec>, <.rest.>, <.noopt.>;
)

#command SUM <x1> [, <xn>] TO <v1> [, <vn>] ;
#command SUM <x1> [, <xn>] ;
[FOR <lfor>] ;
[WHILE <lwhile>] ;
[NEXT <nnext>] ;
[RECORD <rec>] ;
[<rest:REST>] ;
[<REST:REST>] ;
[<noopt: NOOPTIMIZE>] ;
[ALL] ;
[all] ;
TO <v1> [, <vN>] ;
;
=> <v1> := [ <vn> := ] 0 ;
=> <v1> := [ <vN> := ] 0 ;
; DbEval( ;
{|| <v1> += <x1> [, <vn> += <xn> ]}, ;
{|| <v1> += <x1> [, <vN> += <xn> ]}, ;
<{lfor}>, <{lwhile}>, <nnext>, <rec>, <.rest.>, <.noopt.>;
)

#command AVERAGE [<x1> [, <xn>] TO <v1> [, <vn>]] ;
#command AVERAGE [<x1> [, <xn>] ;
[FOR <lfor>] ;
[WHILE <lwhile>] ;
[NEXT <nnext>] ;
[RECORD <rec>] ;
[<rest:REST>] ;
[<noopt: NOOPTIMIZE>] ;
[ALL] ;
[all] ;
TO <v1> [, <vN>]] ;
;
=> M->__Avg := <v1> := [ <vn> := ] 0 ;
;
Expand Down Expand Up @@ -487,6 +489,34 @@
#command SET MEMOBLOCKSIZE TO => RDDInfo(_SET_MEMOBLOCKSIZE, 512)
#command SET OPTIMIZE <x:ON,OFF,&> => RDDInfo(_SET_OPTIMIZE, <(x)>)

#command COPY MEMO <field> TO <(file)> <add:ADDITIVE> [AS <nCP>] ;
=> DbCopyMemo( <"field">, <(file)>, <ADD>[, <nCP>] )

// REPLACE ... [ADDITIVE] — without IN clause
#command REPLACE <(f1)> WITH <x1> [<add1:ADDITIVE>] ;
[, <(fn)> WITH <xn> [<addn:ADDITIVE>]] ;
[FOR <lfor>] [WHILE <lwhile>] [NEXT <nnext>] [RECORD <rec>] ;
[<REST:REST>] [<noopt:NOOPTIMIZE>] [all] ;
=> DbEval( ;
{|| DbAutoLock(), ;
__FieldSetAdd(<(f1)>, <x1>, <.add1.>) ;
[, __FieldSetAdd(<(fn)>, <xn>, <.addn.>)], ;
DbAutoUnLock() }, ;
<{lfor}>, <{lwhile}>, <nnext>, <rec>, <.rest.>, <.noopt.> ;
)

// REPLACE ... [ADDITIVE] IN workarea — defined LAST, tried FIRST
#command REPLACE <(f1)> WITH <x1> [<add1:ADDITIVE>] ;
[, <(fn)> WITH <xn> [<addn:ADDITIVE>]] ;
[FOR <lfor>] [WHILE <lwhile>] [NEXT <nnext>] [RECORD <rec>] ;
[<REST:REST>] IN <(wa)> [<noopt:NOOPTIMIZE>] [all] ;
=> __VfpReplaceIn( <(wa)>, ;
{|| DbAutoLock(), ;
__FieldSetAdd(<(f1)>, <x1>, <.add1.>) ;
[, __FieldSetAdd(<(fn)>, <xn>, <.addn.>)], ;
DbAutoUnLock() }, ;
<{lfor}>, <{lwhile}>, <nnext>, <rec>, <.rest.>, <.noopt.> ;
)

#endif // DBCMD_XH

Expand Down
Loading
Loading