TextUnload Method

Object List Next Object

Defined By:
Application

Description:

Appends to 'cmds' any statements necessary to regenerate the object from text. It is used by the Text-based object saving mechanism that is used by the write module (as text) functions.

Declaration:

Function TextUnload(ByVal indent As String, cmds As String) As Integer

Details:

TextUnload is a method used to create the lines that appear inside the With block for a particular object. It is used during writing of the .eto file. If an object inherits a TextUnload method, it can be overridden to provide different text-writing behavior for that object.

When an object has a TextUnload method, no properties defined by this object will be output by default.

The return value for TextUnload is True if inherited properties were handled by the TextUnload and False if the default output for inherited properties were used.

If you want to change how properties defined by your object write out, but not how inherited properties are written out, implement a TextUnload and return False.

If you want to change how inherited properties write out, implement a TextUnload and return True. When you do this, it is the responsibility of the TextUnload method to output all the properties for that object. There are two ways to output properties for an object:

  1. Call the TextUnload method of a base class.

  2. Use the TextFieldUnload function to output a specific property.

Example:

The following TextUnload method does not change how the default properties write out.

Function TextUnload(ByVal indent As String, cmds As String) As Integer
' Now that this object has a TextUnload, we are completely reponsible
' for writing unique properties to this object.
'
' Append to 'cmds' any
cmds = cmds & TextFieldUnload(me, indent, "MyUniqueProperty")

' Have inherited properties write out.
TextUnload = False
End Function

Function TextUnload(ByVal indent As String, cmds As String) As Integer
' Now that this object has a TextUnload, we are completely reponsible
' for writing unique properties to this object.

' Inhibit writing of inherited properties
TextUnload = True

End Function

See Also: Globals