SyntaxBoom

Languages & Coding => BlitzMax (NG/Vanilla variants) => Topic started by: Baggey on Jun 29, 2025, 03:43 AM

Title: .mod folder for Case Select
Post by: Baggey on Jun 29, 2025, 03:43 AM
As in the title anybody know which module the Case Select is stored in.

Idea in BlitzmaxNG you cant Case ( 1 .. 14 )
You Physically are forced to Case 1,2,3,4,5,6,7,8,9,10,11,12,13,14
Which is a ball acke.

I would like to modify it. Anybody have any ideas how i cam make this so?  ::)

Baggey
Title: Re: .mod folder for Case Select
Post by: Jackdaw on Jun 29, 2025, 04:12 AM
It's not in any module. Case is a statement not a function and is part of the core language. If you want to change that, then you're going to have to modify the Blitz Code Compiler (bcc) (https://github.com/bmx-ng/bcc). So it's not just a simple fix.

After a quick look at what code is being emitted, looks like C. The the Select/Caste is converted into a very big if/then/elseif block. The regular case block (switch) in C/C++ only supports integer numbers.
Title: Re: .mod folder for Case Select
Post by: Baggey on Jun 29, 2025, 04:57 AM
as im Shite and finding things could you show the file as a .txt? so i can have a looksy, and have a play with it?

Sadly i haven't learnt how to get Discord directory's like Blitz Code Compiler (bcc) working. I dont know how to .make or whatever your supposed to do with it. If i knew that id like to have ago and altering the IDE and colours etc.. That would be a fun project  ;)

I am very willing to have a try just need a bit of pointing to start with  :D

Kind Regards Baggey
Title: Re: .mod folder for Case Select
Post by: Jackdaw on Jun 29, 2025, 05:17 AM
Start with the parser.bmx file, and look for ParseSelectStmt.

What you need is a way where building bcc in debug mode will in it's self run some test code. In this way, up can follow whats going on with it.
Title: Re: .mod folder for Case Select
Post by: Baggey on Jun 29, 2025, 07:08 AM
I shall have a look latter thankyou for the heads up.

Now, i have to go Kayaking with the misses up a beautiful river, for a pint and a spot of lunch.  :(

Strange, i feel compelled to sit in the mancave on me computer looking at parsers :-X

Baggey