Creating an Interface from an Editor


VC/m has several calls which can be added to a routine editor to create an interface from the editor to VC/m. These can provide various levels of sophistication, depending on the users' needs.

At the simplest level, an interface to VC/m only has two requirements. A check must be made that the copy of the component which is being edited is the master copy, and the date /time stamp must be updated when it is saved.

It is a general principle that when a routine or other component is edited, the copy that is being edited should be the master copy. If the copy being edited is indeed the master copy, editing can be permitted with no further intervention until the changes are saved.

VC/m keeps a record of the last changed date /time stamp for every object. When any change to a component is saved, VC/m needs to be informed of this.

More sophisticated interfaces can be implemented which provide additional functionality and make the use of VC/m even more convenient. For example:

  • Automatic invocation of the VC/m check-out screen if the master copy is not at the location where the editor is being used.
  • Automatic invocation of the VC/m object registration if the routine to be edited is new or is not already associated with an object. For new routines, VC/m modules can cause a skeleton routine to be generated automatically.
  • Automatic notification to VC/m when a routine, or other component, is deleted.

A number of function calls are provided which allow users to create an individual editor interface which is suited to their needs. It is the user's responsibility to check that no copyright is infringed by amending an editor which is supplied by a third party.

Component Status


This function call returns a backslash delimited string that contains the status and other information about a component. The information can be used to determine what action or actions should be performed before editing of a component is permitted.

Usage:

set status=$$status^%vc1edt(ctype,cname)

Inputs:

Code Explanation
ctype Component type
cname Component name

Outputs:

Code Explanation
$$status flag\obv\msg
flag = status of component at the current location
  • -1 if error in format of component name
  • 0 if master copy of component is not at current location
  • 1 if master copy of component is at current location
  • 2 if component is not known to VC/m

obv = object and version if known to VC/m, format is object/variant.version
msg = error message if flag is -1

Update Date/Time Stamp for Component


This call updates the date /time stamp for a component at the current location. It enables a routine editor or other maintenance tool to inform VC/m that a component has been changed.

Usage:

do update^%vc1edt(ctype,cname)

Inputs:

Code Explanation
ctype Component type
cname Component name

Outputs:

None

Create or Check Out an Object


This call enables the object that a component belongs to be checked-out. If the component does not belong to an object, it allows a new object to be created or allows the component to be added to an existing object.

In all cases the screen is cleared and the appropriate VC/m screen is invoked. On exit from this call, the screen is also cleared. The user may or may not actually check out the object when this call is invoked. The status of the component should therefore be re-checked on return from this call.

Usage:

do checkout^%vc1edt(%usr,ctype,cname)

Inputs:

Code Explanation
%usr User ID (must be in the VC/m user ID file)
ctype Component type
cname Component name

Output:

None

Is this a VC/m Controlled Location?


This call enables a routine editor or other maintenance tool to determine whether or not a particular location (UCI, namespace, etc.) is a VC/m controlled location. If it is, only the master copy of a component should be edited in this location and VC/m should be informed whenever a component is changed in this location. If it is not a VC/m controlled location, VC/m may still be aware of the location, but it is not necessary for routine editors to make any further calls to VC/m.

Note: The calls to status and update are both sensitive to whether or not a location is controlled by VC/m. They can therefore be called directly, without the need to use this call first.

Usage:

set vcm=$$vcd^%vc1edt

Inputs:

None

Outputs:

Code Explanation
$$vcd Flag indicating whether this location is controlled
  • 1 = Controlled
  • 0 = Uncontrolled

Delete a Component from an Object


This call enables an editor or maintenance tool to inform VC/m that a component has been deleted. VC/m does not actually physically delete the component when this call is made, but it will delete this component in other locations when the object that owned the component is subsequently transferred there.

Note: If the master copy of the object that owns the component is not at the current location, VC/m will not delete the component. No error message is given as this condition should be detected by calling $$status (component status) before permitting the deletion to occur.

Usage:

do delete^%vc1edt(ctype,cname)

Inputs:

Code Explanation
ctype Component type
cname Component name

Outputs:

None