Originally Posted by
KF4GHG
Hi - I was wondering if I can create and later compile multi tBasic files into one executable? For example one.tBasic, two.tBasic into onetwo.exe. Thank You...
Hi Ronnie.
Yes you can create several files and run/bundle them in a single way.
I use
'---Load modules
Uses "Console", "OS" ,"bundle" , "ui" , "file", "sapi"
' 1.12.0 Change name include files
' .1 correction ----
' .3 c-----
' 13.0 - resolve_sym
' 14.0 resolve_symbol conditionnal
' 15.0 test exist sourcefile
' ..
' ..
' ..
' ......
' 34 add macros "%%timehms%%" "%%timehm%%" "%%datejma%%" " %%dateamj%%" (9/6/23)
dim version_nbr as string = "V: 1.34.0 09-06-2023 " & $crlf
dim dbg_indent as string = "Dbg--|"
'
'
#BUNDLE Icon "D:\Users\Root\Desktop\ThinBasicStuff\00-exe-icon.ico"
%insert_no = 1 as byte
%insert_yes = 0 as byte
#Include "asm_1802_0_dbg_codes.tbasic"
#Include "asm_1802_0_dbg_get_options.tbasic"
#Include "asm_1802_2_functions.tbasic"
#Include "asm_1802_3_asm_main.tbasic"
#Include "asm_1802_3_define_org-equ.tbasic"
#Include "asm_1802_4_decode.tbasic"
#Include "asm_1802_4_look_symbol.tbasic"
#Include "asm_1802_5_ins_new_symbol.tbasic"
#Include "asm_1802_5_ins_unres_sym.tbasic"
#Include "asm_1802_6_extr_reg_num.tbasic"
#Include "asm_1802_7_evaluate_operand.tbasic"
#INCLUDE "asm_1802_8_analyse_operand.tbasic"
#INCLUDE "asm_1802_9_resolve_undef_symbols.tbasic"
'
'Start of main code
'
This the main file.
Lines 1 ,2 : Declaration of modules used , included files may declare additional modules
Lines 5 to 15 : Comments for keeping history of development
Lines 22 and other not displayed : Bundle directives
Lines 27 to 39 : Calls to different parts of code
Lines 39 --->>> : Main code
In my development, the main code starts with DIM of variables used thrugout the program.
And other files are functional parts.
So when working/debugging, I use ThinAir to open/edit the main file, and open only other modules I am working on.
An when I hit the run button in the main file, all open modified files are saved on disk, and execution begins.
The ThinBasic.exe does the work of openig all included files.
You should be aware that Included files should not declare same variables leading to duplicate declare error.
And something happened in earlier version of TB : The run button of ThinAir saves modified files opened, but the BUNDLE button did not.
This leaded me to have some problems :- - I modify included file , run in ThinAir with green arrow
- - The file is saved , and the programs run.
- - The code does correctly the work, but I see a typo in a message. I correct the typo, and start the Bundle phase.
- - I run the generated exe...... The typo is still present . In fact the bundle process worked with previous fie version, And on the ThinAir screen the typo appears to be corrected.
so be careful to save all files before Bundle.
In this work the main file is about 300 lines long, and the total of the project is about 10000 lines.
Some of include files are used in another project, this leads to be rigourous in variables names/declarations.
This is my way of working, I guess there are other way of work.
Question to Eros/Petr : Does the pre process of execution could accept conditional pathes as does C preprocessor "IFdefined xxxx then .....
Yann
Bookmarks