What is the difference between .bal and .bas files?

gkumar

Active Member
Licensed User
Longtime User
What is the difference between .bal and .bas files?

Correct me if I am wrong.
.bal file is the resource file of each activity which holds all activity designer properties.
.bas file is some intermediate file, which is generated when we compile the code/resource files.
Is it necessary to keep track of the .bas files for each user? For example If I am using some version controlling system, is it necessary to even check-in OR maintain these .bas files?
 

derez

Expert
Licensed User
Longtime User
bas file is where the additional module code is kept. You must keep it as part of the application source code, but it is not separately delivered to the users as it is compiled to the apk file.
 
Upvote 0

gkumar

Active Member
Licensed User
Longtime User
Hi David,
Thanks for the reply.

That means these bas files are no need to be in version control system? Suppose if I am NOT adding these files to the version control system, Then if another developer downloads the code from server, whether it generates the separate .bas files for him? OR do I need to add these .bas files to server first time?
 
Upvote 0

Kevin

Well-Known Member
Licensed User
Longtime User
I'm a little uncertain of what you mean by version control system, but BAS files contain source code for parts of your project.

I am not at my computer to confirm this exactly, but this will hopefully give you the basic idea of it:

The B4A source code for your main activity is contained in the main B4A project file. For every other activity or code module or service module you add to your project, a BAS file is generated that contains the B4A source code for that activity or module. These files are then changed every time you make changes to that activity or module in B4A. They work the same way BAS files work in Visual Basic modules.

If you open the main B4A project file and the BAS files in a text editor such as notepad, it will probably help explain things.
 
Last edited:
Upvote 0

JohnK

Active Member
Licensed User
Longtime User
By version control, he means "source code repository"

And both files need to be kept in your version control. The bal files for my understanding are basically the "visually" drawn interface objects, while the bas files are the code behind and modules.

A quick check of what files would be needed, is to use the "Export as Zip" function on the file menu, and see what it has thrown into the Zip file, and make sure all these files are checked in.
 
Upvote 0

warwound

Expert
Licensed User
Longtime User
In a project the .B4A file contains config info and the code for the Main Activity.

For each code module, service or new Activity a .BAS file is created to contain that code.

So you need to synchronise/monitor B4A and BAS files.

Martin.
 
Upvote 0

gkumar

Active Member
Licensed User
Longtime User
Thanks all for the inputs.

I used 'Export As Zip' from file menu.
As said, we require only one b4a file + .bas files for other activity modules and code modules.
 
Upvote 0
Top