Beruflich Dokumente
Kultur Dokumente
A query on usage in the field: how much do you use the $ comments (either $* or $(...$) )?
(For those of you at the ISEITs this is to do with Published PML...)
I want to be able to strip comments when publishing the PML, and am wondering just how
much trouble to go to with wierdly nested and hidden comments! (I will never mangle
anything, but might not strip all the comments if you do really odd things)
I use the $* comments as much as possible. Specially because I'm the kind of person who will
write a macro and forget about it and 6 months later someone is asking me to add some new
function to the macro. I try to add as much comments for my own personal benefit.
If you are new to pml and you want to make life easier. I suggest you try to comment as much
as possible. Also, name you macros something that will make since 6months to even years
from now. I have spend hours, days even months writing macros only to misplace them. By
adding as much comments, you are not only making your life easier but your employeer as
well. This go back to the ISEIT meeting.
JCont....mate its simply awesome.....very useful...please keep it up!....
I reckon better add the ALPHA LOG command...where you can take ur logs to a file and not
flood ur command line :)
--------------------------------------------------------------------------------------------------------------------Yes I agree.
When using the Tracking, you might want to use the alpha log command first. Try this.
Alpha log /C:/test.txt over
By adding the over, I am overwriting any file with the name Test.txt
Turn trace on
$R6
Than, using the pull downs
Modify > Name
The modify name form will come up and your command line filled with text.
$R
To turn off the Trace
Alpha log end
To end the log
Open the .txt file and check out some of the code. That is how I learn pml, by reading aveva's
code.
Just a note: You are only allowed to have one log file open at the time. Another option will be
to use Alpha Files. I'll get to that later.
Can also do $HR at the command line to get all options for $R
--------------------------------------------------------------------------------------------------------------------Quote:
If I do not remember wrong, you cannot use -- for inline comments where you can use the $*
syntax.
like:
handle any $* Taking care of a problem. If I remember correctly you cannot do this with -endhandle
I recall reading somewhere that -- can only be used for commenting whole lines.
=====================================================================
Quote:
I didn't know I could comment out part of a line with the $*. !!
awesome!!!
(#17)
Hi gentlemen,
I am used to run a macro loaded with my favourite synonyms when I start PDMS. So I tried to
use the command $QS as I saw it in the first post. Now I see in command window the list and
I would like to get clear something.
There are synonyms with $S1 before the synonym description. Example :
$S1 AA = add all within volu ce $S1
Then I have here synonyms with $S0 (all my syns + some more). Example :
$S0 FGF =new fla choo all new gask choo all new fla choo all (short sequence for inserting pair
of flanges)
And then finally there are some synonyms with $SU1 for running a macro. Example :
$SU1 CALLE =$M/%PDMSUI%/DES/EQUI/$S1
I don't understand the difference between $S0, $S1, $SU1. Is it supposed to be an argument?
Are not arguments in general $n - without 'S'? What does it actually do? And why it says :
(47,33) CP: Illegal macro format
When I try to run the macro for myself (in this case : $M/%PDMSUI%/DES/EQUI/$S1 )?
One question...
Why "$*" and "--" are not equivalent?
"$*" works any position in the line, and "--" works only at the beggining of the line.
Why AVEVA designed the comment like that? Any reason?
Possible to use $R5 /FILE.name
What is an Array?
The simple answer to me would be a collection.
How to create an Array
!Array = Array()
This is an empty variable but it has been defined as an array
Adding to the array
Type 1
!Array[1] = 'BOB'
!Array[2] = 'GEORGE'
!Array[3] = 'KELLY'
Type 2
!Array.Append('BOB')
!Array.Append('GEORGE')
!Array.Append('KELLY')
q var !Array
Other Command to know when using an array
!Array.Clear()
!Array.Size()
!Array.Sort()
!Array.SortUnique()
!Array.Unique()
You can find out more in the PDMS Manual, Search Array Objects.
wats the difference between type1 and type2......sorry am just starting to learn PML..so
forgive me if im asking sumthing verryy basic!
Also I was thinking if u can put some treads with examples......like
1. How can we assign values to elements using PML...e.g. If I have to assign pspec /A300 TO
ALL PIPES WITH BORE SIZE 100
2. How do we collect elements and run a macro on them...e.g. collect ALL brances under
zone /10LAB and set/change Ispec to /HC
and so on.....
What is the difference between type1 and type2. Now, they are not called type1 and 2, I just
added that so everyone can see that you can do more that one way. An array is a collection
when you use the [ ] and specify a number, you are telling the exact order you want that item
to be in.
For example:
!Array[1] = !!CE
I am adding my current element to the first member of the array
When I use type2
!Array.Append(!!CE)
I am simply adding my current element to the list (The end of the list)
Now, you added 2 questions. I believe that cvitte71 has a hot tread about collections.
In order to do what you are asking for we are going to need to use a loop. I'm going to be
posting another PML Basics (Loop) and I'll use your questions as examples.
Check out my new thread on loops
PML Basics Part 3 (Creating a Loop)
I added you question as the examples.
Here we go again. Out of everything that I have learn about pml, I had the most difficulty
learning Loops. I didn't understand them, finally after many mistakes I got a handle on loops.
What is a loop?
Its a series of commands that will continue to happen until the loop is broken.
Do
This starts a loop, now one of my first mistakes was that I didn't specify the number of times I
wanted the loop to run and I didn't know how to break the command
Enddo
For every "Do" you must have an "Enddo"
Now I know I haven't covered collections but you can check out a nice sticky threat cvitte71
has started. So lets do a simple macro. This macro will collect all sections, check the gtype to
make sure its correct and print any sections that have the incorrect gtype.
var !Coll coll all (SCTN GENSEC) with (Gtype of Catref neq Gtype of Sctn) for $!!CE
I know this is not PML2; lets get the basics out first.
Do !x from 1 to !Coll.Size()
Now, what does this line mean? I already explained that the "Do" starts the loop.
The second parts "!x", is a number any number. In this case from 1 to !Coll.size().
In other words, the first time the loop runs, !x will equal 1 then 2 so on until it reaches !
Coll.Size()
What is !coll.size()?
Its the number of items inside the !coll array.
$P $!Coll[$!x] has the wrong Gtype
$p is the print command
$!Coll[$!x] mean $!Coll[1] which is the first item in the collection
Enddo
$**********************************************
with out the comments
$**********************************************
var !Coll coll all (SCTN GENSEC) with (Gtype of Catref neq Gtype of Sctn) for $!!CE
Do !x from 1 to !Coll.Size()
$P $!Coll[$!x] has the wrong Gtype
Enddo
I'll add more example later today.
Hello,
you can also use:
var !Coll coll all (SCTN GENSEC) with (Gtype of Catref neq Gtype of Sctn) for $!!CE
Do !x indices !Coll
Are you going to examine OBJECTS, especially the COLLECTION OBJECT. And the use of this
object? Like you pointed out in your thread, the other collections thread explores multiple
ways to create the collection using both PML1 and PML2. Very intriquing. The multiplicities of
options in using PML can be daunting.
-------------------------------------------------------------------------------------------------Yes, I'll start getting more into object collect & object collections. Here is another example
using a different type of collection
!BRANCH = !!CollectAllFor('BRAN', '', !!CE)
Do !y indices !BRANCH
$!BRANCH[$!y]
Ispec /HC
Handle any
$pError on $!BRANCH[$!y]
EndHandle
Enddo
PDMSGuru, I'm not a piping designer (my back ground is structural) and I got the
information on how to queary the pipe bore from a previous threat you answered, could you
double check my previous collection. I don't want to give anyone the wrong information.
Specially since we are not running pdms out of the box, we have customize pdms to an
extreme.
================================================================
As you get an array of element references directly by using the CollectAllFor function you could
also assign the attribute value without first jumping to the element, like:
!BRANCH = !!CollectAllFor('BRAN', '', !!CE)
Do !y indices !BRANCH
!BRANCH[!y].Ispec = /HC
Handle any
$p Error on $!BRANCH[$!y]
EndHandle
Enddo
The selected element would in this example remain the same also while running through the
loop.
jcont20,
Your collection would now have worked.
Var !PIPE COLL ALL (PIPE) WITH (PARAM[1] OF CATREF OF SPCO EQ 100) FOR $!!CE
PIPE Elements do not have CATREF's, in addition, the BORE ATT on a PIPE element is not even
an intelligent one.
A way I could accomplish this is
Var !PIPE COLL ALL BRAN MEM WITH (p1 bor EQ 100) FOR CE
Collecting Branch members themselves is the best way I find to work with piping components.
Heads and tails may change on branches, and sometimes they don't even reflect what's in the
pipe, a head bore may be 100, then the first mem is a reducer, the rest of the branch might
then be 150. so working with branch members is better in my humble opinion.
Next, notice I asked for the p1 bore, this guarantees me that I will add an element with at
least one side of it matching my criteria, I could add more criteria to guarantee that I get
anything that has 100 as a bore, p1, p2 , p3 etc. But by asking for catalogue parameters, I'm
assuming that my catalogue administrator hasn't done anything silly with the first parameter.
An event that has undone me in the past.
Also, to clean it up a bit, you don't need the $!!CE, just CE will do.
Tip: on anything that has a SPRE with a CATREF, the CATREF is also available for query from
that element. So instead of CATREF of SPRE, (I would not say SPCO, as that is an element,
and not a reference), you could just call the CATREF, it is a pseudo attribute.
I've heard some really good things about you jcont20, someone that spoke with you at the
Americas Conference in the US says you are doing some great things with Ring Plates. Your
company is lucky to have you, and so is PDMSWORLD. Keep up these great posts. I'll
comment when you invite me to. I really enjoy reading them.
Thanks for asking me to pitch in, I am honored.
Hi JCont20,
Thank u 4 explaining things much better than the manuals :)....i did try ur and others code
and its a good practice as a start...for one of our real projects i have to rename ALL zones with
name contaioning -PREM to -PRELIM
e.g. Zone /16CS-UHA-21.4-PREM needs to be renamed to /16CS-UHA-21.4-PRELIM
please review my code below and guide me how to rename the zones as required above...i
belive my collection is ok..but only the rename part i need to fix with ur help
define function !!APMCheckLevel()
Var !PRZONE COLL ALL (ZONE) WITH (MATCHW(NAME,'*-PREM*') ) FOR $!!CE
Do !y indices !PRZONE
$!PRZONE[$!y]
RENAME ....HOW?????
Handle any
$pError on $!przone[$!y]
EndHandle
Enddo
endfunction
I'm not in front of PDMS at present (can't afford the software at home)... So I can't check
this... Check this in a limited area before running.....
Define Function !!APMCheckLevel()
var !PRZone coll all Zone with (Match (Name of Zone, 'PREM') gt 0) for ce $* I like Match
instead of Matchwild
Do !z values !PRZone $* Used Values instead of Index...
$!z
!NewName = !z.Before('PREM') + 'PRELIM' $* Will take current name z, strip off PREM, and
add PRELIM
Rename $!NewName
$p $!z renamed to $!NewName $*Just Prints the old and new to command line
EndDo
EndFunction
Quote:
Hi JCont20
The GTYPE macro is brilliant...one of my colleuges was just talking about that discrepancy the
other day...
Would it be much mor ework to actually correct that discrepancy ?
SURE, YOU CAN FIX IT. I HAVE A SCHEDULE TASK THAT TAKES CARE OF IT FOR THE USER.
WORKS SOMETHING LIKE THIS.
Code:
!Coll is array of sections's and gensecs's names whose gtype not equal gtype of catref. It is
collection from current element ($!!CE).
Coll - you are right, this is command to make collection and to store it in array !Coll.
$!!CE gives reference number of CE.
$P $!Coll[$!x] - in [] number of array's element is indicates, in this case $!x is number of
current cycle of the loop.
Alright, Sorry I have been gone for so long, I have been extremely busy like everyone else in
the PDMS community.
Here is a small simple macro to using a do loop.
Multiple copy command for draft
Code:
Hello!
Im a newbie and Im trying to make a loop that collects the names of all sheets in a specific
regi and writes them to a logfile. Can anybody tell me what im doing wrong?
/PIPELAYOUT/
var !sheename collect all SHEE for REGI
!File = object file('C:/Plots/names.log')
!Array = object Array()
var !sheename collect all SHEE for REGI
do !i INDEX !sheename
VAR 1 NAME
$!Array.Append($V1)
enddo
!File.writefile('overwrite',!Array)
The array dont seem to be accessible inside the do loop
Change " $!Array.Append($V1)" to "!Array.Append(V1)" and you should be OK.
Thanks for the quick response. But it didnt work. Quite confusing with all the $ !. This is my
code at the moment
ONERROR CONTINUE
/PIPELAYOUT/
!File = object file('C:/Plots/names.log')
!Array = object Array()
var !sheename collect all SHEE for REGI
do !i INDEX !sheename
VAR 1 NAME
!Array.Append(V1)
enddo
!File.writefile('overwrite',!Array)
Slight modification then. Change your do-loop to this:
do !i INDEX !sheename
!name = name
!Array.Append(!name)
enddo
thanks
I thank for all this kind of posts, because i'm getting startiing in PML and it's very usefull to
get this info...
Quote:
/PIPELAYOUT/
!File = object file('C:/Plots/names.log')
!Array = object Array()
var !sheename collect all SHEE for REGI
do !i INDEX !sheename
VAR 1 NAME
!Array.Append(V1)
enddo
!File.writefile('overwrite',!Array)
unless I am very much mistaken (and I could be) as you havent navigated to the sheet name
the var 1 name will always be the same.
Personally I would do it this way (its a bit more PML2 like as well)
!Coll = !!collectallfor('shee','',!!ce) - assuming you are at the Regi
Do !A indices !Coll
!Array.append(!Coll[$!A].name)
*and of course at this point I cant recall if its
].name)
or
].name()) - old age!
Enddo
that way you dont navigate (as you dont need to)
!File.writefile('overwrite',!Array)
Matt
u are not misstaking. Ive added another row to the code $!SHEENAME[$!i].
I must say your solution looks better but mine works.
Thanks anyway
hELLO EVERYONE
I'm Having trouble with a usefull macro (for me) wich is intended to change an
attribute to all the elements for (inside) the ce. The arguments of this macro are:
$1 = type of elements that are going to be changed
$2 = the attribute that is going to be changed
$3 = the new value of the attribute
the idea is, if i need to change the section's justification line inside the ce (a framework) i
write:
$m membs sctn jusl tos
if i need to change the specification of the sections i write:
$m membs sctn spref /icha/H_300x200
$*
$*
$*
$*
$*
$*
$*
PRETENDE HACER UNA MACRO QUE CAMBIE UN ATRIBUTO A TODOS LOS ELEMENTOS
$1 DEL CURRENT ELEMENT.
$1 = TIPO DE ELEMENTOS EN LOS QUE APLICA LA MACRO
$2 = ATRIBUTO
$3 = VALOR DEL ATRIBUTO FINAL
i HAVE TRIED WITH THE ALTERNATIVES THAT YOU SHOW HERE LIKE
Quote:
$*
$*
$*
$*
$*
$*
PRETENDE HACER UNA MACRO QUE CAMBIE UN ATRIBUTO A TODOS LOS ELEMENTOS
$1 DEL CURRENT ELEMENT.
$1 = TIPO DE ELEMENTOS EN LOS QUE APLICA LA MACRO
$2 = ATRIBUTO
$3 = VALOR DEL ATRIBUTO FINAL
$*
!COLECCION = !!COLLECTALLFOR('$1','',!!CE)
$* ALMACENA EN !y LOS INDICES DE "COLECCION"
DO !Y INDICES !COLECCION
$* SE SITUA EN EL ELEMENTO QUE SE DESEA CAMBIAR
!COLECCION[!Y].$2 = $3
$* CONTROL DE ERRORES,
HANDLE ANY
$* MUESTRA UN MENSAJE DE ERROR EN LA LINEA DE COMANDOS
$PERROR ON $!COLECCION[$!Y]
ENDHANDLE
ENDDO
BUT IT DIDN'T WORK... I THINK THAT IS BECAUSE THE CE IS A FRMW AND THE SENTENCE "!
COLECCION[!Y].$2 = $3" TRY TO CHANGE THE ATTRIBUTE TO THE FRMW INSTEAD OF THE
SCTN (I HAVE PROVED WITH "!COLECCION[!Y].JUSL = TOS" TOO)... am I right?
WOULD YOU HELP ME, PLEASE?
Christiansen,
try this....
Code:
!ATTRIBUTE = $2
!COLECCION = !!COLLECTALLFOR('$1','',!!CE)
DO !Y INDICES !COLECCION
!COLECCION[!Y].$!ATTRIBUTE = $3
HANDLE ANY
$PERROR ON $!COLECCION[$!Y]
ENDHANDLE
ENDDO
i've tried with your code but it returns an error (i.e. if i try to change all the sections in a
framework, i have to be in the framework, so, the program return line 1 !ATTRIBUTE = $2 and
a message: "a framework does not have attribute jusl")
thanks
Thats right, its a string
Code:
!ATTRIBUTE = '$2'
it works...
the final program is
Quote:
!ATTRIBUTE = '$2'
!COLECCION = !!COLLECTALLFOR('$1','',!!CE)
DO !Y INDICES !COLECCION
!COLECCION[!Y].$!ATTRIBUTE = $3
HANDLE ANY
$PERROR ON $!COLECCION[$!Y]
ENDHANDLE
ENDDO
one consideration is to specify the third argument ($3) as string when it's necesary, por
example
If you want to change all the JUSL of the sections in a framework you type:
$M /memb sctn jusl 'tos'
where:
sctn is the type of the element you want to change
jusl is the attribute you want to change and
'tos' is the new value of the attribute... in this case marqued between ' ' because is a text
If you want to change all the spref of the sections in a framework you type:
$M /memb sctn jusl /ICHA/H_300x200
and the new spref value without the ' ', because it's not a string
I forgot ..
memb is the name of the file who contais the macro
(i explain this because someone could need it and don't know what i'm talking about)
thanks a lot for your help
i will keep on disturbing your tra=nquility ;-)
Just a suggestion, add a handle to take care of it...
Code:
!ATTRIBUTE = '$2'
!COLECCION = !!COLLECTALLFOR('$1','',!!CE)
DO !Y INDICES !COLECCION
!COLECCION[!Y].$!ATTRIBUTE = $3
HANDLE (2,794)
!COLECCION[!Y].$!ATTRIBUTE = '$3'
ELSEHANDLE ANY
$PERROR ON $!COLECCION[$!Y]
ENDHANDLE
ENDDO
hello guys
i need to rename all branches for given pipe
how should i start for this query?
thx for your support, let me explain my problem
this is old line number
pipe: /2"-24-1512-A1A-520-A01
BRANCH NAME :/2"-24-1512-A1A-520-A01/B1
/2"-24-1512-A1A-520-A01/B2
/2"-24-1512-A1A-520-A01/B3....
NOW MY LINE NO CHANGES TO
PIPE :/2"-24-2500-A1A-520-A01
SO I WANT TO CHANGE MY BRANCJ NAME TO
BRANCH NAME :/2"-24-2500-A1A-520-A01/B1
/2"-24-2500-A1A-520-A01/B2
/2"-24-2500-A1A-520-A01/B3
IT LIKE WHEN YOU TRY TO RENAME PIPE NAME BRANCH NAME SHOULD AUTOMATICALLY
CHANGE AS PER FEED DATA.
I HOPE THIS WILL CLEAR IDEA OF VIEWER
Code:
Brackets ()
*/
+EQ, NEQ, LT, LE, GE, GT
NOT
AND
OR
Now, when writing an expression, think back to high school math or even middle school
math when you learn how to solve nested expressions.
(4 * (POWER(PARA[1], 2) + POWER(PARA[2] , 2) )
You have several different types of expressions:
Logical expressions
PDMS attributes
Logical constants
TRUE, ON, YES for true
FALSE, OFF, NO for false
Logical Operators
Conparator operators (EQ, NEQ, LT, GT, LEQ, GEQ)
Boolean operators (NOT, AND, OR)
Logical functions
BADREF
DEFINED, UNDEFINED
CREATE
DELETED
EMPTY
MATCHWILD
MODIFIED
UNSET
VLOGICAL
PDMS attributes
Ex: XLEN YLEN POHE POSITION ORIENTATION
Numeric operator
+ Add
- Subtract
* Multiply
/ Divide
Numeric function
I'm not going to list all of them but some of them are:
ABS, ACOS, ASIN, ATAN, SIN, COS, TAN, MATCH, MAX, SQRT..
Real expressions
See numeric funtions
Real array expressions
Text expressions
A text string
PDMS attributes
Text operators
Text fuctions
__________________________________________________ _________________
Ok, lets start creating some If statements using some of this expressions. This is an example
I like to use a lot.
When users descover that they can create sctns using syntax, sometimes they forget to
change all the attributes. One of those attributes will be the GTYPE. So a simple expression
will be:
!Catref = Gtype of Catref
!Sctn = Gtype of Sctn
If (!Catref neq !Sctn) Then
Gtype $!Catref
Handle any $* I try to add a handle anywhere I think I might have a problem, in
this case, the section could be claim
EndHandle
Else
$PSctn has correct Gtype
EndIf
The If statements can get nasty, here is a simple one.
If !!CE.Type.Eq('PIPE') or !!CE.Type.Eq('STRU') or !!CE.Type.Eq('EQUI) Then
or
If ((Type of CE eq 'PIPE') or (Type of CE eq 'STRU') or (Type of CE eq 'EQUI')) Then
Its, getting late and my wife is ready to use the computer. If anyone has any
request or question, please ask. I'll continue this tomorrow.
I tend not to use the !!ce as you have to navigate to it within PDMS, I find it safer to create
say an array of items (which will be dbrefs) then query or assign accordingly e.g.
$* assign some variables
!File = object file('%pdmsuser%/log/logfile.log')
!Array = object Array()
$* collect some items
!Coll = !!collectallfor('elbo','',world)
$* action the collection
Do !A indices !Coll
If (!Coll[$!A].catref.upcase() ne 'XXXX') then
$P we missed this one -- $!Coll[$!A]
!Array.appned(!Coll[$!A].name)
Else
some other action
Endif
Endoo
$* see if we found any data errors, if so output to a file and advise user
If (!Array.size() gt 0)thne
$P we have an out put error/log file
!File.writefile('overwrite',!Array)
Else
$P it all went well
Endif
$* get user to acknowledge the macro has finished
!!Alert.message('You have now finished')
Hello,
I'm a new PDMS/PML user, I'm just learning.
Can anybody help me in macro writing?
I would like to make a macro in PML1, which is counts the valves and elbows in a current site
and write the result in a file.
I try to make it since two days, but it isn't works.
Please help me, if you can ...
I'd use the inbuilt "collect" function
!Valve = !!collectallfor('valv','',!!ce) --- !!ce ==> ce, in this case the site you want to collect
valves from
!Elbow = !!collectallfor('elbo','',!!ce) --- !!ce ==> ce, in this case the site you want to collect
elbows from
!ValveSize = !Valve.size()
!ElbowSize = .......
Do the same for other components then create an array
!Items[1] = ('number of valves ' & !ValveSize)
!Items[2] = ('number of elbows & !ElbowSize)
etc
!File = object file('%pdmsuser%/filename.out')
!File.writefile('overwrite',!Items)
If you want to do it for a number of sites then collect the sites into an array
e.g. !Sites = !!collectallfor('site','',world)
and create a do loop
Do !A indices !Sites
$!Sites[$!A]
<the do the collection above>
<write to the file - !File.writefile('append',!Items)
Enddo
But why not just use the Reports facility.
Quote:
and next:
var !collname eval name for all from !coll
(for evaluate name of all of previous list)
Why not
!C = object collection()
!C.scope(!!ce)
!C.filter( object EXPRESSION( 'true' )
!C.type('ELBO')
!Names = object ARRAY()
!Dbrefs = !C.results()
do !Dbref values !Dbrefs
!Names.append(!Dbref.flnm)
enddo
Few more lines but much better code
I agree that PML2 style is good for peoples who already familier with the other programming
language, and I know that it is mandatory to know PML2 with PDMS 12 .net programming.
If everybody satisfy with current condition, it is fine.
But, I believe that if nobody complain about bad thing with PDMS, it will never be improved.
Everybody should know that if the PDMS user is waiting for 10 sec. macro processing time, he
will do nothing, just wait for the operation is done.
You'll see what will happen if this operation is iterrated many times , done by many peoples,
every day.
Anyway, now we have PDMS 12... We can use Visual Studio for customization. Many of
problems will be disappeard.
Hope to see the world we don't need "variable" command anymore.
I tired to explain both PML1 and PML2 commands in my training course...
11-14-2007
11-14-2007
Back to basic;
Useful function
defined(!variable) returns (boolean) true if the variable is defined.
"defined" means the variable has any value, or "unset" value.
undefined(!variable) returns opposite value to defined()
set(!variable)
----returns if the variable has non "unset" value.
unset(!variable)
----returns opposite value to set().
set() and unset() is also available as method style.
You can say;
!variable.set()
!variable.unset()
The "defined" value is the same status just after you declare a variable.
PDMS variable has intermidiate condition before you load concreate value to the variable. This
status will be called as "defined".
Once the variable is defined, you can check the variable has cocreate value (not an unset
value" by using set()/unset().
try the following examle to see the result.
----Start---------------------------!result = defined(!variable)
$P Not yet defined-result of defined = $!result
!result = undefined(!variable)
$P Not yet defined-result of undefined = $!result
!variable = object string()
!result = defined(!variable)
$P Defined-result of defined = $!result
!result = undefined(!variable)
$P Defined-result of undefined = $!result
!result = set(!variable)
$P Defined but has no value -result of set = $!result
!result = unset(!variable)
$P Defined but has no value -result of set = $!result
!variable = |ABC|
!result = set(!variable)
$P Defined and has value -result of set = $!result
!result = unset(!variable)
$P Defined and has value -result of unset = $!result