Closed f4n0 closed 5 years ago
I leave an Update: I was watching my code where throws this warning and I saw this:
Now I'm a bit disappointing: If you watch carefully you will see the MaxStrLen that throws the warning and a few lines before there is also another MaxStrLen that does not throw any type of error/warning.
Hi @stefanoPrimo, The reason why you are getting an error on one and not the other is because the method has an overload. The first takes a text and the second a variant. The method that takes a variant results in a error being raised no matter what, so you need to change it to a text if you want to use that method.
Hi @thpeder, Thanks a lot, I didn't saw or knew that the MaxStrLen method could have an overload.
Hi, I'm trying to resolve some CodeCop error but I'm stuck here: I was used to solving the error "Possible overflow assigning 'Text' to 'Code[128]'. (AL0139)" simply by adding a
CopyStr(myVar,1,MaxStrLen(MyVar))
. But today I found out this Warning message:Assuming that I would not like to implement some hard-coded code (like
CopyStr(myVar,1, MaxStrLen(50))
) also to make my code easier to maintain, How can I fix that?Thanks Stefano Primo