Author Topic: Code-Formatter PB 10  (Read 158586 times)

0 Members and 1 Guest are viewing this topic.

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #195 on: January 14, 2012, 11:16:02 PM »
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

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #196 on: January 15, 2012, 12:24:49 AM »
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
« Last Edit: January 15, 2012, 12:28:14 AM by Peter Weis »

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #197 on: January 15, 2012, 12:47:13 AM »
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.


Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #198 on: January 15, 2012, 10:08:15 PM »
Hallo,

ENUM added in addition. Version 2

greetings Peter


Offline Plamen Chobanov

  • Newbie
  • *
  • Posts: 2
  • User-Rate: +0/-1
Re: Code-Formatter PB 10
« Reply #199 on: January 18, 2012, 09:20:25 PM »
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

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #200 on: January 18, 2012, 11:10:09 PM »
Hello Plamen Chobanov,

thanks that it me on it made attentive.

I will eliminate the error

greetings Peter

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #201 on: January 18, 2012, 11:21:41 PM »
Hello Plamen Chobanov,
 I has it straight tested with me looks so out!

input:
Code: [Select]
LOCAL s AS STRING, s1 AS STRING, s2 AS STRING, _
          n AS LONG, n1 AS LONG

output:

Code: [Select]
    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!
« Last Edit: January 18, 2012, 11:29:17 PM by Peter Weis »

Offline Plamen Chobanov

  • Newbie
  • *
  • Posts: 2
  • User-Rate: +0/-1
Re: Code-Formatter PB 10
« Reply #202 on: January 19, 2012, 01:59:44 PM »
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

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #203 on: January 19, 2012, 06:23:49 PM »
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
Code: [Select]
    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.


             

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #204 on: January 19, 2012, 08:32:45 PM »
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.


Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #205 on: January 19, 2012, 10:50:24 PM »
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!

Code: [Select]
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
« Last Edit: January 19, 2012, 10:57:35 PM by Peter Weis »

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #206 on: January 19, 2012, 11:24:32 PM »
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 

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #207 on: January 20, 2012, 06:39:15 AM »
Hello,
 version 2 changed it with tab goes in such a way!

Greet Peter

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #208 on: January 21, 2012, 12:56:16 AM »
Hello,
 here times a picture of new version V3 beta.

Greet Peter

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 1037
  • User-Rate: +30/-4
    • it-berater
Re: Code-Formatter PB 10
« Reply #209 on: January 21, 2012, 09:52:22 PM »
Looks good to me.
Anyway, the final test is when its ready.