Author |
Message
|
Prasi |
Posted: Wed Nov 06, 2013 11:41 am Post subject: Dynamic variable names |
|
|
Apprentice
Joined: 03 Aug 2011 Posts: 42
|
Hi,
Is there any way I can create dynamic variable names based on FIELDNAME. For eg:
FIELDNAME(InputRoot.XMLNSC.TransactionDetails.*[<])); will fetch me a value of AccountDetails and this has to be declared as soem datatype. So is there any way I can do this? |
|
Back to top |
|
 |
gs |
Posted: Thu Nov 07, 2013 12:29 am Post subject: |
|
|
 Master
Joined: 31 May 2007 Posts: 254 Location: Sweden
|
Not sure what you want to achieve but you could use LocalEnvironment. |
|
Back to top |
|
 |
Esa |
Posted: Thu Nov 07, 2013 1:16 am Post subject: Re: Dynamic variable names |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Prasi wrote: |
Hi,
Is there any way I can create dynamic variable names based on FIELDNAME. For eg:
FIELDNAME(InputRoot.XMLNSC.TransactionDetails.*[<])); will fetch me a value of AccountDetails and this has to be declared as soem datatype. So is there any way I can do this? |
Variable names cannot be dynamic.
Check DECLARE FUNCTION statement in the InfoCenter. |
|
Back to top |
|
 |
dogorsy |
Posted: Thu Nov 07, 2013 2:06 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
You can use dynamic elements in a tree, or in a ROW variable. As suggested by Esa , please read the InfoCentre |
|
Back to top |
|
 |
NealM |
Posted: Thu Nov 07, 2013 1:07 pm Post subject: |
|
|
 Master
Joined: 22 Feb 2011 Posts: 230 Location: NC or Utah (depends)
|
If your XML doesn't have a schema, you can just treat all element data as Char. If you do have a schema, then why are you asking? A CASE statement setup would be all you need. |
|
Back to top |
|
 |
|