PDA

View Full Version : What do you use thinBasic for?



ErosOlmi
19-01-2023, 14:31
Hi all,

we developed thinBasic to be a general purpose programming language in its Core engine.
But also with some specific vertical implementations with the optional modules programmers can load at runtime in scrips.

We are interested in discovery how thinBasic is mainly used for in order to dedicate more time in improving more what programmers need rather than adding additional general functionalities.

In the company I work for ... me and some colleagues use thinBasic to process many company operations. Some of thinBasic modules where developed because needed here where I work and them become public.

Here some few examples on how we use thinBasic in our company:



warehouse interfaces with carriers
We use many carriers for B2B and B2C order processing. Every carrier has it own data format and its own method to transfer data.
We us thinBasic to get data out of hour warehouse system, every order has it specific carrier, prepare data according to carrier data format and send data using the carrier transfer method.

The script:

check if there are closed shipments in warehouse
collect data, complete data and format data based on carrier requests
send data to carriers based on carrier preferred transfer method


Modules used:

APPCONFIG to store script data like SLQ queries to run, share file paths and any needed parameters in order to never change script only if a parameter must be changed. Script contains the logic and APPCONFIG xml file contains the parameters
APPLOG to log script execution process
ADODB to access SQL databases (MSSQL)
CJSON when carrier data type is JSON
SMTP when carrier transfer method is mail
FTP when carrier transfer method is FTP
and undocumented module called SocketTools used when data transfer is done by SFTP or other SSH methods
Module is undocumented because is a partial wrap of a 3rd party not free library called https://sockettools.com/ for which my company purchased a license an I wrapped the needed functions.
a partial documented module called LibXL used when data to be transferred is in XLSX format
Again this is a 3rd party not free library for which my company purchased a license



delivery note data transfer to customers
Many of our customers have their own system and each of them has it own preferred data formats.
We prepare a script that is able to prepare customer data based on customer preferences.
We have created about 15 different data layout in different file formats.
Every customer interested in having delivery notes data transferred to them has agree one of the already present formats.
With some customers we have prepared a specific format following their requests.
All those information are stored into our legacy system database.

The script:

check if there are delivery notes to communicate to customers having an agreement
prepare data according to customer preferred format
send data to customer via SMTP or FTP, most by SMTP


Modules used:

APPCONFIG to store script data like SLQ queries to run, share file paths and any needed parameters in order to never change script only if a parameter must be changed. Script contains the logic and APPCONFIG xml file contains the parameters
APPLOG to log script execution process
ADODB to access SQL databases (MSSQL)
SMTP when transfer method is mail
FTP when transfer method is FTP
a partial documented module called LibXL used when data to be transferred is in XLSX format
This is a 3rd party not free library for which my company purchased a license



get transactions from bank account for daily payments transactions made in our branded shops
In parallel whit about 4000 multy branded shops to which we sell our products, my company has a a branded channel of franchising shops (about 170) real time connected with our IT infrastructure
Every day final customers purchase our products and made transactions with payments methods that send data to the bank
We have to collect all bank account transactions in order to reconciliate them with data present in our shop system with data present in our legacy system.

The script:

on a daily basis connects to bank REST API
collect account transactions related to shop purchases
store data into legacy system DB to let accounting people reconciliate them


Modules used:

APPCONFIG to store script data like SLQ queries to run, share file paths and any needed parameters in order to never change script only if a parameter must be changed. Script contains the logic and APPCONFIG xml file contains the parameters
APPLOG to log script execution process
ADODB to access SQL databases (MSSQL)
MSXML2 to consume bank REST API
CJSON to interpret bank data and transform into DB data




All thinBasic scripts are more or less complex in the logic but very little and easy to be maintained.

I can go on with many other examples if interested but I'm also interested on how you use thinBasic.
Let us briefly know about you and if there are specific areas not covered by thinBasic.

Thanks
Eros

Petr Schreiber
19-01-2023, 19:32
If I may, I would also like to add a few usecases!

In my career
I consider myself very lucky I had always the opportunity to use thinBasic even to aid my daily work and important tasks at the jobs.

