L3 UiDemo Practice - dbl_CashIn/OnUsCheck/NotOnUsCheck is not declared

Dear colleagues,

At page 10 from solution document of UiDemo practice is suggested to set in the 1st Decision Flow the condition:
Double.TryParse(CashIn, dbl_CashIn) AND Double.TryParse(OnUsCheck, dbl_OnUsCheck) AND Double.TryParse(NotOnUsCheck,dbl_NotOnUsCheck)

… but if I do so, I get this error:

I adapted the script to:
Double.TryParse(CashIn, 0) And Double.TryParse(OnUsCheck, 0) And Double.TryParse(NotOnUsCheck, 0)
… and like this it works, but I am not sure if it is the right solution.

You need to declare those variables. This will be under the Variables section of UiPath, where you will add the variables yourself.

1 Like

Hi Anthony,

Thank you for your reply.

  1. What is the purpose of dbl_CashIn, dbl_OnUsCheck and dbl_NotOnUsCheck?
  2. How to declare them? What is the correct variable type?

These will contain the cash values as decimals. They are of type System.Double.

1 Like

Last question please :smile:

  1. Is it correct like this:

2 Where should I use these 3 dbl_ variables? In the 3 type into activities?

  1. Would be correct as well to use in the condition
    Double.TryParse(CashIn, 0) And Double.TryParse(OnUsCheck, 0) And Double.TryParse(NotOnUsCheck, 0)
    … and then to use 3 Assign activities Double.Parse:
    dbl_CashIn => Double.Parse(CashIn)
  1. This looks correct. However, if any of these variables are being assigned to the TryParse function, it should be a boolean type instead.

  2. The double variables are used for comparing numeric data, as in to compare if one value is less than or greater than another. It is possible to use these for Type Into activities, but they would need to be converted to strings when you do so.

  3. The conditions should be more like Double.TryParse(CashIn, dbl_CashIn), since the TryParse method simultaneously assigns the double value to the second parameter if it is successful. You won’t need to use assign activities, since TryParse automatically assigns the values.

1 Like

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