using MATCHES or LIKE in <CASE> ??

Post Reply
guestroom
Posts: 21
Joined: Fri Jun 16, 2000 12:58 am

using MATCHES or LIKE in <CASE> ??

Post by guestroom »

I KNOW THE FOLLOWING WONT WORK. There is no Matches nor Like in Vortex.
But this is the logic of what I want to do.
SO HOW DO I DO THIS?

<lower $kword>
<$lkw=$ret>

<SWITCH $lkw >
<CASE "asia">
<!-- how do I get a MATCHES or LIKE in a case statement -->
$lkw - exactly asia!
<CASE LIKE "asia">
$lkw - matches asian or asia
<DEFAULT>
no matches for $lkw !
</SWITCH>
</A>

thanks
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

using MATCHES or LIKE in <CASE> ??

Post by bart »

The closest thing to your desired operation is to use the SANDCALL option to <fmt> and <sb></sb>.

I know this might sound odd, but it can locate one or more patterns and then call functions based on the
pattern located.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

using MATCHES or LIKE in <CASE> ??

Post by John »

Another option is to use a cascading <IF>, e.g.

<if $lkw eq 'asia'>
...
<elseif $lkw MATCHES 'asia%'>
...
<else>
...
</if>

since <IF> will allow the full range of conditions available to a SQL WHERE clause.
John Turnbull
Thunderstone Software
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

using MATCHES or LIKE in <CASE> ??

Post by bart »

I was semi-wrong: John's method seems like a more direct solution than mine.
Post Reply