GetString Script

Build 1501 on 14/Nov/2017  This topic last edited on: 9/May/2012, at 13:03

Description

Returns, as a string, the value of the attribute attributeName of the object obj.

Syntax

dim i = GetString(obj, attributeName)

obj

the object, to read the attribute attributeName from

attributeName

the name of the attribute to be read from the object obj.

Code

  <Extension()> _

  Public Function GetString(ByVal obj As IGenericAttrObj, ByVal attributeName As String) As String

    Dim value As Object

    Dim found As Boolean

    value = GetAttributeBase(obj, attributeName, found)

    If found Then

      Return CType(value, String)

    End If

    Return Nothing

  End Function

Examples

  Public Function Notes(ByVal obj As IGenericAttrObj) As String

    Return GetString(obj, "notes")

  End Function

See also

GetInteger, GetBoolean, GetDecimal, GetDate, GetXmlDocument, GetDataContent

GetAttributeBase Function