If condition String equal

im try to check if folder is currentText (but now i just try with instance string value)

i get folder value form Save file then check in folder

and condition i just try R200.2-2 with same value as folder but the result of if condition it result → false

Debug and trace with the immediate panel and prototype it e.g. with a trim usage
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

maybe the equals method can better serve: folder.Trim.Equals(“…”)

But we also recommend using variable names which are different to any classnames, keywords…

same result

we don’t see any usage of the immediate panel as we recommended:

The image shows the Immediate window in Visual Studio where a variable "folder" is assigned the value "R200.2-2" and then compared using the Trim and Equals methods, returning true. (Captioned by AI)

@kridsanol.niamsron.extern

please check if by chance there are two variables created with name folder

also better to rename folder with any other name as folder is a keyword

cheers

from the screenshot we can see that based on the variables the result is correct. When other result is expected then we recommend to trace more as also mentioned by Anil

Keep in mind: = within the immediate panel is doing often an assignement. So we recommended using the equals method

image

focus on the hyphen
folder.Select(Function (x) AscW(x))
vs
“R200.2-2”.Select(Function (x) AscW(x))

image

so you see the difference:
A screenshot depicting code output from a .NET application, highlighting the use of the  function on character arrays, with one array including a character with ASCII code 8206. (Captioned by AI)

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