question

Sergio V6 avatar image
0 Likes"
Sergio V6 asked Sergio V6 commented

Accessing Object values with DLL

I create an Object with 3 variables inside at "MAIN:/project/exec/commandlist/zohoNumber/zoho_var", i want to access those values with code (I use DLL Maker) using getvarstr() but i get an error when I try to do it, I want to store the value "site_1" in a string. Do you know how to access those values?


Thanks!

1631124623672.png 1631124679931.png

1631124710634.png

-- -----------
objectc++dll maker-- -----------
1631124623672.png (10.3 KiB)
1631124679931.png (7.2 KiB)
1631124710634.png (15.2 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ryan Clark avatar image Ryan Clark commented ·

Hi @Sergio V6, was Jordan Johnson's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·
Phil BoBo avatar image
1 Like"
Phil BoBo answered Sergio V6 commented

When you traverse the tree into object data by path, you use the > character instead of /.

From the DLL Maker, you can use the getnodestr() command to get an arbitrary node's value as a string. getvarstr() only gets the value of nodes in an object's 'variables' attribute.

treenode test = node("MAIN:/project/exec/commandlist/zohoNumber/zoho_var>site");
string site = getnodestr(test);
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Sergio V6 avatar image Sergio V6 commented ·
Thank you, it worked!
0 Likes 0 ·
Jordan Johnson avatar image
1 Like"
Jordan Johnson answered

The secondary tree inside an object is its attribute tree. Your code above would look more like this:

string site = test.find(">site").value;

If you want to use getvarstr, you'd have to add an attribute called "variables" to the attribute tree, and put the values you want in that node.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.