Difference between revisions of "DEFINE TABLE"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 11: | Line 11: | ||
==Syntax== | ==Syntax== | ||
− | DEFINE TABLE <table name> FOR <.dbf filename> AS <expN> ROWS | + | DEFINE TABLE <table name> |
+ | |||
+ | FOR <.dbf filename> AS <expN> ROWS | ||
RELATING <field> BY <key expression> | RELATING <field> BY <key expression> |
Revision as of 10:40, 18 March 2009
Contents
DEFINE TABLE
Class
Screen Forms
Purpose
Define a table field in a format or program file for multiple record display
Syntax
DEFINE TABLEColor | Attribute Code |
---|---|
BLACK | N or blank |
BLUE | B |
GREEN | G |
CYAN | BG |
BLANK | X |
GREY | N+ |
RED | R |
MAGENTA | RB |
BROWN | GR |
YELLOW | GR+ |
WHITE | W |
PRETABLE <expC1>
POSTTABLE <expC2>
The optional PRETABLE and POSTTABLE keywords associate trigger procedures with the entry and exit of the table field. The READVAR() function is useful within trigger procedures as it returns a blank when the table is displayed, and the table name when the table is activated.. The procedure names may be specified with character expressions <expC> that return the names of valid trigger procedures.
SHADOW
The SHADOW keyword causes a shadow to display along the right and bottom edges of the box. A TITLE <expC> must be specified for the box to be displayed.
TITLE <expC3>
The TITLE option is used to specify field or column headings for the table. If the TITLE option is used, a box will be drawn around the fields and the headings. The TITLE character expression must contain column headings, separated by commas, for every field in the table.
Example
**** **** [Screen format file 'customer.fmt' created by Recital Version 8.0] **** define table acc; for accounts; as 7 rows; title 'Pd#,Ord#,Date,Price,Received,Paid,Payment,Balance'; posttable order_posttrig; relating account_no by customer->account_no set preform to orderspreform set postform to orderspostform set prerecord to orders_prerec @01,00 to 06,79 @02,01 say [Account code] @02,18 get customer->account_no @02,25 say [Start Date] @02,36 get customer->start_date @03,01 say [Customer's Name] @03,18 get customer->title @03,22 get customer->first_name @03,33 get customer->initial @03,36 get customer->last_name @04,01 say [Street] @04,18 get customer->street @05,01 say [City] @05,18 get customer->city @05,30 say [,] @05,31 get customer->state @05,34 get customer->zip @10,01 get acc!accounts->product_no @10,06 get acc!accounts->ord_no; picture [@S4X] @10,11 get acc!accounts->ord_date @10,22 get acc!accounts->ord_value @10,34 get acc!accounts->rec_date @10,45 get acc!accounts->paid_date @10,56 get acc!accounts->paid_value @10,68 get acc!accounts->balance @18,00 to 20,79 @19,01 say [Total:] @19,13 get m->m_orders; picture [99999999]; when .f. @19,22 get m->m_ord_val; picture [$$$$,$$9.99]; when .f. @19,56 get m->m_paid_val; picture [$$$$,$$9.99]; when .f. @19,68 get m->m_balance; picture [$$$$,$$9.99]; when .f. *********************************** // Open demo.dbf bridge. // This opens the four demo tables and sets up // indexes, relations and format files use demo ed **** [Screen format file 'customer.fmt' created by Recital Version 8.0] **** define table acc; for accounts; as 7 rows; title 'Pd#,Ord#,Date,Price,Received,Paid,Payment,Balance'; posttable order_posttrig; relating account_no by customer->account_no set preform to orderspreform set postform to orderspostform set prerecord to orders_prerec @01,00 to 06,79 @02,01 say [Account code] @02,18 get customer->account_no @02,25 say [Start Date] @02,36 get customer->start_date @03,01 say [Customer's Name] @03,18 get customer->title @03,22 get customer->first_name @03,33 get customer->initial @03,36 get customer->last_name @04,01 say [Street] @04,18 get customer->street @05,01 say [City] @05,18 get customer->city @05,30 say [,] @05,31 get customer->state @05,34 get customer->zip @10,01 get acc!accounts->product_no @10,06 get acc!accounts->ord_no; picture [@S4X] @10,11 get acc!accounts->ord_date @10,22 get acc!accounts->ord_value @10,34 get acc!accounts->rec_date @10,45 get acc!accounts->paid_date @10,56 get acc!accounts->paid_value @10,68 get acc!accounts->balance @18,00 to 20,79 @19,01 say [Total:] @19,13 get m->m_orders; picture [99999999]; when .f. @19,22 get m->m_ord_val; picture [$$$$,$$9.99]; when .f. @19,56 get m->m_paid_val; picture [$$$$,$$9.99]; when .f. @19,68 get m->m_balance; picture [$$$$,$$9.99]; when .f. *********************************** // Open demo.dbf bridge. // This opens the four demo tables and sets up // indexes, relations and format files use demo ed **** define table acc; for accounts; as 7 rows; title 'Pd#,Ord#,Date,Price,Received,Paid,Payment,Balance'; posttable order_posttrig; relating account_no by customer->account_no set preform to orderspreform set postform to orderspostform set prerecord to orders_prerec @01,00 to 06,79 @02,01 say [Account code] @02,18 get customer->account_no @02,25 say [Start Date] @02,36 get customer->start_date @03,01 say [Customer's Name] @03,18 get customer->title @03,22 get customer->first_name @03,33 get customer->initial @03,36 get customer->last_name @04,01 say [Street] @04,18 get customer->street @05,01 say [City] @05,18 get customer->city @05,30 say [,] @05,31 get customer->state @05,34 get customer->zip @10,01 get acc!accounts->product_no @10,06 get acc!accounts->ord_no; picture [@S4X] @10,11 get acc!accounts->ord_date @10,22 get acc!accounts->ord_value @10,34 get acc!accounts->rec_date @10,45 get acc!accounts->paid_date @10,56 get acc!accounts->paid_value @10,68 get acc!accounts->balance @18,00 to 20,79 @19,01 say [Total:] @19,13 get m->m_orders; picture [99999999]; when .f. @19,22 get m->m_ord_val; picture [$$$$,$$9.99]; when .f. @19,56 get m->m_paid_val; picture [$$$$,$$9.99]; when .f. @19,68 get m->m_balance; picture [$$$$,$$9.99]; when .f. *********************************** // Open demo.dbf bridge. // This opens the four demo tables and sets up // indexes, relations and format files use demo edit