If the variable declared in this way are they variables or strings

  • A with value “123”
  • B with value “456”

If the values are enclosed in double quotes, obviously they are strings.

Regards,
Karthik Byggari

Hi
If it’s double quotes then it is a string type
If it’s a single quotes then it is a character type
If there is no quotes with number as value then it’s integer type

Cheers @Swagasmini_Jena

Create four variables of the GenericValue type in your sequence
  • A with value “123”
  • B with value “456”
  • C with value 123
  • D with value 456

Print to the console various operations with them and see what is the result

  • A + B
  • C + D
  • A + C
  • C + A

how can i get the result accoring to the question

Usually the genetic values can hold a string or Integer or a array or a Boolean kind of variable in it
And if we have two variables here with string and numerical type held by a generic type then

“123456”
As both is a string they get concatenated

579
As first variable C is a integer both will be treated as integer

“123123”
As first variable A is a string both will be treated as a string

246
As first variable C is a integer both will be considered as integer

Cheers @Swagasmini_Jena

how can i get the results as you mentioned in writeline activity as it only take strings as text

Keep the numerical values between ( ) and mention as (numbers).ToString

Cheers @Swagasmini_Jena

if i put (a+c).tostring and (c+a).tostring i m getting error

The last two writeline be like
(A+C).ToString
Similarly for last one as well
(C+A).ToString

Cheers @Swagasmini_Jena


A is integer type and C is string type can we add both using tostring method

There all are of type generic value right
Change them to generic value in the variable panel
Cheers @Swagasmini_Jena

1 Like


why cannot i find in the option

We could be able to find that type directly in the drop down box of variable panel itself and I hope we don’t need to search for it in browse for type options
Cheers @Swagasmini_Jena

1 Like

Fine no worries
Search as UiPath.Core.GenericValue

Cheers @Swagasmini_Jena

1 Like

Hi,

Just create variables using shortcut key ctrl+k that will create a generic variable by default.

image

image

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.