1980gamer Posted September 19, 2021 Share Posted September 19, 2021 I tried to search for this, but it didn't find anything. I have not seen this, but would be a great function. IF X IN(1,3,5,7,11) then xxxx else yyyy instead of IF X=1 or X=3 or X=5 or X=7 or X=11 then.... Or IF X NOT IN(1,3,5,7,11) then OH.. Never Mind. I think just reverse the then and else? Maybe: CALL IN([1,2,3,4,5],X) :: IF X=1 then xxxx else yyyy Quote Link to comment Share on other sites More sharing options...
SteveB Posted September 19, 2021 Share Posted September 19, 2021 This will be in the next version of SXB TiCodEd, only with square brackets: IF K IN[69,83,68,88] THEN <STMT1> or IF K NOT IN[69,83,68,88] THEN <STMT1> If testing goes well it will be released in two weeks with lots of other enhancements. It gets translated to IF K=69 OR K=83 OR K=68 OR K=88 THEN ... for the use with any Extended BASIC. 2 Quote Link to comment Share on other sites More sharing options...
RXB Posted September 19, 2021 Share Posted September 19, 2021 Hey I said in RXB I was going to make a new routine called SET[1,3,5,7,11] last year! Glad someone is reading my posts! Quote Link to comment Share on other sites More sharing options...
1980gamer Posted September 19, 2021 Author Share Posted September 19, 2021 44 minutes ago, RXB said: Hey I said in RXB I was going to make a new routine called SET[1,3,5,7,11] last year! Glad someone is reading my posts! Might have missed it, or maybe I think of SET as "setting" a value, not comparing one. Quote Link to comment Share on other sites More sharing options...
RXB Posted September 20, 2021 Share Posted September 20, 2021 1 hour ago, 1980gamer said: Might have missed it, or maybe I think of SET as "setting" a value, not comparing one. Google search: How do you describe a set? A set in mathematics is a collection of well defined and distinct objects, considered as an object in its own right. ... The most basic properties are that a set "has" elements, and that two sets are equal (one and the same) if and only if every element of one is an element of the other.Sep 15, 2012 What is sets and examples? A set is a collection of elements or numbers or objects, represented within the curly brackets { }. For example: {1,2,3,4} is a set of numbers.Jul 19, 2020 What is set in math? Set, In mathematics and logic, any collection of objects (elements), which may be mathematical (e.g., numbers, functions) or not. ... For example, the set of integers from 1 to 100 is finite, whereas the set of all integers is infinite. A set is commonly represented as a list of all its members enclosed in braces. Set Symbols (mathsisfun.com) 1 Quote Link to comment Share on other sites More sharing options...
1980gamer Posted September 20, 2021 Author Share Posted September 20, 2021 (edited) I am not a mathematician, I am a SQL developer. This is what I think of when I hear SET. Edited September 20, 2021 by 1980gamer 2 Quote Link to comment Share on other sites More sharing options...
matthew180 Posted September 20, 2021 Share Posted September 20, 2021 What about ON GOTO and ON GOSUB ? Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted September 20, 2021 Share Posted September 20, 2021 47 minutes ago, matthew180 said: What about ON GOTO and ON GOSUB ? With a non-contiguous set of numbers you would have to either work up a formula to convert the set to {1..x} or have dummy entries in the list. I have done this in the past with a set of numbers like {1,2,4,6,8,9} and used a "dummy" line number in positions 3, 5, and 7 which go to a line which prints something like "THERE BE WHALES HERE" or jumps back to the beginning of the process which gave the errant value (to hopefully fix it.) 1 Quote Link to comment Share on other sites More sharing options...
matthew180 Posted September 20, 2021 Share Posted September 20, 2021 Ah, yes, I have not looked at anything BASIC or XB in a long time. ON GOTO / GOSUB are limited to consecutive values then (and starting with 1?) Well, sometimes you can make that happen, otherwise I supposed you have to just do the checks. Although, there are a lot of tricks in BASIC for checking numbers and such. I don't have any examples off-hand, but I have seen some pretty weird stuff in an IF statement. Quote Link to comment Share on other sites More sharing options...
1980gamer Posted September 20, 2021 Author Share Posted September 20, 2021 44 minutes ago, matthew180 said: Ah, yes, I have not looked at anything BASIC or XB in a long time. ON GOTO / GOSUB are limited to consecutive values then (and starting with 1?) Well, sometimes you can make that happen, otherwise I supposed you have to just do the checks. Although, there are a lot of tricks in BASIC for checking numbers and such. I don't have any examples off-hand, but I have seen some pretty weird stuff in an IF statement. Me too. I don't really get these IF's some or most of the time! I like human readable. Being old and slow. I guess I get the True or False variants, but I have seen some crazy stuff as well. That being said, I knew I had done something a few years ago in another program..... I want to use it now. I listed the program to notepad and was like.... WHAT WAS I SMOKING when I wrote this! Not certain if it is genius or insanity? But it certainly took me longer to figure out / remember what I was doing than it would have taken to just rewrite it! Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted September 20, 2021 Share Posted September 20, 2021 4 hours ago, matthew180 said: ON GOTO / GOSUB are limited to consecutive values then (and starting with 1?) Yup. 3 hours ago, 1980gamer said: That being said, I knew I had done something a few years ago in another program..... I want to use it now. I listed the program to notepad and was like.... WHAT WAS I SMOKING when I wrote this! Yup. 3 hours ago, 1980gamer said: Not certain if it is genius or insanity? certified whacko.mp4 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.