DelRecord Database / Record 

Declaration:

PROCEDURE   DelRecord
(   h :HANDLE;
    name :STRING
) ;

Description:

Procedure DelRecord removes an attached record from the referenced object.

Parameters:

h Handle to object.
name Name of record to be removed.



  Field Database / Record 

Declaration:

PROCEDURE   Field
(   h :HANDLE;
    s1 :STRING;
    s2 :STRING;
    s3 :STRING
) ;

Description:

Obsolete.

See Also:

SetRField  



  GetFldName Database / Record 

Declaration:

FUNCTION   GetFldName
(   h :HANDLE;
    index :INTEGER
) :STRING ;

Description:

Returns the name of the specified field in the referenced record.

Parameters:

h Handle to record.
index Number of field whose name will be returned (in a range of 1-n).

Example:

FName:=GetFldName(HandleToRecord,1);



  GetFldType Database / Record 

Declaration:

FUNCTION   GetFldType
(   h :HANDLE;
    t :INTEGER
) :INTEGER ;

Description:

Returns a constant indicating the data type of a specified field in the referenced record.

Please refer to the VectorScript Appendix for specific field data types and formatting.

For Plug-in Object Parameter Records, the field types are documented in the VectorScript Appendix.

Parameters:

h Handle to record.
t Field index (range of 1 - n).

Example:

fieldType:=GetFldType(recordHandle,3);



  GetRecord Database / Record 

Declaration:

FUNCTION   GetRecord
(   h :HANDLE;
    cnt :INTEGER
) :HANDLE ;

Description:

Returns the handle to a specified record attached the referenced object.

Parameters:

h Handle to object.
cnt Index of attached record (in a range of 1 - n).

Example:

handleToRecord := GetRecord(handleToObject,3);



  GetRField Database / Record 

Declaration:

FUNCTION   GetRField
(   h :HANDLE;
    record :STRING;
    field :STRING
) :DYNARRAY[] of CHAR ;

Description:

Returns string description of a value in the specified record field.

Parameters:

h Handle to object.
record Name of record format.
field Name of field to be queried.

Result:

Returns the field value as a variable length string.

Example:

PROCEDURE Example;

FUNCTION WriteFieldValues(h :HANDLE) :BOOLEAN;
VAR
   cnt     :INTEGER;
   recHand :HANDLE;
   recName :STRING;
   fldName :STRING;
BEGIN
   recName := GetName(GetRecord(h, NumRecords(h)));
   recHand := GetObject(recName);
   FOR cnt := 1 TO NumFields(recHand) DO BEGIN
      fldName := GetFldName(recHand, cnt);
      WriteLn(fldName, ': ', GetRField(h, recName, fldName));
   END;
END;

BEGIN
   ForEachObjectInLayer(WriteFieldValues, 2, 0, 4);
END;
RUN(Example);



  LinkText Database / Record 

Declaration:

PROCEDURE   LinkText
(   h :HANDLE;
    rec :STRING;
    fld :STRING
) ;

Description:

Creates a linked text field in a newly created symbol. The specified text is linked to a record field, whose value is displayed by the text object.

LinkText must be called during symbol creation; the record to be associated with the linked text string must also exist at the time the link is created.

Parameters:

h Handle to text object that will be linked to record.
rec Name of record that will be linked to text string.
fld Name of field that will be linked to text string.

Example:

BeginSym('Symbol #2');
  Oval(-3/4",1/2",3/4",-1/2");
  TextFont(3);
  TextSize(12.00037);
  TextJust(1);
  TextOrigin(0.8611111",0.5138889");
  BeginText;
   'Field 9 String'
  EndText;
  LinkText(LNewObj,'Sample Format','Field 1');
EndSym;
Record(LNewObj,'Sample Format');

See Also:

BeginSym   EndSym  



  NewField Database / Record 

Declaration:

PROCEDURE   NewField
(   recName :STRING;
    fieldName :STRING;
    fieldValue :DYNARRAY[] of CHAR;
    fType :INTEGER;
    fFlag :INTEGER
) ;

Description:

Creates a new field in a specified record format. If the record does not exist, a new one is created using the specified record name.

Please refer to the VectorScript Appendix for specific field data types and formatting.




Parameters:

recName Name of record to which field will be added.
fieldName Name of new field.
fieldValue Default value for new field.
fType Data type of new field.
fFlag Display style of field.

Example:

NewField('Part Info','Serial No.','A-0000',4,0);



  NumFields Database / Record 

Declaration:

FUNCTION   NumFields
( h:HANDLE ) :INTEGER ;

Description:

Returns the number of fields in the referenced record.

Parameters:

h Handle to record.

Example:

totalFields:=NumFields(HandleToRecord);



  NumRecords Database / Record 

Declaration:

FUNCTION   NumRecords
( h:HANDLE ) :INTEGER ;

Description:

Returns the number of records attached to the referenced object.

Parameters:

h Handle to object.

Example:

numAttached:=NumRecords(HandleToObject);



  Record Database / Record 

Declaration:

PROCEDURE   Record
(   h :HANDLE;
    s :STRING
) ;

Description:

Replaces an existing record with a new version of the same record. Parameter s specifies the record to be updated.

Parameters:

h Handle to object.
s Name of record to be updated.

Example:

Record(handleToObj,'Vendor Information');



  SetRecord Database / Record 

Declaration:

PROCEDURE   SetRecord
(   h :HANDLE;
    record :STRING
) ;

Description:

Assigns an instance of an existing record format to the referenced object .

Parameters:

h Handle to object.
record Name of record to assign to object.

Example:

SetRecord(HandleToObject,'Part Info');



  SetRField Database / Record 

Declaration:

PROCEDURE   SetRField
(   h :HANDLE;
    record :STRING;
    field :STRING;
    value :DYNARRAY[] of CHAR
) ;

Description:

Assigns a new value to an existing field of a record attached to the referenced object.

Parameters:

h Handle to a object with an attached record.
record Name of record to be updated.
field Name of field to be updated.
value New value for field.

Example:

SetRField(HandleToObject,'Part Info','Serial No.','P-4322');