-----------------------------------------------------------------------------
RQTINYJP PACKAGE October 17th, 2003 by Jacques PHILIPPE
-----------------------------------------------------------------------------
INTRODUCTION
------------
Pavel Minayev's RQTINY32.LIB and RQTINYCC.LIB allows to generate Tiny
executables but these executables does not accept Command Line arguments.
Based on the same idea and helped by his docs, here are RQTINY32.JP and
RQTINYCC.JP written in BCX(*), these one accept 200 Arguments in Command Line
and the BCX sources are available. You can rename RQTINY32.JP in RQTINY32.LIB
and use it instead of your previous RQTINY32.LIB. Same for RQTINYCC.JP to be
renamed RQTINYCC.LIB

Dont forget that the memory leak is still present in the RAPIDQCC.DLL and
RAPIDQ32.DLL, so your Tiny executables still 'leak'. That leak have been
solved by Doctor Electron in May 2003, for three years we have lived with
the problem. So maybe we can still live with it in our Tiny Executables ?

Tiny Executables are typically less than 20 KBytes and can be as short as
6 KBytes !

(*) BCX : Basic to C Translator, by Kevin Diggins. BCX creates fast and small
size executables.
-----------------------------------------------------------------------------
RAPIDQ BYTECODE INFOS
---------------------
RapidQ allows you to compile your sources in bytecode, for this you have to
use the -b option when calling the RC.EXE RapidQ compiler :

rc.exe -b MyCode.Bas

The result of this will be a file named :

MyCode.Bc

In the Files RapidQCC.DLL and RapidQ32.DLL are the two functions
RQ_ExecuteFile and RQ_ExecuteMemory which executes these RapidQ bytecodes
(see ExecuteByteCode.Bas in this package). Theses DLL can be downloaded at
http://www.basicguru.com/???/RQDLLS.ZIP

To Execute these bytecodes RAPIDQ32.DLL and RAPIDQCC.DLL must be 'loaded' ;
an easy way to do this is copy them in the c:\Windows directory (for WIN98).

RQTINY32.JP and RQTINYCC.JP are simply two executables -renamed .JP- to which
you just binary append the compiled bytecode and then rename the result
MyCode.Exe. RQTINY32.JP must be used for GUI applications and RQTINYCC.JP
must be used for CONSOLE applications.


The last for bytes of the bytecode files is the length of the bytecode. That
length does not include the last for bytes (who contain that length :).
That lenght is stored as this : LSW_LSB, LSW_MSB, MSW_LSB, MSM_MSB
-----------------------------------------------------------------------------
THIS PACKAGE :
------------
In this Package, you will also find :
- CmdConTest.Bas and CmdConTest.Bc Written in RapidQ
Console bytecode used in the Console examples of this package. A console
software displaying all the Command Line arguments it received.

- CmdGuiTest.Bas and CmdGuiTest.Bc Written in RapidQ
Console bytecode used in the Gui examples of this package. A Gui software
displaying all the Command Line arguments it received.

- Tiny32_Cmd.Bas and Tiny32_Cmd.Exe Written In BCX
executing a GUI bytecode file whose name is received as a Command Line
argument

- TinyCC_Cmd.Bas and TinyCC_Cmd.Exe Written In BCX
executing a Console bytecode file whose name is received as a Command Line
argument

- TinyBuilderDemo.Bas is Written in RapidQ
demonstrates howto build an executable from a bytecode file and
RQTINYCC.JP or RQTINY32.JP
will binary append :
RQTINY32.JP + CmdGuiTest.Bc to CmdGuiTest.Exe
and
RQTINYCC.JP + CmdConTest.Bc to CmdConTest.Exe

- TinyBuilder.Bas A rapidQ Code. NEW October 17th, 2003
New version of TinyBuilder posted on October 17th, 2003 in Yahoo Group
RapidQ message number 20390 by Manuel Candela.
Build an .exe with any .bc file passed as command line argument
A second argument different of "0" will build a GUI application.
If second command line argument is not passed or if its value is "0"
will build a console application.

USAGE : TinyBuilder yourPathFileName.bc [0|1] 1 for GUI application

- ExecuteByteCode.Bas
is the file named Test.Bas in the RQDLLS.ZIP file from www.basicguru.com
It shows how to use the functions RQ_ExecuteMemory and RQ_ExecuteFile
from RAPIDQ32.DLL and RAPIDQCC.DLL to execute bytecode.

- Test.Bat
A Demo batch file that runs the previous executables with arguments.

-----------------------------------------------------------------------------

Jacques

' ----- RAPIDQ BC to EXE BUILDER DEMO ---------------------------------------
Dim bcFile As QFileStream
Dim jpFile As QFileStream
Dim exeFile As QFileStream
DefStr sBc, sJp, sExe

bcFile.Open ("MyCode.bc", fmOpenRead)
jpFile.Open ("RQTINY32.JP", fmOpenRead) ' RQTINTCC.JP for console application
exeFile.Open ("MyCode.Exe", fmCreate)
sBc = bcFile.ReadBinStr(bcFile.Size)
sJp = jpFile.ReadBinStr(jpFile.Size)
exeFile.WriteBinStr (sJp, jpFile.Size)
exeFile.WriteBinStr (sbc, bcFile.Size)
exeFile.Close
jpFile.Close
bcFile.Close
' ---------------------------------------------------------------------------

-----------------------------------------------------------------------------
Version 17th october 2003 Modified by TinyBuilder.Bas
- Now accepts any .bc file as argument to build its .exe
- check too the existence of used files
- previous version of june 17th, 2003 renamed TinyBuilderDemo.Bas
Version 17th june 2003 ... minor forgotten changes :)
Version 16th june 2003
-----------------------------------------------------------------------------
Hosted by uCoz