CAN-DO is not returning correct value when the string has #

gmdurga

New Member
Hi,

Can anybody let me know why the CAN-DO function is returning a wrong result when the string has # in it.

For e.g. - CAN-DO("#1","#1") is returning NO.

Please provide your valuable comments in it.
 
Use
Code:
MESSAGE LOOKUP("#1","#1") GT 0
  VIEW-AS ALERT-BOX INFO BUTTONS OK.

Edit: Although be warned the arguments for LOOKUP are the other way round to CAN-DO!! :)
 
CAN-DO is a security function. Certain characters and situations impact the result.

Perverting CAN-DO to perform string operations is a bad idea. Yes, I know that certain applications do it a lot. It is still wrong and you use it in this way at your peril. As you have just found out.

Use LOOKUP instead.
 
CAN-DO is a handy function, but as Tom says can be risky if you don't fully understand it. After 5 years I thought I understood it, but haven't come across the # before!

Anyway, FYI there are a few other special characters (effective in first parameter only):
* - Wildcard for any character
. - Wildcard for single character
! - Rejects any value matching the following string

Out of curiosity I tried to figure out the # symbol; it seems to be ignored in the first parameter, but only if the first character of the ID..

Does anyone else know the full details for this function? The documentation is not entirely helpful, only mentioning '*' and '!'. And it looks like the very last statement on the doc page was meant for the CAN-FIND page..
 
Back
Top