Page 1 of 1

multiple files

PostPosted: Sun Oct 26, 2008 1:01 pm
by mindstormss
What is the easiest way to have multiple .cobra files that "know" about each other? I can get a cobra dll to be imported into cobra (to use python terminology) but the "use" syntax seems to not even look for .cobra files.

Re: multiple files

PostPosted: Sun Oct 26, 2008 2:35 pm
by Charles
Run them together like so:
Code: Select all
cobra MyProgram.cobra Shape.cobra Circle.cobra Square.cobra

This is different than Python where you just start with one file and it imports the others.

Also, if you get a long list of files, you can list them one per line in a separate file and do this:
Code: Select all
cobra -files-to-compile:MyFileList.text

With either technique, you can add a -c to only compile them, afterwhich you'll have a .exe that you can run and distribute independently:
Code: Select all
cobra MyProgram.cobra Shape.cobra Circle.cobra Square.cobra
MyProgram