jonneeklund
(Fresh Scripter)
2011-11-03 04:06 PM
Wildcards in macro?

Hi all,

Can I use wildcards in the @USERID-macro?

Example:
If @USERID = "*Doe" would match both JohnDoe and JaneDoe


AllenAdministrator
(KiX Supporter)
2011-11-03 04:18 PM
Re: Wildcards in macro?

No, but you can try one of these. The RIGHT method is more likely to be correct, because the INSTR method could match things like DOEW, DOES, or DOESN'T too, in which case it would be matching things you don't want.

 Code:
if instr(@userid,"DOE")
  ;do stuff
endif

if right(@userid,3)="DOE"
  ;do stuff
endif





jonneeklund
(Fresh Scripter)
2011-11-04 03:11 PM
Re: Wildcards in macro?

Thanks and sorry for the late reply.

"if right" was the way to go.