[Gambas-user] COBOL and how great it was!

BB adamnt42 at gmail.com
Sat Nov 19 01:48:26 CET 2022


On 19/11/22 5:15 am, Jussi Lahtinen wrote:
> Sorry, I don't understand the question. There is "print" keyword and 
> the output goes to stdout.
>
> Jussi
>
>
> On Fri, Nov 18, 2022 at 2:23 PM BB <adamnt42 at gmail.com 
> <mailto:adamnt42 at gmail.com>> wrote:
>
>     [junk]
>
>
> No, I'm sorry. I (in a saner frame of mind) actually meant:

surely in this day and age it is possible to come up with "something"  
that would allow use to "Print" a set of stuff to stdout (or wherever) 
/in a formatted set of columns/ rather than a ragged bunch of lines.

By way of example

For each Cust

     Print Cust.ID, Cust.Name, Cust.Balance, Cust.Phone

Next

gives lines like

312	Mary K Jones    350	0423-614-012
472	Jim Bo    75.5	0416-763-274
666	The Devil Incarnate Himself    99.999	0413-100-200
2   Bozo Dog	1.23	0413-627-123

The example is trivial but for longer Print commands it becomes almost 
totally unreadable.

What I'm looking for is a _simple_ way to format the output. Something like

     Print Cust.ID; Tab(6); Cust.Name; Tab(50); Cust.Balance; Tab(70); Cust.Phone
or maybe
     Print [0,6,50,70], Cust.ID, Cust.Name, Cust.Balance, Cust.Phone
where the numbers are the starting position for the next item

that would give

312   Mary K Jones    		     350	0423-614-012
472   Jim Bo                         75.5	0416-763-274
666   The Devil Incarnate Himself    99.999	0413-100-200
2     Bozo Dog			     1.23	0413-627-123

b



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221119/7f82f35e/attachment.htm>


More information about the User mailing list