Page 1 of 1 1
Topic Options
#203444 - 2011-11-03 04:06 PM Wildcards in macro?
jonneeklund Offline
Fresh Scripter

Registered: 2005-04-12
Posts: 5
Loc: SWE
Hi all,

Can I use wildcards in the @USERID-macro?

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

Top
#203445 - 2011-11-03 04:18 PM Re: Wildcards in macro? [Re: jonneeklund]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4563
Loc: USA
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




Top
#203451 - 2011-11-04 03:11 PM Re: Wildcards in macro? [Re: Allen]
jonneeklund Offline
Fresh Scripter

Registered: 2005-04-12
Posts: 5
Loc: SWE
Thanks and sorry for the late reply.

"if right" was the way to go.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1527 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.112 seconds in which 0.081 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org