Initial conditions of the code suggests that, depending on the specific parameters will be carried out one or another part of the program.
The basic syntax is:
if (condition) then
— Code executed when the condition
— If the conditions are not met, the code also will not be executed
Implementation of action depending on the type of the current element
— If the type of the current element is VALV, then
if (!!CE.Type EQ ‘VALV’) then
— Write to the variable var type of the current element and its name in the form!
!var = !!CE.Type + ‘ – ‘ + !!CE.Name
— Derive the resulting value
This post was taken from blog http://pmlinpdms.blogspot.com/
Some techniques for working with string variables.
Initial string variable:
!stringVar = ‘Wedge gate valve with rising stem # 30c41nzh / 30nzh41nzh‘
Example 1: Separation of part to a certain character or expression
!resultVar = !stringVar.Before(‘#’)
As a result, the variable !resultVar written to ‘Wedge gate valve with rising stem’, that is something that is up to the value specified as a parameter to the method.
Used method .Before(‘DELIMITER’)
NB: spaces are also considered Continue reading Aveva. PML BASICS. Strings
Sometimes we need to run such commands inside our code, in methods of our forms or from uic menu.
I recomend to use such method:
!!runsynonym(‘CALLG RSPECS PIPING _uspecselements_pipeSpecList’)
–This code will fill pipeSpecList list for form !!uspecselements