Something like #include?

Started by jaymzjulian, November 14, 2019, 03:06:45 AM

Previous topic - Next topic

jaymzjulian

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 :)

VectorWorlds

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 :)

Vectrex32

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

jaymzjulian

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?

Vectrex32

I've been thinking along the same lines.

- Bob

Vectrex32

I've just released version 1.22 which supports include files. You can get it here.

- Bob