OS-Package in OScript

The famous OS package in OScript is very important for the internal functionalities of the Content Server Modules, but its hardly documented. This post is an overview of the methods in this package.

A closer look

All of these methods van be used by adressing tzhe methods with the package name (OS) in any oscript program. For example OS.Features(Object) lists all features of the object in the argument.

Disclaimer: This list is not complete and may change any time and any Content Server Version, as long as there is no official documentation of this package. And there is (of course) no guarantee on this list by me.

Methods

CreateOSpace(sPath)ObjectCreates a new OSpace
New(oParent)ObjectCreates a new OSpace object
Delete(Object)Deletes an OSpace object
NewTemp(MasterObject)Creates a new instance of an OSpace object
IsTemp(Object)IntegerWas the object created using newTemp. Result 0,1.
Root(MasterObject)ObjectReturns the module root object
Roots()ArrayReturns all loaded root objects
Orphans(Object)ArrayReturns all orphans in the objects ospace
Children(Object)ArrayGets children objects from the object
Patent(Object)ObjectGets the parent object
Name(Object), FileName(Object)StringReturns the name of the object/ospace of the object
ReadOnly(Object)BooleanIndicates, if the current ospace is locked
Features(Object)ListLists all features in the current object
IsFeature(Object, sFeatureName)BooleanReturns, if the Feature sFeatureName exists in Object
AddFeature(Object, sFeatureName, [optional] CopyableBoolean)Add a new feature to the object
DeleteFeature(Object, sFeatureName)Removes the feature sFeatureName from the object
ClearValue(Object, sName)Clears the content of the feature nName
IsObject(objRef)BooleanChecks, if the object still exists

Happy OSpace Changing