PDA

View Full Version : Coding Help - getNode() as a String



dulux-oz
March 21st, 2014, 08:55
Hi Guys,

I'm pretty sure this is out there somewhere, but I'll be a Newbie Player if I can find it:

I have a node created as:



local oMyNode = DB.createChild("mynode");


What I now need is the vale of oMyNode as a string so I can concatenate it with the string "mynode." such as:



DB.setValue("myothernode","recordname","string","mynode." .. someGetFunction(oMyNode));


To produce a node in the Campaign Database as (example):



<recordname>mynode.id-00001</recordname>


So, what is the function someGetFunction()?

Thanks

Nickademus
March 21st, 2014, 09:16
What I now need is the vale of oMyNode as a string so I can concatenate it with the string "mynode." such as:



DB.setValue("myothernode","recordname","string","mynode." .. someGetFunction(oMyNode));


I would assume
DB.getValue(oMyNode)

Unless that function wasn't working for you.

Trenloe
March 21st, 2014, 15:33
If you're asking for the database name of oMyNode then try oMyNode.getNodeName() will give you the full database name (from the DB root) oMyNode.GetName() will give you just the child name itself.

Both of these functions are in the databasenode object documentation: https://www.fantasygrounds.com/store/product.xcp?id=WW16111FG2

dulux-oz
March 22nd, 2014, 06:17
Why is it that it is ALWAYS the simplest things that are the hardest to find?

Why is it that it is ALWAYS the simplest things that take the most time to resolve?

Why is it that someone else can ALWAYS find/resolve things in such a way that it makes you look like a burk?

Thanks guys - got what I need working now.

Cheers

Nickademus
March 22nd, 2014, 09:18
Too much intelligence trying to warp the problem into something worthy of being solved. *sagenod*