A local property is a protocol property that is scoped to a single component. Local properties are stored as a property list, but the data does not move with the data records and is not visible from anywhere outside the component where it is used. Instead, it is tied to the component itself. Local properties simplify the problem of multiple components using the same property names for temporary or count properties. Because they are not accessible from outside the component where they are used, the local properties do not pollute the global or data record property lists. If an expression makes a change to a local property when processing a data record, that change remains until the next data record is processed within that component. # Local SyntaxIn PilotScript, local properties are written with the hash character ( #number_of_molecules_passed #num_through_pass #num_through_fail Single quotes may be added to the property name to allow spaces and other special characters: #'total records' #'Total £' Assigning Local PropertiesYou can assign local properties to data record properties or global properties as illustrated in the following example: #lcount += 1; count := #lcount; In the above example, the local property When you use an expression like the one illustrated above, in a PilotScript component, you need to initialize the protocol property by setting the Initial Expression parameter. For example, to calculate an average molecular weight for a stream of molecules, use the following:
Note:
Data record properties are tied to the pipeline, so they cannot be accessed by these
parameters.
Loop PropertiesLocal properties are perfect to use as properties within loops and as temporary properties: #total := 0; FOR #index in 1 .. NumValues(myprop) LOOP #total += myprop[#index]; END LOOP; average := #total / numvalues(myprop); The above example calculates the average value for the data record property array myprop.
Since local properties are used for the looping property | |||||||||||||||||