I'm having problem comparing two strings.
The code above shows what I'm trying to do. The problem is that the "if" statement is never true, not even when Machine := "Slitt" and Name := "Slitt".
The variable Name takes the "handwritten" string "Slitt" as its value, while the variable Machine takes the value "Slitt", which is importet as an argument from an excel file. Might this be the problem and in such case, how can I solve it?
I do not understand what you are trying to achieve with the statement strRCopy(@.Machine,strlen(@.Machine)), because it will just return the whole string @.Machine.
I can think of two things that might go wrong in your case:
I suggest that you set a breakpoint before the if-statement. Then execute the method, so that the debugger will being opened. Look at the "Variables" tab at the bottom of the window and compare the value of the local variables 'Machine' and 'Name'.
I was just trying to solve the problem by using the function strRcopy, but as you said, it doesn't do the trick! However, the trim function was great and solves my problem. Thanks for the quick answer.