Components can even be extended to the point of becoming like objects. They have properties and events, can handle messages, and have member functions. By taking advantage of these, you can create your own powerful screen components out of the existing screen components. Since a group is technically a component containing other components, you can create powerful combinations as well. Components contained in a group have local scope to the group, so you can reference them directly by their name from the group scripts. Individual components within a group do not have access to the other components in the group except by using messaging. In general, then, you should place most of your script in the group.
Components of course have their own predefined properties like BackColor, Text, etc. Each component type has their own set. You can add additional properties to be used by your components scripts, editable from the properties window, and persisting to the document file. These are just like local variables, except they persist to file. To create a new property, use the CreateProperty() and CreateStringProperty() functions described in the 7.4.4 in detail. Of course you can also have just regular local variables by declaring them as such, but these variables won't persist to disk unless you manually do so. The most common place to put your CreateProperty() calls and local declarations is in the OnLoad() event.
If you are using the object oriented features of DAQFactory scripting, you can associate an object that you have instantiated to components using the expParentObject property of all components. This property is a string containing an expression that should result in a single instantiated object (not a class). That object is then put into the local scope of the component. This applies for component groups as well.
Note that expParentObject is an expression that is evaluated with every symbol access. It is not a reference to a particular object, but an expression that should result in an object. This means that if expParentObject is set to myObject and myObject is a global variable, and you change myObject to be a reference to a different object, then the component will adjust as well. You do not need to necessarily update the expParentObject property to change what object the component is using.
In addition to events, you can create your own member functions. These functions are local to the component and can be called from any other member function or event. They are public, so they can also be called using Component.MyComponent. notation from anywhere else in DAQFactory if you named your component. To add a new function, select the component and in the Event / Function window, click on the Add button. You will be prompted for the function name. Once you click OK, you will see your new function in the Event drop down and you can enter script in the area below. If you decide you don't need the function anymore, select it from the drop down and hit the Del button. You cannot add functions from the component's properties window, only from the docking Event / Function window.