Jump to content

String class: Difference between revisions

From LabVIEW Wiki
Started page
 
m Removed VI Server Category from page
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{VIServerClass|name=String|id=27|scope=basic|class_0=Generic|class_1=GObject|class_2=Control|class_3=String}}
{{VIServerClass|27}}


{{stub}}
{{stub}}
Line 7: Line 7:
{{TOCright}}
{{TOCright}}


==Properties==
<!--Edit Properties, Methods, or Events in the appropriate table in one on the VI Server Templates-->
<span class="mw-customtoggle-propertiestable">Show/Hide String Properties Table</span>
{{VIServerClassTables|27}}
<div class="mw-collapsible" id="mw-customcollapsible-propertiestable">
{{VIServerLegend|showrw=TRUE|showrte=TRUE}}
{| class="wikitable sortable"
|+ String Properties Table
! Property ID
! Short Name (English)
! Description
! R/W
! RTE
|- style="background-color:#FFFFCC;"
|6345813
| [[String class/Allow Dragging property|Allow Dragging]]
|If TRUE, LabVIEW starts a drag and drop operation when you use the Operating tool to drag text from this control.
 
Use the Control events for more control over how users drag items within controls.
|R/W
|X
|- style="background-color:#FFFFCC;"
|6345814
| [[String class/Allow Dropping property|Allow Dropping]]
|If TRUE, the control automatically accepts text dragged to it, including the LV_TEXT data type from drag and drop events. The LV_TEXT data type is of type string. If FALSE, LabVIEW does not automatically accept any drops, including from the operating system, at run time. LabVIEW returns error 1157 if you set this property on an indicator.
 
Use the Control events for more control over how users drag items within controls.
|R/W
|X
|- style="background-color:#CCFFFF;"
|6345809
| [[String class/DefVal property|DefVal]]
|Gets or sets the default value of the string control.
|R/W
|X
|- style="background-color:#FFFFCC;"
|6345815
| [[String class/DisplayFormatVisibility property|DisplayFormatVisibility]]
|Gets or sets the visibility of the display format for the string control.
 
This property is similar to the <b>Visible Items&#0187;Display Style</b> item on the shortcut menu of a string object and the<b> Display Style Visible</b> checkbox on the Appearance page of the<b> String Properties</b> dialog box.
|R/W
|X
|- style="background-color:#FFFFCC;"
|6345805
| [[String class/DispStyle property|DispStyle]]
|Sets the display style of a string object. Valid values include 0 (normal), 1 (backslash '\' codes), 2 (password), and 3 (hex). You cannot write to this property when the referenced string control has key focus.
 
This property is similar to the Display items on the shortcut menu of a string object.
|R/W
|X
|- style="background-color:#FFFFCC;"
|6345812
| [[String class/EnableWrap property|EnableWrap]]
|If FALSE, disables word wrapping, wrapping only at line breaks instead.
 
To use this property, you must set the display style to 0 (normal). This property is similar to the Enable Wrapping item on the shortcut menu of a string control and the <b>Wrap at word breaks</b> option on the Appearance page of the <b>String Properties</b> dialog box.
|R/W
|X
|- style="background-color:#D1BB80;"
|634580A
| [[String class/Force Unicode Text property|Force Unicode Text]]
|
|R/W
|X
|- style="background-color:#FFFFCC;"
|6345811
| [[String class/HScrollVis property|HScrollVis]]
|If TRUE, displays a horizontal scroll bar.
 
Before you display a horizontal scroll bar, you must set Enable Wrapping to FALSE and set the display style to 0 (normal).
 
This property is similar to the <b>Visible Items&#0187;</b>Horizontal Scrollbar item on the shortcut menu of a string control and the <b>Show horizontal scroll bar</b> option on the Appearance page of the <b>String Properties</b> dialog box.
|R/W
|X
|- style="background-color:#FFFFCC;"
|6345807
| [[String class/LimitSglLine property|LimitSglLine]]
|If TRUE, the user cannot enter a carriage return in the control or indicator. However, the user can copy the first line of a string and paste it in the string control or indicator.
 
This property is similar to the Limit to Single Line item on the shortcut menu of a string object.
|R/W
|X
|- style="background-color:#D1BB80;"
|634580B
| [[String class/PreallocLen property|PreallocLen]]
|
|R/W
|X
|- style="background-color:#FFFFCC;"
|634580D
| [[String class/Size property|Size]]
|Width and height in pixels of the frame around the text area of the string control.
 
This property is similar to the <b>Size Height</b> and <b>Size Width</b> options on the Appearance page of the <b>Properties</b> dialog box.
|R/W
|X
|- style="background-color:#FFFFCC;"
|634580F
| [[String class/Height property|Height]]
|Height of the frame around the text area of the string control in pixels.
 
This property is an element of the Size property. This property is similar to the <b>Size Height</b> option on the Appearance page of the <b>Properties</b> dialog box.
|R/W
|X
|- style="background-color:#FFFFCC;"
|634580E
| [[String class/Width property|Width]]
|Width of the frame around the text area of the string control in pixels.
 
This property is an element of the Size property. This property is similar to the <b>Size Width</b> option on the Appearance page of the <b>Properties</b> dialog box.
|R/W
|X
|- style="background-color:#FFFFCC;"
|6345804
| [[String class/Text property|Text]]
|Reference to the text inside the string control.
|R
|X
|- style="background-color:#FFFFCC;"
|6345808
| [[String class/UpdtWhileTyping property|UpdtWhileTyping]]
|Updates the value of a string as the user enters characters instead of waiting until the user presses the  key or otherwise ends text entry.
 
This property is similar to the Update Value while Typing item on the shortcut menu of a string object.
|R/W
|X
|- style="background-color:#FFFFCC;"
|6345800
| [[String class/Value property|Value]]
|Value of string control.
|R/W
|X
|- style="background-color:#FFFFCC;"
|634580C
| [[String class/Val(Sgnl) property|Val(Sgnl)]]
|Sets the value of the control and generates a Value Change event.
 
This property updates the value of an object similar to the Value property. However, Value (Signaling) also causes LabVIEW to generate an event as if the user had interactively changed the value of the object. National Instruments recommends you use this property only when you rely on LabVIEW generating an event in response to the programmatic value change.
|W
|X
|- style="background-color:#FFFFCC;"
|6345810
| [[String class/VScrollVis property|VScrollVis]]
|If TRUE, displays a vertical scroll bar.
 
This property is similar to the <b>Visible Items&#0187;</b>Vertical Scrollbar item on the shortcut menu of a string control and the <b>Show vertical scroll bar</b> option on the Appearance page of the <b>String Properties</b> dialog box.
|R/W
|X
|}
</div>
 
==Methods==
<span class="mw-customtoggle-methodstable">Show/Hide String Methods Table</span>
<div class="mw-collapsible" id="mw-customcollapsible-methodstable">
{{VIServerLegend|showrte=TRUE}}
{| class="wikitable sortable"
|+ String Methods Table
! Method ID
! Short Name (English)
! Description
! RTE
|- style="background-color:#FFFFCC;"
|6345403
| [[String class/Append String method|Append String]]
|Appends a string to the existing value of the referenced string control.
|X
|- style="background-color:#FFFFCC;"
|6345402
| [[String class/ByteOffFromPt method|ByteOffFromPt]]
|Returns the byte offset of the string from the given point.
|X
|- style="background-color:#FFFFCC;"
|6345401
| [[String class/Get Nth Line method|Get Nth Line]]
|Gets the characters that make up the Nth line in a string control and returns the offsets in the original string in bytes.
 
You can use this method to determine how the text in a string control is word-wrapped. The position indexes are byte indexes. These are usually equivalent to character indexes, except when using text that has characters that use multiple bytes, such as Asian character sets.
 
Example
|X
|- style="background-color:#FFFFCC;"
|6345400
| [[String class/Size to Text method|Size to Text]]
|Resizes the string control vertically to show all text. This method does not resize the string control horizontally.
 
This method is similar to the <b>Size to text</b> option on the Appearance page of the <b>Properties</b> dialog box.
|X
|}
</div>
 
==Events==
''No Events for this class.''


== History ==
== History ==
{{ambox|text=History information is needed.  What changes have occured over previous versions?}}
{{ambox|text=History information is needed.  What changes have occurred over previous versions?}}
{| class="wikitable"
{| class="wikitable"
! Version
! Version
Line 214: Line 25:
*[[VI Scripting]]
*[[VI Scripting]]


[[Category:VI Server]]
 
[[Category:VI Server Class]]
[[Category:VI Server Class]]
[[Category:VI Scripting]]

Latest revision as of 02:01, 8 May 2020

VI Server Class Information
Return to VI Server Class Hierarchy
Class Name String class
Class ID 27
Scope Basic Development Environment
Class Inheritance
Class Children


The String class is a class in the VI Server Class Hierarchy, (see also VI Server).

Properties

Show/Hide String Properties Table

Legend
R/WReadable/Writable Permissions
RTEAvailable in the Run-Time Engine
Basic Development Environment
VI Scripting
Private
Deprecated
String Properties Table
Property ID Long Name (English) Description R/W RTE
6345800ValueValue of string control.Read/WriteYes
6345801Text SizeRead/WriteYes
6345802Text Size:WidthWidth of the frame around the text area of the string control in pixels.Read/WriteYes
6345803Text Size:HeightHeight of the frame around the text area of the string control in pixels.Read/WriteYes
6345804TextReference to the text inside the string control.Read OnlyYes
6345805Display StyleSets the display style of a string object. Valid values include 0 (normal), 1 (backslash '\' codes), 2 (password), and 3 (hex). You cannot write to this property when the referenced string control has key focus.Read/WriteYes
6345806Scrollbar VisibleRead/WriteYes
6345807Limit To Single Line?If TRUE, the user cannot enter a carriage return in the control or indicator. However, the user can copy the first line of a string and paste it in the string control or indicator.Read/WriteYes
6345808Update While Typing?Updates the value of a string as the user enters characters instead of waiting until the user presses the <Enter> key or otherwise ends text entry.Read/WriteYes
6345809Default ValueGets or sets the default value of the string control.Read/WriteYes (Read Only)
634580AForce Unicode TextRead/WriteYes
634580BPrealloc LengthRead/WriteYes
634580CValue (Signaling)Sets the value of the control and generates a Value Change event.Write OnlyYes
634580DSizeWidth and height in pixels of the frame around the text area of the string control.Read/WriteYes
634580ESize:WidthWidth of the frame around the text area of the string control in pixels.Read/WriteYes
634580FSize:HeightHeight of the frame around the text area of the string control in pixels.Read/WriteYes
6345810Vertical Scrollbar VisibleIf TRUE, displays a vertical scroll bar.Read/WriteYes
6345811Horizontal Scrollbar VisibleIf TRUE, displays a horizontal scroll bar.Read/WriteYes
6345812Enable WrappingIf FALSE, disables word wrapping, wrapping only at line breaks instead.Read/WriteYes
6345813Allow DraggingIf TRUE, LabVIEW starts a drag and drop operation when you use the Operating tool to drag text from this control.Read/WriteYes
6345814Allow DroppingIf TRUE, the control automatically accepts text dragged to it, including the LV_TEXT data type from drag and drop events. The LV_TEXT data type is of type string. If FALSE, LabVIEW does not automatically accept any drops, including from the operating system, at run time. LabVIEW returns error 1157 if you set this property on an indicator.Read/WriteYes
6345815Display Format Visible?Gets or sets the visibility of the display format for the string control.Read/WriteYes (Read Only)

Methods

Show/Hide String Properties Table

Legend
RTEAvailable in the Run-Time Engine
Basic Development Environment
VI Scripting
Private
Deprecated
String Methods Table
Method ID Long Name (English) Description RTE
6345400Size to TextResizes the string control vertically to show all text. This method does not resize the string control horizontally.Yes (Read/Write)
6345401Get Nth LineGets the characters that make up the Nth line in a string control and returns the offsets in the original string in bytes.Yes (Read/Write)
6345402Byte Offset from PointReturns the byte offset of the string from the given point.Yes (Read/Write)
6345403Append StringAppends a string to the existing value of the referenced string control.Yes (Read/Write)

Events

This class has no events or it inherits events from its parent: Control Class.


History

Version Change(s)
LabVIEW 2018 More info to come.

See Also