At my first job, we designed a robot to be used as a "virtual hostess".

1. Product visualization for TV screening
Before the robot was finished, we needed to explain/show, what to expect from the final project. A visualization of the model with some fly-by animations and/or "photos" compositing the robot model to real environment were needed to be provided in very swift fashion as new demands/customer presentations appeared.


The script:

​Quick manual composition of the lit model to existing scene from photo, involving matching lightin
Render of animation for TV in given resolution and framerate




Modules used:


​TBGL - as I had export of the robot model from CAD software, I converted it to M15 via OBJ2M15 (https://www.thinbasic.com/community/showthread.php?8585-TBGL-OBJ-to-M15-converter-UPDATED-to-v-1-5&highlight=obj2m15) tool. Ability to load textures and models, and do a basic light setup allowed to setup simple previz




2. Expert system to guard the data
For each event, the robot had to be filled with new data to provide relevant information. As the behaviour and presentation was data-driven, it was critical to keep the input data correct. In order to guard that, I designed an expert system, which evaluated the correctness and gave human readable feedback.



The script:

did not ask user for any input at all, looked in specific dir
evaluated both formal quality of the input media (count, resolution, format)
evaluated the completeness of the data set (is providing map with just 1 marker a good use of the map module? ...)


Modules used:

UI - provided a nice touch interface, which could be used directly on the robot's touch screen
FILE - allowed the data manipulation and handling



In my next jobs, my occupation revolves around design, development and maintenance of test automation framework for desktop apps.

3. System monitoring and warning
Providing an automation platform to a larger, even corporate environment means responsibility to hundreds of users across the globe. How do you know the system is performing well? How is it loaded? Is everything online?
thinBASIC allowed to add a different, simpler perspective on the data already covered by standard tools such as Kibana, Nagios, Grafana...



The script:

had many iterations and shapes, but always offered visual representation of the system
thanks to nice multimedia package thinBasic offers I was able to deliver visual and audio warnings
one script per system, producing easy to read visual info with relevant information presented via status or charts


Modules used:

UI - the Canvas interface is used to produce reusable graphics tiles, displayed then as part of larger HTML displayed on office TV
CURL - allows sending REST API calls and retrieve results
cJSON - allows processing the response from services easily, without need for low level string parsing
INI - introduced as script config before APPCONFIG was developed
early versions also played some wild melodies either from youtube videos or using MIDI commands


4. Resource guarding and releasing
Virtual machine provisioning at large scale brings the necessity to cleanup the resources after some time based on different conditions.



The script:

communicated with relevant backends to monitor their load and release unnecessary resources


Modules used:

CURL - allows sending REST API calls and retrieve results
cJSON - allows processing the response from services easily, without need for low level string parsing
INI - introduced as script config before APPCONFIG was developed



5. Log processing, issue analysis - you name it!
On daily basis I create auxiliary scripts to allow me to easily parse logs from services, search for problems and interesting corelations. Just CORE, CONSOLE, and FILE - but a looot of value!

For more complex tasks I often switch from CONSOLE to UI dialogs, because it does not take much effort to put an UI together. I completely switched from DT module to cDateTime class in Core.

In hobby use

1. Tools for photography
I do take photos daily and as the volumes are high, I create auxiliary scripts to help make the common tasks easy - copying the files from card to a specific file structure? Picking the best photo of the day? thinBasic has me covered :)
Picking the best photo of the day (https://www.youtube.com/watch?v=6v1YD6y8dxY)

I usually use the combination of Console, UI, TBGL, GDIp and of course FILE or even INI module.2. Reverse engineering and game modifications
I did not contact the authors of the games, so I should not say this too loud, but... I use thinBASIC often for data analysis of games I bought and investigating how they work. Usually, I couple it with even some basic MOD tools, allowing to insert textures, models to the games. Besides the obvious FILE, CONSOLE module I would like to mention I love using DIM .. AT to move quickly in data memory to discover interesting bits and patterns, overlay file format headers and so on.

3. Game prototyping
I will probably not find the time and courage to become a full blown game developer, but I continuously work on various graphic demos and game prototypes, for fun. Or... for wedding!

For my wedding I coded a game in 7 days (https://github.com/petrSchreiber/scooteracing), using of course TBGL, TBDI. Designed to use 2 XBOX controllers, it was an opportunity to spend some time with friends, trying to do the best time for the lap :)

I also like a lot the extra functionality in MATH module, especially for graphic demos.

Highlights
There are parts of thinBASIC I use a lot on daily basis, that includes:
- Clipboard_getText - all my work tools use this heavily. Why use UI, or input, if I can consume clipboard immediately
- PARSE, GRAB$ - my friends in many text processing tasks :)
- DIM ... AT - already mentioned, super useful for cases when I need to look at data in different data perspectives - as text, as numbers, ...

My most beloved friends from latest version are:
- CAPPCONFIG - great alternative to INI files I used for years
- CJSON - greatly increased the amount of times I could use thinBASIC in pro-use
- CURL - I especially love its preview ability
- cAppLog - allowed me to leave custom logging UDT

...last but not least, I would like to highlight lesser known ability to design UI in thinAIR using Tools / User Tools / Resource Editor and its easy loading using #resource. Finalizing this and documenting properly will probably invite more people to UI usage.

kcvinu
20-01-2023, 00:57
Hi all,
Glad to hear the new info. It was around 14 months ago I tried ThinBasic for a hobby project. And later I found that, the UDTs ae under construction. So I shelved my project for some time and did some projects in D, Odin & Python. Today I got the facebook notification and I reached here. If UDT feature is updated, I am planning to restart my project.

ErosOlmi
20-01-2023, 16:10
And later I found that, the UDTs ae under construction.

Ciao kcvinu,

can you please remind me about whet stopped on UDT?
Maybe I missed something.

Thanks
Eros

dco045
12-02-2023, 02:07
Hi Eros.

What use of ThinBasic

I use ThinBasic for many little things :


Renaming family of files in a dir by scanning contents.
Translating accented letters from files coming from Mac world :D
Many other one page scripts to do what is boresome to do.
But the main work was to build a cross assembler for an old Cmos µproc I worked with in the years 1977-1980 .
In thes years the telephone industry was introducing µprocessors in new designs. :telephone:
And a few years ago, retired, I found an old development board in my boxes of old stuff. I then decided to give it a new life for fun.

I also build a simulator in TB for this µp. It is funny to see that todays PCs simulating old µp are faster than the original µp.


And many other thing I am not aware of today.

Petr Schreiber
01-05-2023, 21:08
Dany,

thanks a lot for sharing your use case, very cool!

I remember in the past I did an interpreter for HP-42s programmable calculator in thinBASIC - and I also observed I can reach much higher execution speeds than the original 1 MHz machine :)


