Simplicty and flexibility!


New Function in 8 - FixedWidth() - Return a blank padded, positioned String (Ver. 8.0.0.1325)

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

New Function in 8 - FixedWidth() - Return a blank padded, positioned String (Ver. 8.0.0.1325)

The DOS retro implementations in DE8 is not yet over. Today we released FixedWidth() which is a string function to help build text documents easier.

FixedWidth(Value,Position,Length) will return a string Length long with Value positioned either Left (Default), Center or Right

0=Left (Default)
1=Center
2=Right

Here we see a Console example where we have generated an output to console (screen print).

For the details and labels we use FixedWidth to get the columns correctly.

We see that the numbers are right oriented and the Text are left oriented.

This is the code for generating one detail line:

retval := ConsoleCopy( concat(FixedWidth(productNr, 0,15) ,FixedWidth(Description, 0,29), FixedWidth(Prices, 2,10), FixedWidth(Count ,2,5),FixedWidth(Total, 2,10)), 4+0) .

As we see the formatting is much simpler than what we would have had to do with "traditional functions".

retval := WriteToFile(concat(productNr,chr(9),firstc(concat(Description,spacer),30),chr(9),lastc(concat(spacer,Prices),8),chr(9),lastc(concat(spacer,Count ),3),chr(9),lastc(concat(spacer,Total),10)),data-entry field2, 4) .


Written by DataEase 08/07/13 at 12:20:13 Dataease [{8}]FIVE