Skip to main content
Hello

I want to use the FORMAT command from TCL for formatting BASIC code.  It works perfectly and formats my code with a margin of 6 spaces and indents of 3 spaces wherever it is needed.

From my dim and distant past, I seem to remember being able to specify a different margin and indent, but I can't remember how to do it.
There doesn't seem to be any command-line option to do this.  My recollection is that to do what I want, I need to update an item in a file with the required margin and indent (perhaps VOC?).

Can anyone help me with this?

Thanks.

Philip

------------------------------
Philip Ellis
Rocket Forum Shared Account
------------------------------
Hello

I want to use the FORMAT command from TCL for formatting BASIC code.  It works perfectly and formats my code with a margin of 6 spaces and indents of 3 spaces wherever it is needed.

From my dim and distant past, I seem to remember being able to specify a different margin and indent, but I can't remember how to do it.
There doesn't seem to be any command-line option to do this.  My recollection is that to do what I want, I need to update an item in a file with the required margin and indent (perhaps VOC?).

Can anyone help me with this?

Thanks.

Philip

------------------------------
Philip Ellis
Rocket Forum Shared Account
------------------------------
You can use AE to edit any item including UniBasic code in Unidata/Universe. Once you are in AE here is the help for FORMAT:
*--: FORMAT
*--: FORMAT -MARGIN 6 -INDENT 3
*--: FOR -M10 -I4
*--: FOR -COMPRESS
*--: FOR -M2 -I2 -NOCASE
*--: FOR -M2 -I2 -INCASE
*--: FOR -M6 -I3 -ALIGN
*--: FOR -M6 -I3 -NOALIGN
*--: FOR -M6 -I3 -ALIGN -ALIGNALL

Posted: 10-20-2022 10:57


------------------------------
Doug Averch
Owner
U2 Logic
www.u2logic.com/tools.html
------------------------------
Hello

I want to use the FORMAT command from TCL for formatting BASIC code.  It works perfectly and formats my code with a margin of 6 spaces and indents of 3 spaces wherever it is needed.

From my dim and distant past, I seem to remember being able to specify a different margin and indent, but I can't remember how to do it.
There doesn't seem to be any command-line option to do this.  My recollection is that to do what I want, I need to update an item in a file with the required margin and indent (perhaps VOC?).

Can anyone help me with this?

Thanks.

Philip

------------------------------
Philip Ellis
Rocket Forum Shared Account
------------------------------
I use it all the time ;)

Top of "TEST" in "KBP", 37 lines, 5
*--: FORMAT -I3 -M6
Margin=6, Indentation=3, -incase
*--:

------------------------------
Kathleen Hambrick
Programmer at Colwell
------------------------------
I use it all the time ;)

Top of "TEST" in "KBP", 37 lines, 5
*--: FORMAT -I3 -M6
Margin=6, Indentation=3, -incase
*--:

------------------------------
Kathleen Hambrick
Programmer at Colwell
------------------------------
Hi Philip!

After some quick poking, on our system (UV 11.3.4 on AIX), the parameters are actually in the source code for the FORMAT command - which is FORMAT.B in the BP file in the UV account. You could tweak those and recompile, but you'd lose them the next time you upgraded. It might be better to make a local version of that program that you can modify at will - and not have it get overwritten in the future.


Brian Paige
Senior Enterprise Systems Engineer

You can use AE to edit any item including UniBasic code in Unidata/Universe. Once you are in AE here is the help for FORMAT:
*--: FORMAT
*--: FORMAT -MARGIN 6 -INDENT 3
*--: FOR -M10 -I4
*--: FOR -COMPRESS
*--: FOR -M2 -I2 -NOCASE
*--: FOR -M2 -I2 -INCASE
*--: FOR -M6 -I3 -ALIGN
*--: FOR -M6 -I3 -NOALIGN
*--: FOR -M6 -I3 -ALIGN -ALIGNALL

Posted: 10-20-2022 10:57


------------------------------
Doug Averch
Owner
U2 Logic
www.u2logic.com/tools.html
------------------------------
The "FORMAT" source code is in the Universe home account  in BP FORMAT.B

Perhaps you can make a change there but i would make a copy of the BP and create your own version so you don't lose changes when you do a universe upgrade.

------------------------------
Greg Livingston
OUTsurance Insurance

------------------------------
Hello

I want to use the FORMAT command from TCL for formatting BASIC code.  It works perfectly and formats my code with a margin of 6 spaces and indents of 3 spaces wherever it is needed.

From my dim and distant past, I seem to remember being able to specify a different margin and indent, but I can't remember how to do it.
There doesn't seem to be any command-line option to do this.  My recollection is that to do what I want, I need to update an item in a file with the required margin and indent (perhaps VOC?).

Can anyone help me with this?

Thanks.

Philip

------------------------------
Philip Ellis
Rocket Forum Shared Account
------------------------------
Thanks for everyone's help - I've got exactly what I need now.

Have a great day!

------------------------------
Philip Ellis
Rocket Forum Shared Account
------------------------------
The "FORMAT" source code is in the Universe home account  in BP FORMAT.B

Perhaps you can make a change there but i would make a copy of the BP and create your own version so you don't lose changes when you do a universe upgrade.

------------------------------
Greg Livingston
OUTsurance Insurance

------------------------------
A late response for extra-credit; here's a format routine that can be handy if you want to have a consistent site wide standard for code - it can be added as a step in a CI/CD pipeline if you want to make sure everyone's code if formatted consistently before checking in/deploying.  Or if you're just really picky about the format of your code :)

https://github.com/ianmcgowan/SCI.BP/blob/master/BFORMAT

It has some personal choices for the way my code should look, e.g. I work on a lot of different client machines, so it's important to me that I can copy and paste code around quickly, which means no blank lines ever.  So this version replaces blank lines with a * to make that easier.  And I never use numeric labels, so don't worry about how they are formatted, but do pay special attention to subroutine labels.  It's a starting point for whatever format you hold most dear :)

------------------------------
Ian McGowan
Principal Consultant
Rocket Forum Shared Account
------------------------------
A late response for extra-credit; here's a format routine that can be handy if you want to have a consistent site wide standard for code - it can be added as a step in a CI/CD pipeline if you want to make sure everyone's code if formatted consistently before checking in/deploying.  Or if you're just really picky about the format of your code :)

https://github.com/ianmcgowan/SCI.BP/blob/master/BFORMAT

It has some personal choices for the way my code should look, e.g. I work on a lot of different client machines, so it's important to me that I can copy and paste code around quickly, which means no blank lines ever.  So this version replaces blank lines with a * to make that easier.  And I never use numeric labels, so don't worry about how they are formatted, but do pay special attention to subroutine labels.  It's a starting point for whatever format you hold most dear :)

------------------------------
Ian McGowan
Principal Consultant
Rocket Forum Shared Account
------------------------------
That's great, Ian, many thanks for posting.

------------------------------
Philip Ellis
Rocket Forum Shared Account
------------------------------