Petr

dco045
02-05-2023, 20:26
Dany,

thanks a lot for sharing your use case, very cool!

I remember in the past I did an interpreter for HP-42s programmable calculator in thinBASIC - and I also observed I can reach much higher execution speeds than the original 1 MHz machine :)


Petr

Hi Petr,

Shure.

I remember my first job in IT.

Digital Equipments VAX 11/750 0.7 MIPS , licence ULTRIX32 ( Unix derived from 4.2 BSD) 32 users, 4 MByte Ram,, 2x 200MBytes disks.
VT102 consoles, linked at 4800 bps
And users were happy.


I let you guess the year :confused: :comp1:

Cross assembled regards :drink:

Dany

Petr Schreiber
04-05-2023, 21:46
Ho ho,

could it be somewhere between 1985-1990?


Petr

dco045
04-05-2023, 23:07
Hello Petr,

Bravo... :agree: :good: Bravo... :agree: :good: Bravo... :agree: :good:

Exactly this period, and after, we started use of workstations : Digital Equipments with Mips risc processors, HP and Sun with Motorola 68020 68030 and more.
After, HP itanium / Sun sparc

The Vax stayed in use until 1997. Because of softwares never ported to new architectures. It was called : projects retirement home :D

Dany



Ho ho,

could it be somewhere between 1985-1990?


Petr