Difference between revisions of "DBEDIT()"
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 91: | Line 91: | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | use | + | open database southwind |
+ | use shippers | ||
declare flds[fcount()] | declare flds[fcount()] | ||
declare col_header[fcount()] | declare col_header[fcount()] | ||
Line 108: | Line 109: | ||
clear | clear | ||
dbedit(4,1,23,71,flds,"db_udf",pic,col_header,; | dbedit(4,1,23,71,flds,"db_udf",pic,col_header,; | ||
− | chr(205),chr(186),chr(205), | + | chr(205),chr(186),chr(205),col_footer) |
</code> | </code> | ||
Revision as of 12:46, 19 August 2011
Contents
Purpose
Function to display expressions and records from one or more workareas in a browse style worksurface
Syntax
DBEDIT([<expN1>,<expN2>,<expN3>,< expN4>[,<array1> [, <expC1>[, <array2>[, <array3>[, <expC2> [, <expC3>[, <expC4>[, <array4>[, <expC5> [, <expC6>]]]]]]]]]]])
See Also
ABROWSE(), ACHOICE(), BROWSE, DEFINE TABLE, FUNCTION, MENU BROWSE
Description
The DBEDIT() function is used to display expressions and records from one or more workareas in a browse style worksurface.
Parameters
Parameters | Description |
---|---|
<expN1> | The starting row number of the window. |
<expN2> | The starting column number of the window. |
<expN3> | The ending row number of the window. |
<expN4> | The ending column number of the window. |
<array1> | The name of an array containing expressions of field names from active workareas. If the array is not specified all fields from the active workarea will be displayed. |
<expC1> | The name of a user-defined function (UDF) to execute when a key is pressed. This expression must not contain parameters or parentheses. |
<array2> | The name of an array that contains PICTURE strings to format each column. |
<array3> | The name of an array which contains headings for each column. Headings may be placed on more than one line if a semicolon is used as a line separator. |
<expC2> | A character to be used for separating the headings from the field display. |
<expC3> | A character to be used to separate the columns. |
<expC4> | A character to be used to separate the column footers from the field display. |
<array4> | The name of an array that contains column footers. Footers may be placed on more than one line if a semicolon is used as a line separator. |
<expC5> | A FILTER condition passed as a character string. |
<expC6> | A WHILE condition passed as a character string. |
UDF Parameters
DBEDIT() passes two parameters to the user-defined function (UDF) <expC2>. The first parameter passed is the status of the DBEDIT() function. The second parameter is a number representing the ordinal position of the field. The following table summarizes the possible values that can be passed.
Status | Description |
---|---|
0 | DBEDIT() is idle, no keystrokes are pending. |
1 | An attempt was made to move beyond the top of the file. |
2 | An attempt was made to move beyond the bottom of the file. |
3 | The table is empty. |
4 | A key other than a cursor navigation key was pressed. The LASTKEY() function can be used to check the key pressed. |
Return Values
The UDF must return one of the following values:
Value | Description |
---|---|
0 | Quit DBEDIT(). |
1 | Continue DBEDIT(). |
2 | Reread data, repaint the screen and continue. |
Example
open database southwind use shippers declare flds[fcount()] declare col_header[fcount()] declare col_footer[fcount()] declare pic[fcount()] for i=1 to fcount() // Load field names flds[i] = field(i) // Load headings col_header[i] = field(i) // Load footers col_footer[i] = field(i) next clear dbedit(4,1,23,71,flds,"db_udf",pic,col_header,; chr(205),chr(186),chr(205),col_footer)
Products
Recital