UiPath Level 3 lesson 1 UiDemo - Finished...but I have questions on theory and UIDemo

Hey,

I just finished lesson 1 in the level 3 course.

I was wondering, can someone explain what the following code is doing? I got it working but I’m not entirely sure what it does:

Double.TryParse(CashIn, dbl_CashIn) - So I get that its checking if the entry is valid and if its a number but can someone please breakdown what its doing. Like what do these lines of code mean? Double.tryParse means its checking if its a number? So is it checking both CashIn and dbl_CashIn? Why do we need to check both?

Also, I’m running my workflow and its entering in the data to the Uidemo and its clicking accept. However, I note that it is not showing the total deposit at the bottom. Does this mean I’ve coded something incorrectly?

1 Like

@Asanka As fa as I know It tries to convert the string representation of the number to its double format

Hey,

So in the code Double.TryParse(CashIn, dbl_CashIn) why do we need the dbl_CashIn? if we are converting the string to double wouldn’t it be TryParse(CashIn)? When I try this I get an error. I’m just trying to understand why I need both. Haha the theory stuff is what Im really trying to understand.

  • Coding Trucker

Because it need to return value, whether the conversion succeeded or failed.
As CashIn = “ABC” => False then Throw
CashIn = “1,119.99” => True Then Continue

1 Like