Vectrex32

General Category => Feature Requests and Bug Reports => Topic started by: jaymzjulian on November 14, 2019, 03:06:45 AM

Title: Something like #include?
Post by: jaymzjulian on November 14, 2019, 03:06:45 AM
So I've been creating a bunch of libraries for my dev, which is nice and all, but currently I'm putting that together with scripts and/or editor tricks - I was wondering if there is a way to load more basic files from the flash in a sort of '#include'-ish way - so not like chain behaves, and as far as I can tell now how load behaves either? 

I was thinking of using cpp for this on the PC, but obviously editing in that workflow is terrible, so i wondered if maybe you already thought of this and it's just hidden in the depths of the manual that i could not find, otherwise it's a feature request :)
Title: Re: Something like #include?
Post by: VectorWorlds on January 15, 2020, 05:10:15 PM
I would like to second this request.  Im writing a little library of functions that I would like to use time and time again in my projects and I would like to hive these off into a separate include file to keep them away from the main game code :)
Title: Re: Something like #include?
Post by: Vectrex32 on January 15, 2020, 05:24:11 PM
It would clearly be a useful thing to have. But some of the internal workings of it are causing me headaches. I'm not giving up on the idea, but I don't know if I can pull it off.

- Bob
Title: Re: Something like #include?
Post by: jaymzjulian on January 15, 2020, 10:08:03 PM
My current solution to this, btw, involves a horrible bastardisation of the C pre-processor - what I do, is I use cpp to literally #include files, and then I sed the '#line' directives it inserts to print out the line/file if i need to debug. 

I wonder if there's enough memory that you could do a similar thing - i.e. internally generate a single text file, with some sort of variable set on each line as to where you are now, and then that's the thing you parse/execute.  it shouldn't put a serious performance strain on the interpreter, i'd expect, since it should be a single token or such.  Since you'd be throwing out the temp files anyhow, it shouldn't use much more memory at actualyl runtime than not?
Title: Re: Something like #include?
Post by: Vectrex32 on January 16, 2020, 08:15:35 AM
I've been thinking along the same lines.

- Bob
Title: Re: Something like #include?
Post by: Vectrex32 on January 23, 2020, 10:22:37 AM
I've just released version 1.22 which supports include files. You can get it here (https://vectrex32.com/category/downloads/).

- Bob