B4J Question How to evaluate functions and / or operations based on the content of an external file at run time?

Gabino A. de la Gala

Active Member
Licensed User
Longtime User
Hi. I am investigating to see what would be the most suitable approach to face this need that I am considering:

I have to print labels on a Zebra printer. The different printing formats of the labels are stored in .frm files in the same folder as the application.

In those files I have the control codes typical of the printer (which are fixed) and interspersed between these control codes I have interleaved fields of the database that I substitute for their values at run time. The fields go to the @FieldName style.

So far so good. The problem arises now that I need to apply functions on some of these fields so that when printing the label they exit correctly. For example, date fields that are stored in ticks in the database, but in the label I have to put them in "human" format. Hence the need that arises from being able to intersperse functions within said format and then make substitutions on the fly.

For example. One of the lines would be: ^ FO25,285 ^ A0,45,30 ^ FDFECHA: DateStr (@DateInTicks, "dd / MM / YYYY") ^ FS

Well the question would be that I made the call to the DateStr function and that it returned me 01/30/2019.

The functions would have to have previously defined in the program so that it knew what operations to do at any time, but that is another battle

Greetings and thank you....
 

Gabino A. de la Gala

Active Member
Licensed User
Longtime User
Upvote 0

wl

Well-Known Member
Licensed User
Longtime User
Hi,

I'm not the writer of the library, but if you download the library you will find an example project. It is in fact a Basic interpreter, so you write the expressions/code/... in a Basic language.
 
Upvote 0
Top