LineCount method (DataWindows)
Description
Determines the number of lines in an edit control that allows
multiple lines.
Controls
|
DataWindow type |
Method applies to |
|---|---|
|
PowerBuilder |
DataWindow control |
|
Web ActiveX |
DataWindow control |
Syntax
[PowerBuilder]
|
1 |
long <span>dwcontrol</span><span>.LineCount</span> ( ) |
[Web ActiveX]
|
1 |
number <span>dwcontrol</span><span>.LineCount</span> ( ) |
|
Argument |
Description |
|---|---|
|
dwcontrol |
A reference to a DataWindow control |
Return Values
Returns the number of lines in dwcontrol if
it succeeds and –1 if an error occurs. If dwcontrol is
null, LineCount returns null.
Usage
LineCount counts each visible line, whether
it was the result of wrapping or carriage returns.
When you call LineCount for a DataWindow,
it reports the number of lines in the edit control over the current
row and column. A user can enter multiple lines in a DataWindow
column only if it has a text datatype and its box is large enough
to display those lines.
The size of the column’s box determines the number
of lines allowed in the column. When the user is typing, lines do
not wrap automatically; the user must press Enter to type additional
lines.
PowerBuilder environment
For use with other PowerBuilder controls, see LineCount in
the PowerScript Reference.
Examples
If the MultiLineEdit mle_Instructions has
9 lines, this example sets li_Count to 9:
|
1 |
integer li_Count |
|
1 |
li_Count = mle_Instructions.<span>LineCount</span>() |
These statements display a MessageBox if fewer than
two lines have been entered in the MultiLineEdit mle_Address:
|
1 |
integer li_Lines |
|
1 |
li_Lines = mle_Address.<span>LineCount</span>() |
|
1 |
IF li_Lines < 2 THEN |
|
1 |
MessageBox("Warning", "2 lines are required.") |
|
1 |
END IF |