Topic
1 reply Latest Post - ‏2013-03-11T05:27:52Z by SX14_Rahul_Singh
SystemAdmin
SystemAdmin
4179 Posts
ACCEPTED ANSWER

Pinned topic Difference between the Two statements Declare and Set

‏2013-02-25T07:22:21Z |
Hello All,

I am using both the below statements to serve my purpose but i don't know which statement is effective and why??

DECLARE ref1 REFERENCE TO OutputRoot.XMLNSC.Order.Summary.CustomerDetails;
SET ref1=OutputRoot.XMLNSC.Order.Summary.CustomerDetails;
Updated on 2013-03-11T05:27:52Z at 2013-03-11T05:27:52Z by SX14_Rahul_Singh
  • SX14_Rahul_Singh
    SX14_Rahul_Singh
    14 Posts
    ACCEPTED ANSWER

    Re: Difference between the Two statements Declare and Set

    ‏2013-03-11T05:27:52Z  in response to SystemAdmin
    Hi Vivek,

    There is a small difference between declare and set :

    SET : Using this statement we are setting a static value to ref1 variable.

    DECLARE : Using this statement we are actually creating a pointer in the logical tree. A variable defined using declare can be moved across a logical tree unlike a SET statement which sets a static value.

    I hope this makes clear .