Difference between revisions of "DBEDIT()"

From Recital Documentation Wiki
Jump to: navigation, search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Screen Forms
 
 
 
 
==Purpose==
 
==Purpose==
 
Function to display expressions and records from one or more workareas in a browse style worksurface
 
Function to display expressions and records from one or more workareas in a browse style worksurface
Line 23: Line 19:
 
====Parameters====
 
====Parameters====
  
{| class="wikitable"
+
{| class="wikitable" width="100%"
 
!Parameters||Description
 
!Parameters||Description
 
|-
 
|-
Line 40: Line 36:
 
|<array2>||The name of an array that contains PICTURE strings to format each column.
 
|<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.
+
|<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.  The color of the headings is controlled by the [[SET COLOR OF|SET COLOR OF TITLES]] command.
 
|-
 
|-
 
|<expC2>||A character to be used for separating the headings from the field display.
 
|<expC2>||A character to be used for separating the headings from the field display.
Line 95: Line 91:
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
use demo
+
open database southwind
 +
use shippers
 
declare flds[fcount()]
 
declare flds[fcount()]
 
declare col_header[fcount()]
 
declare col_header[fcount()]
 
declare col_footer[fcount()]
 
declare col_footer[fcount()]
declare pic[fcount  
+
declare pic[fcount()]
  
 
for i=1 to fcount()
 
for i=1 to fcount()
// Load field names
+
    // Load field names
flds[i] = field(i)
+
    flds[i] = field(i)
// Load headings
+
    // Load headings
col_header[i] = field(i)
+
    col_header[i] = field(i)
// Load footers
+
    // Load footers
col_footer[i] = field(i)
+
    col_footer[i] = field(i)
 
next
 
next
  
 
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),col_footers)
+
chr(205),chr(186),chr(205),col_footer)
 
</code>
 
</code>
  
  
 
==Products==
 
==Products==
Recital Terminal Developer
+
Recital  
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Latest revision as of 08:54, 13 March 2015

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. The color of the headings is controlled by the SET COLOR OF TITLES command.
<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