• Welcome to Theos PowerBasic Museum 2017.

Code-Formatter PB 10

Started by Theo Gottwald, January 18, 2011, 07:58:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Paul Elliott

And just to be picky, YOU were the one that said it caused a problem with
the MACRO line. Nothing about the regular source line where the macro
is used.    ;D

Peter Weis

#196
Hello Paul,
you should look sometimes more deeply purely and not not always only grumble if you the background understands!

I do not have you the opportunity given it to change however you wanted!

You grumble only in this forum at each contribution all the same from whom it are!

Greet Peter

Paul Elliott

Peter,

I don't fully understand what you just said.

But you were the one who said that there was a problem with Macro.
And as you are the one changing the code  I said it was up to you to fix it.
Not really grumbling ... just stating fact.

Here I am just trying to be helpful and my karma points keep getting lower.
Guess I'm going to be going thru a few more rebirths just to break even.

Oh well. So be it.


Peter Weis

Hallo,

ENUM added in addition. Version 2

greetings Peter


Plamen Chobanov

Hello,
i test it !

Source:
LOCAL s AS STRING, s1 AS STRING, s2 AS STRING, _
          n AS LONG, n1 AS LONG


Format:
    LOCAL    s                          AS STRING
    LOCAL    s1                        AS STRING
    LOCAL    s2                        AS STRING
    LOCAL                                  AS LONG
    LOCAL    n1                        AS LONG


___
Plamen

Peter Weis

Hello Plamen Chobanov,

thanks that it me on it made attentive.

I will eliminate the error

greetings Peter

Peter Weis

#201
Hello Plamen Chobanov,
I has it straight tested with me looks so out!

input:

LOCAL s AS STRING, s1 AS STRING, s2 AS STRING, _
          n AS LONG, n1 AS LONG


output:


    LOCAL    s                          AS STRING
    LOCAL    s1                         AS STRING
    LOCAL    s2                         AS STRING
    LOCAL    n                          AS LONG
    LOCAL    n1                         AS LONG       




Can it be it the last version code of the Formater does not have?

Greet Peter

Here is the current version!

Plamen Chobanov

Hello Peter Weis,
I located problem !

In row i have <Tab>=[09]:
hex: 20 5F 0D 0A 09 20 6E 20 41 53
txt:     _  .  .  ?     n     A  S


___
Plamen

Paul Elliott

Peter,

Easy way is to move this line
work = Tab$(work, fo.tabsize)
                                   
from Line2Words to the loop where you load the array in DoFormat

    FileScan fc.fhin, Records To TotalLines                'total source code lines
    ReDim    zText(1 To TotalLines)

    For currentline = 1 To totallines
        Line Input #fc.fhin, ztext(currentline)
    Next


It needs a little changing to work there.

See ... no growling or grumbling.


             

Paul Elliott

Peter,

Plus you can load the array without going thru the loop by

Line Input #fc.fhin, zText() 

and just use the loop to expand the tab characters.


Peter Weis

#205
Hello Paul,
that was also my first thought with TAB$, but formatting must also with Tab in the source code functioning.  And I have that today made additionally I an option inserted. Tabs out pour to code far away!


FOR currentline = 1 TO totallines
        LINE INPUT #fc.fhin, ztext(currentline)
        IF fo.reblacetabs THEN
            ztext(currentline) = TAB$(ztext(currentline), fo.removetabsize)
        END IF
    NEXT



Greet Peter

Peter Weis

Hello Plamen Chobanov,
tomorrow, gets the new version! Thanks still for tap! With me w. the error not arisen, because I did not have a Tab in the source code!

Greet Peter 

Peter Weis

Hello,
version 2 changed it with tab goes in such a way!

Greet Peter

Peter Weis

Hello,
here times a picture of new version V3 beta.

Greet Peter

Theo Gottwald

Looks good to me.
Anyway, the final test is when its ready.