Wish request / beg to Erel for making layout a text file, json/xml etc. - again

AnandGupta

Expert
Licensed User
Longtime User
We know we have requested / begged to @Erel for making layout a text file, json/xml etc.

The recent post below
highlight how much important it is from us developer of B4X, point of view.

I started developing in C# our company product which is similar to our app in Xbase++ (Clipper/dBase type codes).
I found the the form designer in VS ide is stored in a .designer.cs file which is a plain text file.
After studying this file, I was able to write in Xbase++ code to create a .designer.cs from our entry module in Xbase++.

The above I write just to point that how a simple text file helped me to reduce my work of designing similar form from scratch. In no way I demean Erel's work but want to emphasis that his extra work on layout front will make many of us developers life easier and save many of our debugging hours.

Attached are the two images from Xbase++ and C#.
Czv3pbt5rG.png Ace11_vhnXaicecu.png
 

hatzisn

Expert
Licensed User
Longtime User
I am not sure but I think I read somewhere that B4X layout files are zip files that contain the layout info. Maybe I am mixing two sources in one now but I think this is valid.
 

Sandman

Expert
Licensed User
Longtime User
I am not sure but I think I read somewhere that B4X layout files are zip files that contain the layout info. Maybe I am mixing two sources in one now but I think this is valid.
Erel can answer this best, but I'd say that is wrong. They are in a custom binary format that just gets added during compilation. Meaning the compiler doesn't really do anything with them other than adding them to the resulting executable.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
(The missing warning isn't really related to the file format.)

After studying this file, I was able to write in Xbase++ code to create a .designer.cs from our entry module in Xbase++.
You can do the same with the bal converter tool.

I understand the request, especially with regarding to source control. There are however also advantages to the current format which is more compact and can be read faster than json. C# visual designer generates code that is then compiled. This is not the same process that happens in B4X. The layout files are loaded at runtime.
 

AnandGupta

Expert
Licensed User
Longtime User
I understand the request, especially with regarding to source control. There are however also advantages to the current format which is more compact and can be read faster than json. C# visual designer generates code that is then compiled. This is not the same process that happens in B4X. The layout files are loaded at runtime.
Thanks for the reply.

I am not comparing .Net with B4X and never will. Both are totally different world. I gave it just an example.

Take for example my Merge CSV and Text app,

It is written in AutoHotkey (not important) and the purpose of the app is to create standard prg codes for my different projects in Xbase++ from .prg text template merged from .csv text. I use it to create the standard set of prgs for all my projects. If I decide in new logic, I just change the template and all prgs now generated as required.

I find manipulating text files easier than binary files, even with two way conversion.

My request is to have the layout in text format also. Both files can co exist, since bal converter tool is in B4X, so you can incorporate it better in the ide itself.
Using the tool each time is not efficient way when we are making changes in many layout files.
 

Sagenut

Expert
Licensed User
Longtime User
Maybe the BAL Converter function could be integrated into the Designer, adding into the menù something like
Export as JSON/Text
 

cklester

Well-Known Member
Licensed User
You can do the same with the bal converter tool.

Can that import/export?

There are however also advantages to the current format which is more compact and can be read faster than json.

I suspect most of us would be willing to have a human readable/editable file format in exchange for the current compactness and processing time. The compactness of the layout file probably doesn't matter much to most of us, and the increased processing time from a JSON format couldn't be more than a hundredth of a second, right? I guess it depends on the hardware.

Oh, I forgot about the mobile platforms. Y'all will have to argue about that... :)
 

amorosik

Expert
Licensed User
This is not the same process that happens in B4X. The layout files are loaded at runtime.

Does this mean that the programX could change the layout of programY and that when programY starts it could use the new layout?
 
Top