Link Search Menu Expand Document

5.3 Delete Object

All objects are maintained by reference relationships. This concept is the same as JavaScript . Objects referenced by some other object are maintained until the reference relationship is broken.

The object tree starting with “//” is maintained because the parent object references the child object and the vertex “ // “ object is referenced by the Biz / Browser runtime.

Objects that do not belong to the object tree are also maintained by reference relationships. Objects that do not belong to the object tree are usually referenced as variables in the CRS program and are maintained until the variable is lost from scope.

How to delete
All references must be disconnected in order to delete the object.

Use the Delete method to break the reference relationship between parent and child .

Example

Function OnTouch (e) {
    var csvobj = new CSVDocument;           // 1
    var session = getHttpSession ();         // 2
    csvobj.Load (session.Get ("test.csv"));   // 3
    Form1.Spread1.Row << csvobj;
}

1. First a CSVDocument object is created by new and its reference is stored in the csvobj variable.
2. The getHttpSession function then returns an HttpSession object and its reference is stored in the session variable.
3. In addition, the HttpSession.Get method is executed as an argument of the CSVDocument.Load method, and the HttpResponse object is passed to the Load method.

So far, the references have been made to CSVDocument , HttpSession , and HttpResponse . The reference relationships for these objects are as follows:

https://biz-collections.com/support/webpages/html/onlinemanual/browser/crs/object/object_3.files/image001.gif

The operation at the time of opening is as follows.
1. Upon termination of the CSVDocument.Load method, the HttpResponse object will no longer be referenced and will be deleted.
2. Closing the OnTouch event handler clears the out-of-scope csvobj and session variables.
3. The CSVDocument object referenced by the csvobj variable is no longer referenced and is deleted.
4. The HttpSession object referenced by the session variable is still referenced by Biz / Browser itself and will not be deleted.