Compilation

The BASIC command is provided as a front end program to the jBASE jbc compiler. The jbc compiler converts the BASIC code into "C" and invokes the native "C" compiler to convert the "C" source code into a machine native object file.

BASIC BP PROGRAM1 SUB1

The BASIC command creates the object record as $PROGRAM1 in file BP. The BP file can be any file type supported by jBASE, whether it is a hashed file, directory and so on.

The steps used by BASIC command are as follows:

  • Any supplied record keys with a dollar/pound prefix or a .o or .obj suffix are ignored.
  • The source is moved to the current working directory as a temporary file called BASIC_nn.c, where nn is the users port number.
  • The source is compiled using the jbc command.
  • The .o or .obj file is then moved back to the original source file with a dollar/pound prefix and the .o or .obj suffix removed.
  • The command then cleans up any scratch files it created.

Note: If the original record key had a .b suffix then the .o or .objsuffix is not removed and the dollar/pound prefix not prepended.

A jBASE utility jCompileFile is available which invokes the BASIC compiler and produces an output and summary report, together with warnings and error lists. The syntax of jCompileFile is as follows:

jCompileFile -Options SourceFileName

Option Description
-p direct output and report to printer
-v direct output and report to screen

The conversion report, output, warning lists and error lists are stored in the PortSave directory as jbc_rep_FileName, jbc_out_FileName,   jbc_warn_FileName and jbc_err_FileName respectively. The jbc_err_FileName can be used to create a select list to supply to JED to enable correction of errors or problems. If executed again the jCompileFile will only attempt to compile records in the jbc_err_FileName list else the jbc_warn_FileName if either list is not empty. e.g.

FORM-LIST PortSave jbc_err_FileName
JED FileName
jCompileFile -v FileName

 

Installing a compiler for jBASE 5 on Windows Server 2008

Option 1: Use VS.NET 2008
=====================

If using this option then you must install the 'X64 Compilers and Tools' as they are not installed by default. You can find this entry under the 'Language Tools > Visual C++' installer tree.

Once Visual Studio is installed then jBASE requires the following environment setup:

Add to INCLUDE:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include;C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\include

Add to LIB:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib\amd64;C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\Lib;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\x64

Add to PATH:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\x86_amd64;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin
 


Option 2: Use the free compiler from Microsoft
====================================

Use this link to install the free compiler from the Microsoft website.

Be sure to read the 'System Requirements' section and make sure your system satisfies any prerequisites.

Once the compiler is installed then jBASE requires the following environment setup (note that it is different than the environment setup for Option 1):

Add to INCLUDE:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include

Add to LIB:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Lib\amd64;C:\Program Files\Microsoft SDKs\Windows\v6.1\Lib\x64

Add to PATH:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Bin\amd64;C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\x64
 

 

Installing a compiler for jBASE 5 on Windows 7/8 or Windows Server 2008 R2/2012

If you have Visual Studio 2008 then follow the instructions under Option 1 above.

If you do not have Visual Studio 2008 then use this link to install the free compiler from the Microsoft website. We recommend using the web setup.

The minimum required Installation Options* are:

*Note that if you have an Itanium processor then you will need to select the IA64 Libraries.

Once the compiler is installed then jBASE requires the following environment setup:

Add to INCLUDE:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Include;C:\Program Files\Microsoft SDKs\Windows\v7.0\Include

Add to LIB:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Lib\amd64;C:\Program Files\Microsoft SDKs\Windows\v7.0\Lib\X64

Add to PATH:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\Bin\amd64;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\x64;C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin


Compiling