pml basics

Upload: ese-ichekor

Post on 02-Jun-2018

334 views

Category:

Documents


19 download

TRANSCRIPT

  • 8/10/2019 PML Basics

    1/33

    PML Basics Part 1 - 10-25-2006

    Alright expert and cvitte71,I did promise to get more involve with pdmsworld. So here we go. I will start adding newthread or those who want to learn !"#, starting with the $asics %!"# 1& wor'ing m( wa( to!"#2, orms, )nctions, (o) get the idea.

    *o start o)t, I wanted to introd)ce the +ollar s(m$ol and its meanings----------------------------------------------------------" )ns a macro in pdms/ val)ate a varie$le. *erminates a macroS +eines a s(non(m +eines a glo$al s(non(m

    S- *)rns s(non(ms oS *)rns s(non(ms 3n4S 4)ear(s the s(non(ms elp4 Another s(ntax help! !rints a line to (o)r command line Adds a s(m$ol

    + +ea)lt arg)ment val)e

    8omment line% Starts a comment $loc'& nds a comment $loc'

    *o t)rn the pml trace on and o I )se------------------------------------------ *o t)rn trace 36 *o t)rn trace 3n %+e$)g mode 9 )sed to ta'e !+"S orm name&102 *)rn trace 3n with more details

    !"# $)ilt-in help in several wa(s--------------------------

    show //pml:rowsershow //pml;orms//!ml+einition %;orm

  • 8/10/2019 PML Basics

    2/33

    A ?)er( on )sage in the ield how m)ch do (o) )se the comments %either or %...& &>

    %;or those o (o) at the ISI*s this is to do with !)$lished !"#...&

    I want to $e a$le to strip comments when p)$lishing the !"#, and am wondering B)st howm)ch tro)$le to go to with wierdl( nested and hidden comments/ %I will never manglean(thing, $)t might not strip all the comments i (o) do reall( odd things&

    I )se the comments as m)ch as possi$le. Speciall( $eca)se Im the 'ind o person who willwrite a macro and orget a$o)t it and 6 months later someone is as'ing me to add some new)nction to the macro. I tr( to add as m)ch comments or m( own personal $eneit.I (o) are new to pml and (o) want to ma'e lie easier. I s)ggest (o) tr( to comment as m)chas possi$le. Also, name (o) macros something that will ma'e since 6months to even (earsrom now. I have spend ho)rs, da(s even months writing macros onl( to misplace them. :(

    adding as m)ch comments, (o) are not onl( ma'ing (o)r lie easier $)t (o)r emplo(eer aswell. *his go $ac' to the ISI* meeting.

    C8ont....mate its simpl( awesome.....ver( )se)l...please 'eep it )p/....

    I rec'on $etter add the A#!A #3 command...where (o) can ta'e )r logs to a ile and notlood )r command line &

    ---------------------------------------------------------------------------------------------------------------------@es I agree.

    Dhen )sing the *rac'ing, (o) might want to )se the alpha log command irst. *r( this.

    Alpha log /C:/test.txt over:( adding the over, I am overwriting an( ile with the name *est.txt

    *)rn trace on$R

    *han, )sing the p)ll downsMo!i"# %a&e

    *he modi( name orm will come )p and (o)r command line illed with text.$R*o t)rn o the *race

    Alpha log e'!*o end the log

    3pen the .txt ile and chec' o)t some o the code. *hat is how I learn pml, $( reading avevascode.

    C)st a note @o) are onl( allowed to have one log ile open at the time. Another option will $eto )se Alpha ;iles. Ill get to that later.

    I B)st o)nd this and I wanted to pass it on....nBo(

    EnF

    1 *racing to shell window %dea)lt&2 *racing to re?)ests window

  • 8/10/2019 PML Basics

    3/33

    G *racing o onl( inp)t lines exec)tedH *racing o all inp)t lines16 *racing witho)t expresion %dea)lt o&2 *racing incl)des line n)m$ers6G *racing o macroJ)nction changes100 eneral +e$)gging102 capt)re trace in A#!A #3

    8an also do at the command line to get all options or

    ---------------------------------------------------------------------------------------------------------------------4)ote

    3riginall( !osted $( (i&)harroc*A query on usage in the field: how much do you use the $ comments (either $* or $(...$) )?

    (For those of you at the ISI!s this is to do with "u#lished "%...)

    I want to #e a#le to stri& comments when &u#lishing the "%' and am wondering ust howmuch trou#le to go to with wierdly nested and hidden comments (I will neer mangle

    anything' #ut might not stri& all the comments if you do really odd things)

    ello *im,

    I )se % and & or large $loc's o comments or or ?)ic' tro)$le shooting. :)t or individ)allines o code J comments, I will normall( )se -- $eca)se I do not need to hold down the SI;*'e( to get the -- to appear %?)ic'er commenting or single lines&.

    ;rom (o)r personal opinion, is there a preerence $etween and -- > +oes one single-linecommenting method wor' $etter than the other> C)st c)rio)s ...

    ave a :lessed +a(

    I I do not remem$er wrong, (o) cannot )se -- or inline comments where (o) can )se the s(ntax.

    li'ehandle an( *a'ing care o a pro$lem. I I remem$er correctl( (o) cannot do this with --endhandle

    I recall reading somewhere that -- can onl( $e )sed or commenting whole lines.

    =====================================================================

    4)ote

    3riginall( !osted $( (Bac*If I do not remem#er wrong' you cannot use ++ for inline comments where you can use the $*

    synta,.

    (es that is the case.

    4)ote

    3riginall( !osted $( prover+s,:From your &ersonal o&inion' is there a &reference #etween $* and ++ ? -oes one single+linecommenting method wor #etter than the other? /ust curious ...

  • 8/10/2019 PML Basics

    4/33

    at the start o the line the( are treated identicall(, so no preerence

    *his is the macro I am )sing to test comments so ar - I have lots more odd things to add/

    8ode

    $P this macro tests comments in various formats

    $* $P this is an ordinary one-line comment$P this line is not a comment-- $P this is a new-style comment$P this line is not a comment either$( $P a short 'multi-line' comment $)$P I am not a comment - I am a free line!$($P a long multi-line comment$P yes, I mean it$)$P now to test some combinations$P start a new-style -- in the middle of a $P$P start an old-style $* in the middle of a line

    $P embed a multi-line $(lie this$) in the middle of a line$P try hiding a multi-line with old-style$* $($P I wonder if this will come out$* $)$P try hiding a multi-line with new-style-- $($P I wonder if this will come out instead-- $)$ what about the end of a multiline"$($P this is within a multi-line$* $)

    $P this is after a hidden closer

    $P this is at the end

    I didnt 'now I co)ld comment o)t part o a line with the . //

    awesome///

    (#%)

    *hat is the $ea)t( o )sing the comment s(ntax. @o) canwrite them on the same line as the act)al code.

    i gentlemen,

    I am )sed to r)n a macro loaded with m( avo)rite s(non(ms when I start !+"S. So I tried to)se the command 4S as I saw it in the irst post.

  • 8/10/2019 PML Basics

    5/33

    *here are s(non(ms with S1 $eore the s(non(m description. xample

    S1 AA add all within vol) ce S1

    *hen I have here s(non(ms with S0 %all m( s(ns some more&. xample

    S0 ;; new la choo all new gas' choo all new la choo all %short se?)ence or inserting pairo langes&

    And then inall( there are some s(non(ms with SK1 or r)nning a macro. xample

    SK1 8A## "JL!+"SKILJ+SJ4KIJS1

    I dont )nderstand the dierence $etween S0, S1, SK1. Is it s)pposed to $e an arg)ment>Are not arg)ments in general n - witho)t S> Dhat does it act)all( do> And wh( it sa(s

    %G7,& 8! Illegal macro ormat

    Dhen I tr( to r)n the macro or m(sel %in this case "JL!+"SKILJ+SJ4KIJS1 &>

    3ne ?)estion...

    Dh( MM and M--M are not e?)ivalent>

    MM wor's an( position in the line, and M--M wor's onl( at the $eggining o the line.

    Dh( A==A designed the comment li'e that> An( reason>

    !ossi$le to )se 5 J;I#.name

  • 8/10/2019 PML Basics

    6/33

    PML Basics Part Creati'g a' Arra# - 10-25-2006

    Dhat is an Arra(>*he simple answer to me wo)ld $e a collection.

    ow to create an Arra(

    0Arra# Arra#*his is an empt( varia$le $)t it has $een deined as an arra(

    Adding to the arra(*(pe 10Arra#213 4B5B40Arra#23 46E5R6E40Arra#2,3 47ELL84

    *(pe 20Arra#.Appe'!4B5B4

    0Arra#.Appe'!46E5R6E40Arra#.Appe'!47ELL84

    9 var 0Arra#

    3ther 8ommand to 'now when )sing an arra(

    /Arra(.8lear%&/Arra(.SiNe%&/Arra(.Sort%&/Arra(.SortKni?)e%&/Arra(.Kni?)e%&

    8o ca' "i'! ot &ore i' the P;M) Ma'al< )earch Arra# 5+=ects.

    wats the dierence $etween t(pe1 and t(pe2......sorr( am B)st starting to learn !"#..soorgive me i im as'ing s)mthing verr(( $asic/

    Also I was thin'ing i ) can p)t some treads with examples......li'e

    1. ow can we assign val)es to elements )sing !"#...e.g. I I have to assign pspec JA00 *3A## !I!S DI* :3 SIO 100

    2. ow do we collect elements and r)n a macro on them...e.g. collect A## $rances )nderNone J10#A: and setJchange Ispec to J8

  • 8/10/2019 PML Basics

    7/33

    and so on.....

    Dhat is the dierence $etween t(pe1 and t(pe2.

  • 8/10/2019 PML Basics

    8/33

    ar !-ae" ea#ate (-ae) /or a## /ro !Ppe"

    !Ne0Po"to-" = !-ae".'orted-dce"()

    !-ae"."ort()

    ar !%o-e" ea#ate (-ae o/ %o-e) /or a## /ro !Ppe"

    ar !p"pe" ea#ate (p"pe) /or a## /ro !Ppe"

    ar !"pe" ea#ate ("pe) /or a## /ro !Ppe"

    ar !"tat" ea#ate (:"tat") /or a## /ro !Ppe"

    !%o-e".Re-dex(!Ne0Po"to-")

    !p"pe".Re-dex(!Ne0Po"to-")

    !"pe".Re-dex(!Ne0Po"to-")

    !"tat".Re-dex(!Ne0Po"to-")

    do !Ppe -dex !Ppe"

    !record = !-ae"1!Ppe2 + |$!xTab| + !%o-e"1!Ppe2 + |$!xTab| + !p"pe"1!

    Ppe2 + |$!xTab| + !"pe"1!Ppe2 + |$!xTab| + !"tat"1!Ppe2

    !otpt.appe-d(!record)

    e-ddo!/#e = object 34E(56P7M'"er68$!MyProj9Ppe4"t.txt*)

    !/#e.0rte/#e(5OER;RTE*

    $p

    $p Macro /-"ed

    Resulting sample output of PML report (623records:PPE ,ONE P'PEC 'PEC :'T&TU'

    >?@A7?BD?A???FDAGHADDD? >PPA?BDDDAB? >???FDAGH =D>D ?

    >?@AR?BIDDIA??DFAR >PPA?BDDDA34&RE >???FDAGH =D>D ?

    >?@AR?BIDDA??DFAR >PPA?BDDDA34&RE >???FDAGH =D>D ?

    >?D@AK?BIDD?A??FDAG?ADDD?A? >PPA?BDDDA34&RE >??FDAG? =D>D ?

    >?D@AK?BIDDIA??FDAG?ADDD?A? >PPA?BDDDA34&RE >??FDAG? =D>D ?

    >?D@AK?BIDA??FDAG?ADDD? >PPA?BDDDA34&RE >??FDAG? =D>D ?

    >?D@AK?BIDLA??FDAG?ADDD? >PPA?BDDDA34&RE >??FDAG? =D>D ?

    PML2 with code for selected pipeattribute output:!Project = CURRENT PROJECT

    !MyProj = !Project.code()

    $p

    $p Project: $!MyProj

    $p

    !T0#d = ||

    !xTab = | |

  • 8/10/2019 PML Basics

    9/33

    !otpt = object &RR&()

    !xRec = |*PPE| + |$!xTab| + |,ONE| + |$!xTab| + |P'PEC| + |$!xTab| + |

    'PEC| + |$!xTab| + |:'T&TU'*|

    !otpt.appe-d($!xRec)

    !Co##ect = object CO44ECTON()

    !Co##ect."cope(;OR47)

    !Co##ect.type(5PPE*)

    !Co##ect.expre""o-(object EPRE''ON(5'UK'TR(N&ME

  • 8/10/2019 PML Basics

    10/33

    >?@AR?BIDDA??DFAR >PPA?BDDDA34&RE >???FDAGH U-"et ?

    >?D@AK?BIDD?A??FDAG?ADDD?A? >PPA?BDDDA34&RE >??FDAG? U-"et ?

    >?D@AK?BIDDIA??FDAG?ADDD?A? >PPA?BDDDA34&RE >??FDAG? U-"et ?

    >?D@AK?BIDA??FDAG?ADDD? >PPA?BDDDA34&RE >??FDAG? U-"et ?

    >?D@AK?BIDLA??FDAG?ADDD? >PPA?BDDDA34&RE >??FDAG? U-"et ?

  • 8/10/2019 PML Basics

    11/33

    PML Basics Part , Creati'g a Loop - 10-26-2006

    ere we go again. 3)t o ever(thing that I have learn a$o)t pml, I had the most diic)lt(learning #oops. I didnt )nderstand them, inall( ater man( mista'es I got a handle on loops.

    Dhat is a loop>ItPs a series o commands that will contin)e to happen )ntil the loop is $ro'en.

    ;o*his starts a loop, now one o m( irst mista'es was that I didnt speci( the n)m$er o times Iwanted the loop to r)n and I didnt 'now how to $rea' the command

    E'!!o;or ever( M+oM (o) m)st have an MnddoM

  • 8/10/2019 PML Basics

    12/33

    ! /8ollR/x has the wrong t(penddo

    or

    +o /x val)es /8oll! /x has the wrong t(pe

    nddo

    @es *han' (o) $h0nst. Teep them coming.

    Dhen (o) )se the

    ;o 0x i'!ices 0Coll/U is still a n)m$er

    :)t when (o) )se

    ;o 0x vales 0Coll/x is now the item or an element

    "ore examples, this is a re?)est $( P;M)

    1. ow can we assign val)es to elements )sing !"#...e.g. I (o) have to assign pspec JA00*3 A## !I! DI* :3 SIO 100

    ;irst, @o) have to do a collection or all !ipe with $ore e? 100. Again, cvitte71 has a greatthread on collections going on.

    ar 0PDPE C5LL ALL PDPE D(H PARAM213 5F CA(REF 5F )PC5 EQ 1GG F5R $00CE

    ;o 0x i'!ices 0PDPE

    $0PDPE2$0x3P)PEC /A,GGHa'!le A'# $ h# !i! D a!! a Ha'!le< the pipe col! o" +ee' clai& or loc*e!< this>a# the &acro >ill co'ti'e$pError o' $0PDPE2$0x3 $Pri'ti'g the error so D ca' i!e'ti"# the ele&e't that thepspec >as 'ot assig'e!E'!Ha'!leE'!!o

    2. ow do we collect elements and r)n a macro on them...e.g. collect A## $rances )nderNone J10#A: and setJchange Ispec to J8

    ar 0BRA%CH C5LL ALL BRA% F5R /1GLAB

    ;o 0# i'!ices 0BRA%CH$0BRA%CH2$0#3Dspec /HCHa'!le a'#$pError o' $0BRA%CH2$0#3E'!Ha'!leE'!!o

  • 8/10/2019 PML Basics

    13/33

    Are (o) going to examine 3:C8*S, especiall( the 83##8*I3< 3:C8*. And the )se o thiso$Bect> #i'e (o) pointed o)t in (o)r thread, the other collections thread explores m)ltiplewa(s to create the collection )sing $oth !"#1 and !"#2. =er( intri?)ing. *he m)ltiplicities ooptions in )sing !"# can $e da)nting.

    --------------------------------------------------------------------------------------------------@es, Ill start getting more into o$Bect collect V o$Bect collections. ere is another example)sing a dierent t(pe o collection

    0BRA%CH 00CollectAllFor4BRA%4< 44< 00CE

    ;o 0# i'!ices 0BRA%CH$0BRA%CH2$0#3Dspec /HC

    Ha'!le a'#$pError o' $0BRA%CH2$0#3E'!Ha'!leE'!!o

    P;M)6r

  • 8/10/2019 PML Basics

    14/33

  • 8/10/2019 PML Basics

    15/33

    /

  • 8/10/2019 PML Basics

    16/33

    /U in this case, U is a reerence n)m$er

    +o /x indice /coll/U in this case, U is a n)m$er %1,2,, (o) get the point&

    ope this help, sorr( it too' me so long, I have $een o)t o the co)ntr( and extreaml($)s(...:)t I g)ess ever(one is $)s( now and da(s...

    i Im new in the or)m and I hope some$od( can help me $eca)se I want to ma'e an arra(chec'er, that compare ever( element o the arra( and delete the elements repeated rom thearra(.

    ##3,there is especial commands or wor' with arra(s in the !+"S man)als.(o) can )se MK

  • 8/10/2019 PML Basics

    17/33

    8o)ld an(one tell me i im correct on m( ass)mptions..

    *o $rea' down the irst line...

    var /8oll - this deines a local o$Bect o this name

    coll - is this a commmand to ma'e a collection >

    //8 - this is a glo$al o$Bect o this name

    ! /8ollR/x has the wrong t(pe - what do the s?)are $rac'ets do R >

    *han's or the help...ne unction !!9ultioy()

    !& urrent &essionIf !&59odule()52.('06+') hen return2nddo

    !element !!ce0o ew $!2lement5ye coy rev =n I0 ? ;andle +ny refresh

    return 2nd;andle2nddo

    2ndunction

    ello/Im a new$ie and Im tr(ing to ma'e a loop that collects the names o all sheets in a speciic

  • 8/10/2019 PML Basics

    18/33

    regi and writes them to a logile. 8an an($od( tell me what im doing wrong>

    J!I!#A@3K*J

    var /sheename collect all S or I

    /;ile o$Bect ile%8J!lotsJnames.log&

    /Arra( o$Bect Arra(%&

    var /sheename collect all S or Ido /i I

  • 8/10/2019 PML Basics

    19/33

    "I"%A@2!

    File 6 o#ect file(7>:"lotsnames.log7)Array 6 o#ect Array()

    ar sheename collect all S8 for 0Ido i I3-B sheenameCA0 D 3AArray.A&&end(CD)enddoFile.writefile(7oerwrite7'Array)

    )nless I am ver( m)ch mista'en %and I co)ld $e& as (o) havent navigated to the sheet namethe var 1 name will alwa(s $e the same.!ersonall( I wo)ld do it this wa( %its a $it more !"#2 li'e as well&

    /8oll //collectallor%shee,,//ce& - ass)ming (o) are at the egi+o /A indices /8oll/Arra(.append%/8ollR/A.name&

    and o co)rse at this point I cant recall i its.name&or.name%&& - old age/

    nddo

    that wa( (o) dont navigate %as (o) dont need to&

    /;ile.writeile%overwrite,/Arra(&

    "att

    ) are not missta'ing. Ive added another row to the code /S

  • 8/10/2019 PML Basics

    20/33

    so, this is s)pposed a m)lti)nction macro -&

    this is m( code %$ased on whats exposed here&

    4)ote

    !*

  • 8/10/2019 PML Basics

    21/33

    /83#88I3< //83##8*A##;3%1,,//8&

    A#"A8

  • 8/10/2019 PML Basics

    22/33

    !+6I@72 '$A'

    it wor's...

    the inal program is4)ote

    /A**I:K* 2

    /83#88I3< //83##8*A##;3%1,,//8&+3 /@ I

  • 8/10/2019 PML Basics

    23/33

    !=

  • 8/10/2019 PML Basics

    24/33

    1) Pipe form macro

    These file contain pipe form which will create a pipe as per project set-up (admin have to define)

    & simultaneously set attributes :lsize duty :lproc :lsno Pspec Ispec Tspec :Areacode :lsuf :Isoref:Mtoref :Mtodrwg :Mtoarea

    As per project philosophy

    Procedure:

    Go to respective zone clic !new pipe"button then feed the value & then apply

    #f insulation or tracin$ spec if not defined in line number don"t leave blan put !unset"

    & if insulation or tracin$ spec is defined put spec name followin$ forward slash !%"

    or e'$'

    T*T T+, A./

  • 8/10/2019 PML Basics

    25/33

  • 8/10/2019 PML Basics

    26/33

    PML Basics Part I Expressio's a'! DF state&e'ts

    Dell, I have coved Arra(s and #oops.

  • 8/10/2019 PML Basics

    27/33

    + Add

    - Subtr!t" #u$t%&$'

    D%%d*

    here D thi'* D &ight have a pro+le&< i'this case< the sectio' col! +e clai&E'!Ha'!leElse$P)ct' has correct 6t#peE'!D"

    *he I statements can get nast(, here is a simple one.

    D" 00CE.(#pe.E94PDPE4 or 00CE.(#pe.E94)(R4 or 00CE.(#pe.E94EQD (he'

    or

    D" (#pe o" CE e9 4PDPE4 or (#pe o" CE e9 4)(R4 or (#pe o" CE e9 4EQD4 (he'

    Dts< getti'g late a'! >i"e is rea!# to se the co&pter. D" a'#o'e has a'#re9est or 9estio'< please as*. D4ll co'ti'e this to&orro>.

  • 8/10/2019 PML Basics

    28/33

    I tend not to )se the //ce as (o) have to navigate to it within !+"S, I ind it saer to createsa( an arra( o items %which will $e d$res& then ?)er( or assign accordingl( e.g.

    assign some varia$les/;ile o$Bect ile%Lpdms)serLJlogJlogile.log&/Arra( o$Bect Arra(%&

    collect some items/8oll //collectallor%el$o,,world&

    action the collection+o /A indices /8ollI %/8ollR/A.catre.)pcase%& ne UUUU& then! we missed this one -- /8ollR/A/Arra(.appned%/8ollR/A.name&lsesome other actionndindoo

    see i we o)nd an( data errors, i so o)tp)t to a ile and advise )serI %/Arra(.siNe%& gt 0&thne! we have an o)t p)t errorJlog ile/;ile.writeile%overwrite,/Arra(&lse! it all went wellndi

    get )ser to ac'nowledge the macro has inished//Alert.message%@o) have now inished&

    ello,Im a new !+"SJ!"# )ser, Im B)st learning.8an an($od( help me in macro writing>I wo)ld li'e to ma'e a macro in !"#1, which is co)nts the valves and el$ows in a c)rrent siteand write the res)lt in a ile.

    I tr( to ma'e it since two da(s, $)t it isnt wor's.!lease help me, i (o) can ...

    Id )se the in$)ilt McollectM )nction

    /=alve //collectallor%valv,,//ce& --- //ce F ce, in this case the site (o) want to collectvalves rom/l$ow //collectallor%el$o,,//ce& --- //ce F ce, in this case the site (o) want to collectel$ows rom/=alveSiNe /=alve.siNe%&/l$owSiNe .......

    +o the same or other components then create an arra(/ItemsR1 %n)m$er o valves V /=alveSiNe&/ItemsR2 %n)m$er o el$ows V /l$owSiNe&etc

    /;ile o$Bect ile%Lpdms)serLJilename.o)t&/;ile.writeile%overwrite,/Items&

  • 8/10/2019 PML Basics

    29/33

    I (o) want to do it or a n)m$er o sites then collect the sites into an arra(e.g. /Sites //collectallor%site,,world&

    and create a do loop

    +o /A indices /Sites

    /SitesR/AEthe do the collection a$oveFEwrite to the ile - /;ile.writeile%append,/Items&nddo

    :)t wh( not B)st )se the eports acilit(.

    4)ote

    3riginall( !osted $( csigs?!han you att

    (I can do it with re&ort facilities' #ut I7d lie to learn the "% &rogramming)

    !hans again

    %Eri

    Seems air. In the /;ile.writeile%& part (o) have the option to either overwrite or append. I Iwas )sing a +3 loop I wo)ld delete the ile irst %/;ile.deleteile%& & $eore I started the +3loop, that wa( (o) 'now (o) are starting with a clea$ ile.In the //8ollectallor%...& )ncntion, (o) have three options, the irst is a String and (o) s)ppl(

    what (o) are loo'ing or, teh second is a conditional string i.e. i (o) onl( want the irst stringto match an attri$)te, the third is a d$re, so //ce or world wor' %or an( other d$re varia$le&

    I I wanted el$ows rom sites that were piping site I wo)ld set all m( ;K

  • 8/10/2019 PML Basics

    30/33

    and nextvar /collname eval name or all rom /coll%or eval)ate name o all o previo)s list&

    Dh( not/8 o$Bect collection

    /8.scope%//ce&/8.ilter% o$Bect U!SSI3

  • 8/10/2019 PML Basics

    31/33

    var /or X or ceXendivar /comp collect all $ran mem with t(pe ne? XI

  • 8/10/2019 PML Basics

    32/33

    11-1G-2007

    :ac' to $asicQ

    Kse)l )nction

    deined%/varia$le& ret)rns %$oolean& tr)e i the varia$le is deined.MdeinedM means the varia$le has an( val)e, or M)nsetM val)e.

    )ndeined%/varia$le& ret)rns opposite val)e to deined%&

    set%/varia$le&----ret)rns i the varia$le has non M)nsetM val)e.)nset%/varia$le&

    ----ret)rns opposite val)e to set%&.

    set%& and )nset%& is also availa$le as method st(le.

    @o) can sa(Q

    /varia$le.set%&/varia$le.)nset%&

    *he MdeinedM val)e is the same stat)s B)st ater (o) declare a varia$le.

    !+"S varia$le has intermidiate condition $eore (o) load concreate val)e to the varia$le. *hisstat)s will $e called as MdeinedM.3nce the varia$le is deined, (o) can chec' the varia$le has cocreate val)e %not an )nsetval)eM $( )sing set%&J)nset%&.

    tr( the ollowing examle to see the res)lt.----Start----------------------------/res)lt deined%/varia$le&!

  • 8/10/2019 PML Basics

    33/33

    So when we see deinedJ)ndeind, setJ)nset condition with varia$le>

    !lease tr( to cop( the attri$)te val)e to (o)r varia$le, and )se the )nctionJmethod a$ove.I recommend (o) to )se M/varia$le Rattri$)te nameM command to get what t(pe o o$Bectwill $e loaded to (o)r varia$le. i we )se Mvar /varia$le Rattri$)te nameM command, we alwa(sget string val)e, and this will $e the same val)e as we see $( M4 Rattri$)te nameM %Rattri$)te

    name can $e M!3SI*I3