GET value from node

User avatar
sal21
PlatinumLounger
Posts: 4470
Joined: 26 Apr 2010, 17:36

GET value from node

Post by sal21 »

With a mouse move on treeview i get the value of node with:

VALORE=NODX

Actually i have the value in image.

i need to get the "(xxxx)" and store in myvar.

note:
the two bracket are fixed, change only the value in internal
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 79287
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: GET value from node

Post by HansV »

MYVAR = MID(VALORE, InStr(VALORE, "(") + 1, Len(VALORE) - InStr(VALORE, "(") - 1)
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4470
Joined: 26 Apr 2010, 17:36

Re: GET value from node

Post by sal21 »

HansV wrote:
11 Jul 2024, 10:53
MYVAR = MID(VALORE, InStr(VALORE, "(") + 1, Len(VALORE) - InStr(VALORE, "(") - 1)
:cheers:

User avatar
sal21
PlatinumLounger
Posts: 4470
Joined: 26 Apr 2010, 17:36

Re: GET value from node

Post by sal21 »

sal21 wrote:
11 Jul 2024, 13:49
HansV wrote:
11 Jul 2024, 10:53
MYVAR = MID(VALORE, InStr(VALORE, "(") + 1, Len(VALORE) - InStr(VALORE, "(") - 1)
:cheers:
WORK PERFECT!

User avatar
SpeakEasy
5StarLounger
Posts: 607
Joined: 27 Jun 2021, 10:46

Re: GET value from node

Post by SpeakEasy »

A node has a Tag property. When building the node you could put the number in the Tag. Then retrieving it would be as simple as

MYVAR = NODX.Tag
Last edited by SpeakEasy on 12 Jul 2024, 07:58, edited 1 time in total.

User avatar
sal21
PlatinumLounger
Posts: 4470
Joined: 26 Apr 2010, 17:36

Re: GET value from node

Post by sal21 »

SpeakEasy wrote:
12 Jul 2024, 07:18
A node has a Tag property. When building the node you could put the number in the Tag. Then retrieving it would ben as simple as

MYVAR = NODX.Tag
tks for suggestion.

snb
5StarLounger
Posts: 610
Joined: 14 Nov 2012, 16:06

Re: GET value from node

Post by snb »

Code: Select all

MYVAR = split(split(VALORE, "(")(1),")")(0)

Code: Select all

MYVAR = split(replace(VALORE, ")","("),"(")(1)