[Gambas-user] COBOL and how great it was!
Jussi Lahtinen
jussi.lahtinen at gmail.com
Sat Nov 19 02:17:54 CET 2022
I see... you can use tabs this way:
Print Cust.ID & gb.Tab & Cust.Name & gb.Tab & Cust.Balance & gb.Tab &
Cust.Phone
Many tabs by String(n, gb.Tab). Not very handy though. I think it is best
to write your own function to show things neatly.
See here to learn how to take variable amount of parameters:
http://gambaswiki.org/wiki/comp/gb/param
This would be a nice feature... but I can do it only with C.
Print [0,6,50,70], Cust.ID, Cust.Name, Cust.Balance, Cust.Phone
Jussi
On Sat, Nov 19, 2022 at 2:49 AM BB <adamnt42 at gmail.com> wrote:
>
> 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> 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
>
>
>
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221119/11532d04/attachment.htm>
More information about the User
mailing list