User Tools

Site Tools


string_declare_a_string_control_.htm
Navigation:  Language Reference > 8 - Controls > Control Declarations >====== STRING (declare a string control) ====== Previous pageReturn to chapter overviewNext page

STRING(text) ,AT( ) [,USE( )] [,LAYOUT( )] [,DISABLE] [,FONT( )] [,FULL] [,SCROLL] [,HIDE]

[,TRN] [,DROPID( )] [,COLOR( )] [,ANGLE( )] [,SKIP]
[, LEFT ] [, PAGENO                                               ] [,EXTEND( )]
RIGHT CNT( )[, RESET( ) / PAGE ] [, TALLY( ) ]
CENTER SUM( )[, RESET( ) / PAGE ] [, TALLY( ) ]
DECIMAL AVE( )[, RESET( ) / PAGE ] [, TALLY( ) ]
MIN( )[, RESET( ) / PAGE ] [, TALLY( ) ]
MAX( )[, RESET( ) / PAGE ] [, TALLY( ) ]

blk2blue.jpg

STRING Places the text on the WINDOW, TOOLBAR, or REPORT.
text A string constant containing the text to display, or a display picture token to format the variable specified in the USE attribute (PROP:Text).
AT Specifies the initial size and location of the control (PROP:AT). If omitted, default values are selected by the runtime library.
USE A field equate label to reference the control in executable code, or a variable whose contents are displayed in the format of the picture token declared instead of string text (PROP:USE).
LAYOUT Specifies the control's left-to-right or right-to-left display orientation (PROP:LAYOUT)
DISABLE Specifies the control appears dimmed when the WINDOW or APPLICATION opens (PROP:DISABLE).
FONT Specifies the font used to display the text (PROP:FONT).
FULL Specifies the control expands to occupy the entire size of the WINDOW or REPORT band for any missing AT attribute width or height parameter (PROP:FULL).
SCROLL Specifies the control scrolls with the window (PROP:SCROLL). Not valid in a REPORT.
HIDE Specifies the control does not appear when the WINDOW or APPLICATION is first opened (PROP:HIDE). UNHIDE must be used to display it.
TRN Specifies the text or USE variable characters transparently display over the background (PROP:TRN).
DROPID Specifies the control may serve as a drop target for drag-and-drop actions (PROP:DROPID). Not valid in a REPORT.
SKIP Specifies not to print the control if the content is blank, and to move all following controls in the band upward to “fill in” the blank (PROP:SKIP). Valid only in a REPORT.
LEFT Specifies that the text is left justified within the area specified by the AT attribute (PROP:LEFT).
RIGHT Specifies that the text is right justified within the area specified by the AT attribute (PROP:RIGHT).
CENTER Specifies that the text is centered within the area specified by the AT attribute (PROP:CENTER).
DECIMAL Specifies that the text is aligned on the decimal point within the area specified by the AT attribute (PROP:DECIMAL).
COLOR Specifies a background color for the control (PROP:COLOR).
ANGLE Specifies displaying or prinitng the control at a specified angle measured counter-clockwise from the horizontal or the report's orientation (PROP:ANGLE).
PAGENO Specifies the current page number is printed in the format of the picture token declared instead of string text (PROP:PAGENO). Valid only in a REPORT.
CNT Specifies the number of details printed is printed in the format of the picture token declared instead of string text (PROP:CNT). Valid only in a REPORT.
SUM Specifies the sum of the USE variable is printed in the format of the picture token declared instead of string text (PROP:SUM). Valid only in a REPORT.
AVE Specifies the average value of the USE variable is printed in the format of the picture token declared instead of string text (PROP:AVE). Valid only in a REPORT.
MIN Specifies the mimimum value of the USE variable is printed in the format of the picture token declared instead of string text (PROP:MIN). Valid only in a REPORT.
MAX Specifies the maximum value of the USE variable is printed in the format of the picture token declared instead of string text (PROP:MAX). Valid only in a REPORT.
RESET Specifies the CNT, SUM, AVE, MIN, or MAX is reset when the specified group break occurs (PROP:RESET). Valid only in a REPORT.
PAGE Specifies the CNT, SUM, AVE, MIN, or MAX is reset to zero when the page break occurs (PROP:PAGE). Valid only in a REPORT.
TALLY Specifies when to calculate the CNT, SUM, AVE, MIN, or MAX (PROP:TALLY). Valid only in a REPORT.
EXTEND Specifies special document formatting information. This information contains a valid string of attributes that are assigned to a designated REPORT control for a given document type. Valid only in a REPORT.

The STRING control places the text on the WINDOW, TOOLBAR, or REPORT at the position and size specified by its AT attribute. It is valid in Clarion Win32 WINDOWs, and also for REPORT structures in both Clarion Win32 and Clarion#.

If the text parameter is a picture token instead of a string constant, the contents of the variable named in the USE attribute are formatted to that display picture, at the position and size specified by the AT attribute. This makes the STRING with a USE variable a “display-only” control for the variable. The data displayed in the STRING is automatically refreshed every time through the ACCEPT loop, whether the AUTO attribute is present or not.

There is a difference between ampersand (&) use in STRING and PROMPT controls. An ampersand in a STRING displays as part of the text, while an ampersand in a PROMPT defines the prompt's “hot” letter.

A STRING with the TRN attribute displays or prints characters transparently, without obliterating the background. This means only the pixels required to create each character are written to screen. This allows the STRING to be placed directly on top of an IMAGE without destroying the background picture.

This control cannot receive input focus.

Events Generated:

EVENT:Drop A successful drag-and-drop to the control.

Example:

MDIChild WINDOW('Child One'),AT(0,0,320,200),MDI,MAX,HVSCROLL

         STRING('String Constant'),AT(10,0,20,20),USE(?S1)

         STRING(@S30),AT(10,20,20,20),USE(StringVar1)

         STRING(@S30),AT(10,20,20,20),USE(StringVar2),CURSOR(CURSOR:Wait)

         STRING(@S30),AT(10,20,20,20),USE(StringVar3),FONT('Arial',12)

        END

CustRpt REPORT,AT(1000,1000,6500,9000),THOUS

Break1   BREAK(Pre:Key1)

         HEADER,AT(0,0,6500,1000)

          STRING('Group Head'),AT(3000,500,1500,500),FONT('Arial',18)

         END

Detail    DETAIL,AT(0,0,6500,1000)

          STRING(@N$11.2),AT(6000,1500,500,500),USE(Pre:F1)

         END

         FOOTER,AT(0,0,6500,1000)

          STRING('Group Total:'),AT(5500,500,1500,500)

          STRING(@N$11.2),AT(6000,500,500,500),USE(Pre:F1),SUM,RESET(Pre:Key1)

         END

        END

       END

string_declare_a_string_control_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1