Skip to main content



      Home
Home » Eclipse Projects » RCP Testing Tool » [SOLVED] how to get value of childcount to put on variable(use property)
[SOLVED] how to get value of childcount to put on variable [message #1697399] Wed, 03 June 2015 11:36 Go to next message
Eclipse UserFriend
HI,

I would like to get value from property and put on variable.
example:
	let [val Nb_element [get-item $path_library | get-property childCount]]
 {
		   /// do some thing, add element on my library
			}
		}
get-item library | get-property childCount | equals [plus $Nb_element 1] | verify-true
	}


It's possible to change variable on script like
Nb_element |3 


How can I take number of element from property and put on variable?

thanks,

jeremie

[Updated on: Mon, 05 October 2015 02:55] by Moderator

Re: how to get value of childcount to put on variable [message #1697457 is a reply to message #1697399] Thu, 04 June 2015 02:27 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jeremie,

1) To assign a value from a property to a variable you need to use -raw agrument, e.g.:

let [val Nb_element [get-item $path_library | get-property childCount -raw]]
{
// do some thing, add element on my library
}
}

// then you can compare it with a desired value:

get-item library | get-property childCount -raw | equals [$Nb_element | plus 1] | verify-true
}


To change a variable value you need to declare it as a global variable:

global [val Nb_element [get-item $path_library | get-property childCount -raw]]

//then you can change it's value, e.g.:

global [val Nb_element [$Nb_element | plus 3]] -override

I hope it helped.

Kind regards,
Ulyana.

Re: how to get value of childcount to put on variable [message #1697513 is a reply to message #1697457] Thu, 04 June 2015 10:18 Go to previous messageGo to next message
Eclipse UserFriend
hi Ulyana,

thanks for your answer, I already use -raw, it's exactly that I want to do.

next time , I look a global variable but you open me, so much possibility.

jeremie
Re: how to get value of childcount to put on variable [message #1698535 is a reply to message #1697513] Tue, 16 June 2015 05:45 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ulyana,

I can't use global ? I don't understand.

when I play this script following, I have always problem on line with[get-item [$name_object]

 global [val name_object [$element]]

global [val name_object [$name_object | eq [concat "New " $element]]] -override


with[get-item [$name_object] {
					    	    get-property "getData().getName()" | equals $name_object | verify-true
				    	 	}


I thinks, I can't use my global and get value.
Could you help me, thanks.

jeremie
Re: how to get value of childcount to put on variable [message #1698539 is a reply to message #1698535] Tue, 16 June 2015 06:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jeremie,

I suppose that there is a mistake in this line:

global [val name_object [$name_object | eq [concat "New " $element]]] -override

Could you please explain what are you trying to do here and why there is "eq"?

If you need to override a global value by concatenating it with some other value, the scheme is the following:

global [val i "aaa"]
log $i //prints "aaa"
global [val i [concat [$i] "bbb"]] -override
log $i //prints "aaabbb"


Kind regards,
Ulyana.

Re: how to get value of childcount to put on variable [message #1698582 is a reply to message #1698539] Tue, 16 June 2015 10:02 Go to previous message
Eclipse UserFriend
hi ulyana,

when I try to declare global, I alway have error, My declaration is insie "with [get-view Types | get-tree] {".

but it's work with global [val i [concat [$i] "bbb"]] -override

I was used Eq to set variable. big error.

thanks

jeremie
Previous Topic:[SOLVED] Use custom procedures in multiple test cases
Next Topic:[SOLVED] Starting workbench failed
Goto Forum:
  


Current Time: Thu Jun 19 19:04:44 EDT 2025

Powered by FUDForum. Page generated in 0.04262 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top