Skip to main content
OCLC Support

GetField

Find the syntax, use, parameters, return values, and an example for the GetField macro command in Connexion client.
Syntax BOOL = CS.GetField (sTag, nInstance, sData)
Use to Get the data for a field by tag number and, in the case of repeated variable fields, by order of appearance among the other fields with the same tag number.
Parameters
  • For sTag, enter the field number of the field you want.

     Note: You can use a period (.) in a tag number as a wildcard.

    Examples:
    CS.GetField("6.., 2, sField) gets the second 6XX tag
    CS.GetField(".00", 2, sField) gets the second X00 tag
    CS.GetField(“...”, 2, sData) gets the second line in the record and is the same as using: CS.GetFieldLine(2, sData)
  • For instance, enter a number to specify which instance of the repeated field you want. For example, enter 2 to get the second instance of the field.
  • Enter the parameter sData to store the text of the field you specify.
Comments
  • The first parameter, sTag, accepts the period (.) as a wildcard.
  • Retrieving data that contains non-Latin script characters using this macro command returns a message: Data contains non-Latin script. Use the GetFieldUnicode command instead for retrieving data with non-Latin scripts.
Return values TRUE if the action is successful, or FALSE if not.
Example Sub Main()
 

     Dim CS As Object
     Dim sData as String

     Set CS = GetObject(,“Connex.Client”)

     If CS.IsOnline = False Then
          CS.Logon ““, ““, ““
     End If

     CS.Search “WC”, “.1”

     CS.GetField “700”, 2, sData

     MsgBox sData

     If CS.GetField(“520”, 1, sData) = True Then
          MsgBox sData
     End If
End Sub

What this example does
  • Logs on to Connexion if not already logged on, using the default authorization and password you selected in Tools > Options > Authorizations tab.
  • Searches WorldCat for record number 1.
  • Gets the second instance of field 700 and stores the data in the field.
  • Returns a message giving the data of field 700.
  • Gets the first instance of field 520 and returns a message giving the data in the field.