Skip to main content
OCLC Support

SetField

Find the syntax, use, parameters, return values, and an example for the SetField macro command in Connexion client.
Syntax BOOL = CS.SetField (nInstance, sData)
Use to Add a field or add data to an existing field specified by tag number and, in the case of repeated variable fields, by the order of appearance among the other fields with the same tag number.
Parameters
  • For nInstance, enter a number to specify the position of the new field among the repeated instances of the field. For example, enter 2 to insert the new field below the first instance of the specified field.
  • For sData, enter the text you want to insert: Type the three-character field number, followed by two one-character indicators (or substitute spaces if no indicators), followed by the field text. Enclose the data string in quotation marks (“).
Return values TRUE if the action is successful, or FALSE if not.
Example Sub Main()

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

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

     CS.Search “WC”, “#1”

     CS.SetField 1, “245 New 245 field”

     If CS.SetField(2, “700 New second occurrence of 700 field”) = True Then
          MsgBox “Second 700 field changed”
     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.
  • Adds a new field 245 as the first instance of the field, with no indicators (two spaces between tag number and text) and the text: New 245 field.
  • Adds a new field 700 as the second instance, with no indicators and the text: New second occurrence of 700 field. If the action is successful, returns the message: Second 700 field changed.