Files

Previous  Next

 

Source Files

MyBASIC2 files are regular text files with .BAS extension.  You can use any text editor such as Notepad, Notepad++ or the MyBASIC2 IDE to create and edit a MyBASIC2 file.  You can run a MyBASIC2 program using the MyBASIC2 App

 

Compiled Files

A MyBASIC2 file can be compiled into a binary file.  This file is an object file and not an executable file.  However it is faster to run since it has already been parsed and it can't be easily altered so that you can use MyBASIC2 to develop commercial products.  A compiled file can also be password protected so that it can not be reversed engineered using any of the debuggers.  Compiled files have the extension .BAC.

 

Include Files

You can include other files into your source files.  These files are included using the $INCLUDE statement.  The default extensions for these files are .BIS (source) and .BIC (compiled).  If you don't specify a folder, MyBASIC2 will first look in a sub-folder to the MyBASIC2.DLL called Include, then if not found, it will use the MyBASIC2_Inc environment variable and then lastly, the current default folder.

 

When compiling a file with includes, the include files will be embedded into the output compiled file and will not be referenced when running a compiled MyBASIC2 program.  This is important to know when compiling files using system includes.

 

System Include Files

The include file MyBASIC2.BIS (or .BAC) will be included by default when running a program unless disabled using the MyBASIC2 IDE Options or the /NOSYSFILES qualifier in the MyBASIC2 App.  The system includes uses the /ONCE qualifier so it will only be included once when calling sub programs.

 

It is important to know that if you compile a sub-program independently outside a project, a copy of system include files will be inserted into the compiled sub-program file and when called by a program that also includes the system file you may end up with unexpected run-time errors such as constants not being able to be assigned twice.

 

When using projects in the MyBASIC2 IDE, only the main program (high-lighted) will include system includes.  When using the MyBASIC2 App, use the /NOSYSFILE qualifier when compiling sub-programs to avoid system include file conflicts.

 

Library Files

The Windows version of MyBASIC2 also recognizes DLL library files.  A DLL library file can be loaded as an extension library by the $LIBRARY statement or you can DECLARE external SUB and FUNCTION calls