Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:52 15 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CM2: IN functionality

Author Message
bar1010
Senior Member

Joined: 10/08/2020
Location: United States
Posts: 197
Posted: 07:00pm 14 Nov 2020
Copy link to clipboard 
Print this post

Would it be worthwhile to create the Oracle PL/SQL IN functionality?

Variable IN(2, 5, 12)

Replacing

Variable = 2 or variable = 5 or variable = 12
 
elk1984

Senior Member

Joined: 11/07/2020
Location: United Kingdom
Posts: 229
Posted: 07:46pm 14 Nov 2020
Copy link to clipboard 
Print this post

Concat the values with |, do an INSTR?

If you wanted to be posh, you could pass an array and have the function do the concat

DIM contained AS Integer
contained = ValueIn("|2|5|12|","2")

END

FUNCTION ValueIn(valuesToCheck As String, valueContained As String) As Integer
 ValueIn = (INSTR(valuesToCheck,"|"+valueContained+"|")>0)
END FUNCTION
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025