Hi Freaks
I have just managed to integrate my "prettifier" into U10 :-)
At the end, <refresh> is also called (or better set to True) so that the result can be accessed immediately.
The only problem is that the refresh sets the position in the script back to (1,1).
Any idea how to get the current position before the refresh and then set the cursor back to the old position?
Ingo
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
I have been considering a prettifier for a while now... specifically putting an 'end' after every entry/operation/etc.
My though was to do the parse in the xml rather than in the idf. So, an all at once or even an entire application at once.
Is your approach to capture the text in the script window, modify it, and put it back?
------------------------------
Osman Shariff
------------------------------
I have been considering a prettifier for a while now... specifically putting an 'end' after every entry/operation/etc.
My though was to do the parse in the xml rather than in the idf. So, an all at once or even an entire application at once.
Is your approach to capture the text in the script window, modify it, and put it back?
------------------------------
Osman Shariff
------------------------------
My prettifier consist of two parts.
- One to get the context of a trigger and write it back
- Second to prettify a "text"
The first part loops over every possible proc container in component (UFORM,UXGROUP,UXFIELD,*)
For each trigget it reads the content from database, feed the prettier and write back the new content.
This can be done for a list of components (loop over UFORM) or as in UF10, called from the IDE**)
The pretifier itselfs does not know where from the "text" is.
In UF9 (and U10 too) I do have as an addition a simple form with a text field: Paste proc code into it, then press "prettify" and then copy&past it back to any trigger I want e.g. into globale procedures or includes.
*) the list of possible triggers is defined in a table: On part of the a primary key is the uniface version so these loops works in all UnifAce versions
**) As in UF10, every modification in a form is directly stored and commited, I can take the content from database.
Ingo
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
My prettifier consist of two parts.
- One to get the context of a trigger and write it back
- Second to prettify a "text"
The first part loops over every possible proc container in component (UFORM,UXGROUP,UXFIELD,*)
For each trigget it reads the content from database, feed the prettier and write back the new content.
This can be done for a list of components (loop over UFORM) or as in UF10, called from the IDE**)
The pretifier itselfs does not know where from the "text" is.
In UF9 (and U10 too) I do have as an addition a simple form with a text field: Paste proc code into it, then press "prettify" and then copy&past it back to any trigger I want e.g. into globale procedures or includes.
*) the list of possible triggers is defined in a table: On part of the a primary key is the uniface version so these loops works in all UnifAce versions
**) As in UF10, every modification in a form is directly stored and commited, I can take the content from database.
Ingo
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
So, you can choose to prettify the frm in one go if you wanted.... Sounds great
I wrote a simple form too, but so far only to convert old fashioned variable names to camel styling.
------------------------------
Osman Shariff
------------------------------
So, you can choose to prettify the frm in one go if you wanted.... Sounds great
I wrote a simple form too, but so far only to convert old fashioned variable names to camel styling.
------------------------------
Osman Shariff
------------------------------
Hi Osman
Have a look into this thread:
https://community.rocketsoftware.com/discussion/as-there-is-no-wish-list-yet-two-small-wishes
7. RE: As there is no wish list yet :two small wishes :-)
There you find two picture describing a little bit what the tool does
And under
https://community.rocketsoftware.com/discussion/formating-proc-code-how
11. RE: Formating proc code: how?
You will find the definition that I currently use
Ingo
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
Hi Osman
Have a look into this thread:
https://community.rocketsoftware.com/discussion/as-there-is-no-wish-list-yet-two-small-wishes
7. RE: As there is no wish list yet :two small wishes :-)
There you find two picture describing a little bit what the tool does
And under
https://community.rocketsoftware.com/discussion/formating-proc-code-how
11. RE: Formating proc code: how?
You will find the definition that I currently use
Ingo
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
Thanks..... The 'end' thing is exactly what I would like too....
We have many compiler info messages for missing 'end's...
------------------------------
Osman Shariff
------------------------------
So, you can choose to prettify the frm in one go if you wanted.... Sounds great
I wrote a simple form too, but so far only to convert old fashioned variable names to camel styling.
------------------------------
Osman Shariff
------------------------------
Another example:
Before
I "mess up" the operation EXEC
Then I use the action "Prettify"

After
I have to scroll down to "OPERATION EXEC" (that's why I open this thread)
The Operation is prettified :-)

------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
Thanks..... The 'end' thing is exactly what I would like too....
We have many compiler info messages for missing 'end's...
------------------------------
Osman Shariff
------------------------------
Hi Osman
One draw back with my current solution:
The prettifier will insert a END, but ....
But with precompiler directives it is not clear before of after such #-statements.
Oky, I have too much time, I can consider to implement a interpreter for #statements in combination with normal proc code.
The parser/interpreter for #-statements and the normal things currently work more or less independently of each other. The result is 90% correct, but not always.
Ingo
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
Hi Freaks
I have just managed to integrate my "prettifier" into U10 :-)
At the end, <refresh> is also called (or better set to True) so that the result can be accessed immediately.
The only problem is that the refresh sets the position in the script back to (1,1).
Any idea how to get the current position before the refresh and then set the cursor back to the old position?
Ingo
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
Ingo
In uniface 10402 there we have introduced code formatting. See the popup menu in the code editor.
It has all kinds of customization options with the widget properties and the editor setup in the ASN file.
See:
https://docs.rocketsoftware.com/bundle/uniface_104/page/nnv1708416648908.html

Hope this helps.
Jasper de Keijzer
------------------------------
Jasper DeKeijzer
Rocket Internal - All Brands
------------------------------
Ingo
In uniface 10402 there we have introduced code formatting. See the popup menu in the code editor.
It has all kinds of customization options with the widget properties and the editor setup in the ASN file.
See:
https://docs.rocketsoftware.com/bundle/uniface_104/page/nnv1708416648908.html

Hope this helps.
Jasper de Keijzer
------------------------------
Jasper DeKeijzer
Rocket Internal - All Brands
------------------------------
Is there an insert 'end' in the formatting document function .... That would be a No1 priority for many having migrated.
------------------------------
Osman Shariff
------------------------------
Ingo
In uniface 10402 there we have introduced code formatting. See the popup menu in the code editor.
It has all kinds of customization options with the widget properties and the editor setup in the ASN file.
See:
https://docs.rocketsoftware.com/bundle/uniface_104/page/nnv1708416648908.html

Hope this helps.
Jasper de Keijzer
------------------------------
Jasper DeKeijzer
Rocket Internal - All Brands
------------------------------
Hi Jasper
I know and die already test it.
The advantgae of the UnifAce solutaion is, that it is inside the editor.
But that does not checkif the code is "well formed" and mabe correct it (see in thread the discusion about missing 'END')
And my code does also a liitle bit of extra as it add cooments to the END, Upper/lowercase statements
Before
TrIggEr WORLD
IF (1)
; a comment
CALL hello
goto TAG_XYZ
EndIf
TAG_xyz:
UnifAce
TrIggEr WORLD
IF (1)
; a comment
CALL hello
goto TAG_XYZ
EndIf
TAG_xyz:
Our prettifier
TRIGGER WORLD
IF(1)
; a comment
call hello
goto TAG_XYZ
ENDIF
TAG_xyz:
END ; WORLD
And as already said, I can loop over components and all triggers in the component.
So if I want to (and my colleagues allow it), I'll have a cleanly formatted application in a few hours
Oh yes, another huge advantage. I can change the algorithm myself and add new "gimmicks" :-)
Ingo
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
Ingo
In uniface 10402 there we have introduced code formatting. See the popup menu in the code editor.
It has all kinds of customization options with the widget properties and the editor setup in the ASN file.
See:
https://docs.rocketsoftware.com/bundle/uniface_104/page/nnv1708416648908.html

Hope this helps.
Jasper de Keijzer
------------------------------
Jasper DeKeijzer
Rocket Internal - All Brands
------------------------------
BTW
Before
trigger X
if (1)
elseif(2)
endif
else
endif
UnifAce
trigger X
if (1)
elseif(2)
endif
else
endif
ProFund
TRIGGER X
IF(1)
ELSEIF(2)
ENDIF
;*** WARNING:'ELSE' hat keinen passenden Begin
ELSE
;*** WARNING:'ENDIF' hat keinen passenden Begin
ENDIF
END ; X
And in the message lines of the prettifier
Programmcode fehlerhaft: ELSE hat keinen passenden Beginn (Zeile=5)
Programmcode fehlerhaft: ENDIF hat keinen passenden Beginn (Zeile=7)
Faulty programme code: ELSE has no matching start (line=5)
Faulty programme code: ENDIF has no matching start (line=7)
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
Ingo
In uniface 10402 there we have introduced code formatting. See the popup menu in the code editor.
It has all kinds of customization options with the widget properties and the editor setup in the ASN file.
See:
https://docs.rocketsoftware.com/bundle/uniface_104/page/nnv1708416648908.html

Hope this helps.
Jasper de Keijzer
------------------------------
Jasper DeKeijzer
Rocket Internal - All Brands
------------------------------
if anyone wants a little insight into the Prettifier's approach :-)
This a run on a test-script (under 'Vorher')
The run doesn't take a second
At the end under 'Nacher' you can find the result
IP1109T : ---------------------------------------------- Vorher -----------------------------------------------
ELSE
FORENTITY "hello"
WHILE
IF
END
ENTRY X
FORENTITY "hello"
WHILE
IF
END
IP1109T : -----------------------------------------------------------------------------------------------------
IP1109T : --------------------------------------- Start 'PHASE Parse 1' ---------------------------------------
IP1109T : TOK1_BEG=1,TOK1_END=4,TOK2_BEG=0,TOK2_END=0,BRACKET_END=0,STMT_END=4,COMMENT=0
IP1109T : 'ELSE'
IP1109T : t1b ^
IP1109T : t1e ^
IP1109T : se ^
IP1109T : VERB='ELSE',BL1=0,BL2=0
+[ 1- ] C ELSE (±1) (0)'ELSE' ('V3=MV5=I*ULC=1SEP=1')
IP1109T : TOK1_BEG=1,TOK1_END=9,TOK2_BEG=17,TOK2_END=0,BRACKET_END=0,STMT_END=17,COMMENT=0
IP1109T : 'FORENTITY "hello"'
IP1109T : t1b ^
IP1109T : t1e ^
IP1109T : t2b ^
IP1109T : se ^
IP1109T : VERB='FORENTITY',BL1=0,BL2=0
+[ 2- ] C FORENTITY (+1) (0)'FORENTITY "hello"' ('V3=BV5=F*ULC=1SEP=1')
IP1109T : TOK1_BEG=1,TOK1_END=5,TOK2_BEG=0,TOK2_END=0,BRACKET_END=0,STMT_END=5,COMMENT=0
IP1109T : 'WHILE'
IP1109T : t1b ^
IP1109T : t1e ^
IP1109T : se ^
IP1109T : VERB='WHILE',BL1=0,BL2=0
+[ 3- ] C WHILE (+1) (0)'WHILE' ('V3=BV5=W*ULC=1SEP=1')
IP1109T : TOK1_BEG=1,TOK1_END=2,TOK2_BEG=0,TOK2_END=0,BRACKET_END=0,STMT_END=2,COMMENT=0
IP1109T : 'IF'
IP1109T : t1b ^
IP1109T : t1e ^
IP1109T : se ^
IP1109T : VERB='IF',BL1=0,BL2=0
+[ 4- ] C IF (+1) (0)'IF' ('V3=BV5=I*ULC=1SEP=1')
IP1109T : TOK1_BEG=1,TOK1_END=3,TOK2_BEG=0,TOK2_END=0,BRACKET_END=0,STMT_END=3,COMMENT=0
IP1109T : 'END'
IP1109T : t1b ^
IP1109T : t1e ^
IP1109T : se ^
IP1109T : VERB='END',BL1=0,BL2=0
+[ 5- ] C END (10) (0)'END' ('V3=EV5=E*ULC=USEP=T')
IP1109T : TOK1_BEG=1,TOK1_END=5,TOK2_BEG=7,TOK2_END=0,BRACKET_END=0,STMT_END=7,COMMENT=0
IP1109T : 'ENTRY X'
IP1109T : t1b ^
IP1109T : t1e ^
IP1109T : t2b ^
IP1109T : se ^
IP1109T : VERB='ENTRY',BL1=0,BL2=0
+[ 6- ] C ENTRY (01) (0)'ENTRY X' ('V3=BV5=E*ULC=USEP=TNAM=X')
IP1109T : TOK1_BEG=1,TOK1_END=9,TOK2_BEG=17,TOK2_END=0,BRACKET_END=0,STMT_END=17,COMMENT=0
IP1109T : 'FORENTITY "hello"'
IP1109T : t1b ^
IP1109T : t1e ^
IP1109T : t2b ^
IP1109T : se ^
IP1109T : VERB='FORENTITY',BL1=0,BL2=0
+[ 7- ] C FORENTITY (+1) (0)'FORENTITY "hello"' ('V3=BV5=F*ULC=1SEP=1')
IP1109T : TOK1_BEG=1,TOK1_END=5,TOK2_BEG=0,TOK2_END=0,BRACKET_END=0,STMT_END=5,COMMENT=0
IP1109T : 'WHILE'
IP1109T : t1b ^
IP1109T : t1e ^
IP1109T : se ^
IP1109T : VERB='WHILE',BL1=0,BL2=0
+[ 8- ] C WHILE (+1) (0)'WHILE' ('V3=BV5=W*ULC=1SEP=1')
IP1109T : TOK1_BEG=1,TOK1_END=2,TOK2_BEG=0,TOK2_END=0,BRACKET_END=0,STMT_END=2,COMMENT=0
IP1109T : 'IF'
IP1109T : t1b ^
IP1109T : t1e ^
IP1109T : se ^
IP1109T : VERB='IF',BL1=0,BL2=0
+[ 9- ] C IF (+1) (0)'IF' ('V3=BV5=I*ULC=1SEP=1')
IP1109T : TOK1_BEG=1,TOK1_END=3,TOK2_BEG=0,TOK2_END=0,BRACKET_END=0,STMT_END=3,COMMENT=0
IP1109T : 'END'
IP1109T : t1b ^
IP1109T : t1e ^
IP1109T : se ^
IP1109T : VERB='END',BL1=0,BL2=0
+[ 10- ] C END (10) (0)'END' ('V3=EV5=E*ULC=USEP=T')
IP1109T : ---------------------------------------- End 'PHASE Parse 1' ----------------------------------------
IP1109T : --------------------------------------- Start 'PHASE Parse 2' ---------------------------------------
IP1109T : Erste Programmzeile ist kein ENTRY-Statement -> Dummy-Entry-Start einfügen
1 +[ 1- ] C *DY_ENTRY (01) (0)'' ('V3=BV5=E*NAM=*TRIGGER_NAM')
Stack-Peek:Kein Element auf dem Stack
Stack[ 1]+='V5=E*V=*DY_ENTRYLS=1NAM=*TRIGGER_NAM'
1 2 <~[ 1- ] (0)''
1 2 < [ 1-1] C *DY_ENTRY (01) (0)'' ('V3=BV5=E*NAM=*TRIGGER_NAMLX=1')
Stack[ 1] ='V5=E*V=*DY_ENTRYLS=1NAM=*TRIGGER_NAM'
IP1109T : --- ---
IP1109T : Programmcode fehlerhaft: ELSE hat keinen passenden Beginn (Zeile=2)
IP1109T : [1]
IP1109T : >[2] ELSE
IP1109T : [3] FORENTITY "hello"
IP1109T : [4] WHILE
IP1109T : [5] IF
IP1109T : -------------------
1 +[ 2- ] ; ;1 (0R) (0)'' (0);'*** WARNING:'ELSE' hat keinen passenden Begin'
1 2 . [ 2- ] ; ;1 (0R) (0)'' (0);'*** WARNING:'ELSE' hat keinen passenden Begin'
1 <~[ 3- ] (0)''
1 < [ 3- ] C ELSE (±1) (0)'ELSE' ('V3=MV5=I*ULC=1SEP=1LX=1')
Stack[ 2]+='V5=F*V=FORENTITYLS=4'
1 <~[ 4- ] (0)''
1 < [ 4-2] C FORENTITY (+1) (0)'FORENTITY "hello"' ('V3=BV5=F*ULC=1SEP=1LX=1')
Stack[ 3]+='V5=W*V=WHILELS=5'
1 <~[ 5- ] (0)''
1 < [ 5-3] C WHILE (+1) (0)'WHILE' ('V3=BV5=W*ULC=1SEP=1LX=1')
Stack[ 4]+='V5=I*V=IFLS=6'
1 <~[ 6- ] (0)''
1 < [ 6-4] C IF (+1) (0)'IF' ('V3=BV5=I*ULC=1SEP=1LX=1')
Stack[ 4] ='V5=I*V=IFLS=6'
IP1109T : --- ---
IP1109T : Nicht abgeschlossenes 'IF' aus Zeile 6
IP1109T : [3] ELSE
IP1109T : [4] FORENTITY "hello"
IP1109T : [5] WHILE
IP1109T : >[6] IF
IP1109T : >[7] END
IP1109T : [8] ENTRY X
IP1109T : [9] FORENTITY "hello"
IP1109T : [10] WHILE
IP1109T : -------------------
1 +[ 7- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 6'
1 2 . [ 7- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 6'
Stack[ 4]-='V5=I*V=IFLS=6'
IP1109T : :Nicht abgeschlossenes (V5=I*V=IFLS=6)
Stack[ 3] ='V5=W*V=WHILELS=5'
IP1109T : --- ---
IP1109T : Nicht abgeschlossenes 'WHILE' aus Zeile 5
IP1109T : [2] ; *** WARNING:'ELSE' hat keinen passenden Begin
IP1109T : [3] ELSE
IP1109T : [4] FORENTITY "hello"
IP1109T : >[5] WHILE
IP1109T : [6] IF
IP1109T : >[7] ; *** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 6
IP1109T : [8] END
IP1109T : [9] ENTRY X
IP1109T : [10] FORENTITY "hello"
IP1109T : -------------------
1 +[ 8- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 5'
1 2 . [ 8- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 5'
Stack[ 3]-='V5=W*V=WHILELS=5'
IP1109T : :Nicht abgeschlossenes (V5=W*V=WHILELS=5)
Stack[ 2] ='V5=F*V=FORENTITYLS=4'
IP1109T : --- ---
IP1109T : Nicht abgeschlossenes 'FORENTITY' aus Zeile 4
IP1109T : [1]
IP1109T : [2] ; *** WARNING:'ELSE' hat keinen passenden Begin
IP1109T : [3] ELSE
IP1109T : >[4] FORENTITY "hello"
IP1109T : [5] WHILE
IP1109T : [6] IF
IP1109T : >[7] ; *** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 6
IP1109T : [8] ; *** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 5
IP1109T : [9] END
IP1109T : [10] ENTRY X
IP1109T : -------------------
1 +[ 9- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'FORENTITY' aus Zeile 4'
1 2 . [ 9- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'FORENTITY' aus Zeile 4'
Stack[ 2]-='V5=F*V=FORENTITYLS=4'
IP1109T : :Nicht abgeschlossenes (V5=F*V=FORENTITYLS=4)
Stack[ 1] ='V5=E*V=*DY_ENTRYLS=1NAM=*TRIGGER_NAM'
1 ~[ 1-1] C *DY_ENTRY 10 (01) (0)'' ('V3=BV5=E*NAM=*TRIGGER_NAMLX=1')
Stack[ 1]-='V5=E*V=*DY_ENTRYLS=1NAM=*TRIGGER_NAM'
1 <~[ 10- ] (0)''
1 < [ 10- ] C END ^1 (10) (0)'END' ('V3=EV5=E*ULC=USEP=TLX=1')
Stack-Peek:Kein Element auf dem Stack
1 +[ 11- ] - - (0R) (0)'' ('DSC=Leerzeile')
1 2 . [ 11- ] - - (0R) (0)'' ('DSC=Leerzeile')
1 +[ 12- ] - - (0R) (0)'' ('DSC=Leerzeile')
1 2 . [ 12- ] - - (0R) (0)'' ('DSC=Leerzeile')
Stack[ 1]+='V5=E*V=ENTRYLS=13NAM=X'
1 <~[ 13- ] (0)''
1 < [ 13-1] C ENTRY (01) (0)'ENTRY X' ('V3=BV5=E*ULC=USEP=TNAM=XLX=13')
Stack[ 2]+='V5=F*V=FORENTITYLS=14'
1 <~[ 14- ] (0)''
1 < [ 14-2] C FORENTITY (+1) (0)'FORENTITY "hello"' ('V3=BV5=F*ULC=1SEP=1LX=13')
Stack[ 3]+='V5=W*V=WHILELS=15'
1 <~[ 15- ] (0)''
1 < [ 15-3] C WHILE (+1) (0)'WHILE' ('V3=BV5=W*ULC=1SEP=1LX=13')
Stack[ 4]+='V5=I*V=IFLS=16'
1 <~[ 16- ] (0)''
1 < [ 16-4] C IF (+1) (0)'IF' ('V3=BV5=I*ULC=1SEP=1LX=13')
Stack[ 4] ='V5=I*V=IFLS=16'
IP1109T : --- ENTRY X ---
IP1109T : Nicht abgeschlossenes 'IF' aus Zeile 16
IP1109T : [13] ENTRY X
IP1109T : [14] FORENTITY "hello"
IP1109T : [15] WHILE
IP1109T : >[16] IF
IP1109T : >[17] END
IP1109T : -------------------
1 +[ 17- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 16'
1 2 . [ 17- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 16'
Stack[ 4]-='V5=I*V=IFLS=16'
IP1109T : :Nicht abgeschlossenes (V5=I*V=IFLS=16)
Stack[ 3] ='V5=W*V=WHILELS=15'
IP1109T : --- ENTRY X ---
IP1109T : Nicht abgeschlossenes 'WHILE' aus Zeile 15
IP1109T : [12]
IP1109T : [13] ENTRY X
IP1109T : [14] FORENTITY "hello"
IP1109T : >[15] WHILE
IP1109T : [16] IF
IP1109T : >[17] ; *** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 16
IP1109T : [18] END
IP1109T : -------------------
1 +[ 18- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 15'
1 2 . [ 18- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 15'
Stack[ 3]-='V5=W*V=WHILELS=15'
IP1109T : :Nicht abgeschlossenes (V5=W*V=WHILELS=15)
Stack[ 2] ='V5=F*V=FORENTITYLS=14'
IP1109T : --- ENTRY X ---
IP1109T : Nicht abgeschlossenes 'FORENTITY' aus Zeile 14
IP1109T : [11]
IP1109T : [12]
IP1109T : [13] ENTRY X
IP1109T : >[14] FORENTITY "hello"
IP1109T : [15] WHILE
IP1109T : [16] IF
IP1109T : >[17] ; *** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 16
IP1109T : [18] ; *** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 15
IP1109T : [19] END
IP1109T : -------------------
1 +[ 19- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'FORENTITY' aus Zeile 14'
1 2 . [ 19- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'FORENTITY' aus Zeile 14'
Stack[ 2]-='V5=F*V=FORENTITYLS=14'
IP1109T : :Nicht abgeschlossenes (V5=F*V=FORENTITYLS=14)
Stack[ 1] ='V5=E*V=ENTRYLS=13NAM=X'
1 ~[ 13-1] C ENTRY 20 (01) (0)'ENTRY X' ('V3=BV5=E*ULC=USEP=TNAM=XLX=13')
Stack[ 1]-='V5=E*V=ENTRYLS=13NAM=X'
1 <~[ 20- ] (0)''
1 < [ 20- ] C END ^13 (10) (0)'END' ('V3=EV5=E*ULC=USEP=TLX=13')
Stack-Peek:Kein Element auf dem Stack
Stack-Peek:Kein Element auf dem Stack
IP1109T : ---------------------------------------- End 'PHASE Parse 2' ----------------------------------------
IP1109T : ============================================= LD-Liste ==============================================
[ 1-1] C *DY_ENTRY 10 (01) (0)'' ('V3=BV5=E*NAM=*TRIGGER_NAMLX=1')
[ 2- ] ; ;1 (0R) (0)'' (0);'*** WARNING:'ELSE' hat keinen passenden Begin'
[ 3- ] C ELSE (±1) (0)'ELSE' ('V3=MV5=I*ULC=1SEP=1LX=1')
[ 4-2] C FORENTITY (+1) (0)'FORENTITY "hello"' ('V3=BV5=F*ULC=1SEP=1LX=1')
[ 5-3] C WHILE (+1) (0)'WHILE' ('V3=BV5=W*ULC=1SEP=1LX=1')
[ 6-4] C IF (+1) (0)'IF' ('V3=BV5=I*ULC=1SEP=1LX=1')
[ 7- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 6'
[ 8- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 5'
[ 9- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'FORENTITY' aus Zeile 4'
[ 10- ] C END ^1 (10) (0)'END' ('V3=EV5=E*ULC=USEP=TLX=1')
[ 11- ] - - (0R) (0)'' ('DSC=Leerzeile')
[ 12- ] - - (0R) (0)'' ('DSC=Leerzeile')
[ 13-1] C ENTRY 20 (01) (0)'ENTRY X' ('V3=BV5=E*ULC=USEP=TNAM=XLX=13')
[ 14-2] C FORENTITY (+1) (0)'FORENTITY "hello"' ('V3=BV5=F*ULC=1SEP=1LX=13')
[ 15-3] C WHILE (+1) (0)'WHILE' ('V3=BV5=W*ULC=1SEP=1LX=13')
[ 16-4] C IF (+1) (0)'IF' ('V3=BV5=I*ULC=1SEP=1LX=13')
[ 17- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 16'
[ 18- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 15'
[ 19- ] ; ;1 (0R) (0)'' (0);'*** ERROR:Nicht abgeschlossenes 'FORENTITY' aus Zeile 14'
[ 20- ] C END ^13 (10) (0)'END' ('V3=EV5=E*ULC=USEP=TLX=13')
IP1109T : =====================================================================================================
IP1109T : --------------------------------------- Start 'PHASE Format' ----------------------------------------
FMT[ 1-1>0] C *DY_ENTRY : 0+1000=0 + 1= 1: ''
FMT[ 2- >0] ; ;1 : 1+1000=0 +2000= 1: ''
IP1109T : FMTP[1/1][0,0] ='' [0] ='*** WARNING:'ELSE' hat keinen passenden Begin'
FMT[ 3- >0] C ELSE : 1+ -1=0 + 1= 1: 'ELSE'
IP1109T : FMTP[1/1][0,0] ='ELSE' [0] =''
FMT[ 4-2>1] C FORENTITY : 1+ =1 + 1= 2: 'FORENTITY "hello"'
IP1109T : FMTP[1/1][2,0] ='FORENTITY "hello"' [0] =''
FMT[ 5-3>2] C WHILE : 2+ =2 + 1= 3: 'WHILE'
IP1109T : FMTP[1/1][4,0] ='WHILE' [0] =''
FMT[ 6-4>3] C IF : 3+ =3 + 1= 4: 'IF'
IP1109T : FMTP[1/1][6,0] ='IF' [0] =''
FMT[ 7- >0] ; ;1 : 4+1000=0 +2000= 4: ''
IP1109T : FMTP[1/1][0,0] ='' [0] ='*** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 6'
FMT[ 8- >0] ; ;1 : 4+1000=0 +2000= 4: ''
IP1109T : FMTP[1/1][0,0] ='' [0] ='*** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 5'
FMT[ 9- >0] ; ;1 : 4+1000=0 +2000= 4: ''
IP1109T : FMTP[1/1][0,0] ='' [0] ='*** ERROR:Nicht abgeschlossenes 'FORENTITY' aus Zeile 4'
FMT[ 10- >0] C END : 4+1000=0 +1000= 0: 'END'
IP1109T : FMTP[1/1][0,0] ='END' [0] =''
FMT[ 11- >0] - - : 0+1000=0 +2000= 0: ''
IP1109T : FMTP[1/1][0,0] ='' [0] =''
FMT[ 12- >0] - - : 0+1000=0 +2000= 0: ''
IP1109T : FMTP[1/1][0,0] ='' [0] =''
FMT[ 13-1>0] C ENTRY : 0+1000=0 + 1= 1: 'ENTRY X'
IP1109T : FMTP[1/1][0,0] ='ENTRY X' [0] =''
FMT[ 14-2>1] C FORENTITY : 1+ =1 + 1= 2: 'FORENTITY "hello"'
IP1109T : FMTP[1/1][2,0] ='FORENTITY "hello"' [0] =''
FMT[ 15-3>2] C WHILE : 2+ =2 + 1= 3: 'WHILE'
IP1109T : FMTP[1/1][4,0] ='WHILE' [0] =''
FMT[ 16-4>3] C IF : 3+ =3 + 1= 4: 'IF'
IP1109T : FMTP[1/1][6,0] ='IF' [0] =''
FMT[ 17- >0] ; ;1 : 4+1000=0 +2000= 4: ''
IP1109T : FMTP[1/1][0,0] ='' [0] ='*** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 16'
FMT[ 18- >0] ; ;1 : 4+1000=0 +2000= 4: ''
IP1109T : FMTP[1/1][0,0] ='' [0] ='*** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 15'
FMT[ 19- >0] ; ;1 : 4+1000=0 +2000= 4: ''
IP1109T : FMTP[1/1][0,0] ='' [0] ='*** ERROR:Nicht abgeschlossenes 'FORENTITY' aus Zeile 14'
FMT[ 20- >0] C END : 4+1000=0 +1000= 0: 'END'
IP1109T : FMTP[1/1][0,0] ='END' [1] =' X'
IP1109T : ---------------------------------------- End 'PHASE Format' -----------------------------------------
IP1109T : ---------------------------------------------- Nachher ----------------------------------------------
;*** WARNING:'ELSE' hat keinen passenden Begin
ELSE
FORENTITY "hello"
WHILE
IF
;*** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 6
;*** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 5
;*** ERROR:Nicht abgeschlossenes 'FORENTITY' aus Zeile 4
END
ENTRY X
FORENTITY "hello"
WHILE
IF
;*** ERROR:Nicht abgeschlossenes 'IF' aus Zeile 16
;*** ERROR:Nicht abgeschlossenes 'WHILE' aus Zeile 15
;*** ERROR:Nicht abgeschlossenes 'FORENTITY' aus Zeile 14
END ; X
IP1109T : -----------------------------------------------------------------------------------------------------
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
Ingo
In uniface 10402 there we have introduced code formatting. See the popup menu in the code editor.
It has all kinds of customization options with the widget properties and the editor setup in the ASN file.
See:
https://docs.rocketsoftware.com/bundle/uniface_104/page/nnv1708416648908.html

Hope this helps.
Jasper de Keijzer
------------------------------
Jasper DeKeijzer
Rocket Internal - All Brands
------------------------------
I think what is really needed is a detailed preferences screen that can be adapted to a companies standards... I can imagine it becoming rather complicated.
The reality is indentation is probably already correct so rather a nice to have.
My top 5 in order would be:
1) 'end' correcting
2) Camel case Variables
3) Convert depreciated functions
4) Indentation
5) removal of non referenced variables
------------------------------
Osman Shariff
------------------------------
I think what is really needed is a detailed preferences screen that can be adapted to a companies standards... I can imagine it becoming rather complicated.
The reality is indentation is probably already correct so rather a nice to have.
My top 5 in order would be:
1) 'end' correcting
2) Camel case Variables
3) Convert depreciated functions
4) Indentation
5) removal of non referenced variables
------------------------------
Osman Shariff
------------------------------
Hi Osman
[Sorry I didn't get in touch sooner, I was in hospital for a short time :-) ]
1) 'end' correcting
Possible as shown
2) Camel case Variables
How to do this?
How is a tool supposed to know what "syllables" are in the variable name and which of them should be capitalized?
BTW: I don't use camel case but underlines to separate parts.
Everything in capital letters, but often with three-letter abbreviations
I have based this a little on the AS/400 syntax :-)
3) Convert depreciated functions
Not an easy task
I did try this with "run" -> "activate"
But first you have to find "run" (don't believe if the first characters are "r","u","n" it is a "run" as it could also by a tag)
And then the problem with switches for "run" resp. "activate"
And sometimes there is no direct conterpart of the depricated one
4) Indentation
yes, it is possible and you can configure a whole lot.
Maybe I should make my hardwired list of statements manageable via an interface :-)
5) removal of non referenced variables
Nice idea but ...
First it is to discuss which varvles you mean
That on on component level or procedure level?
On component level you have to consider include proc code and globale procedures.
In both cases, it is not enough to search only in the componente itself. For includes, the program must be compiled and UXCROSS must be used to determine whether the variable is still required. For global procedures, ALL (i.e. also recursively) possibly called procedures must be checked for global variable
And then there are the pre processor directives, so for on complitaion with define A a variable ist not in user but with define B
** new ideas regarding formating resp. the proceditor ***
6) inline directives for formating
Like
##formating_config xyz to define a named set of settings
##formating on/off to start/end of formating
...
7) Nice to have "brackets"
At the moment there is only the option to expand or collapse rows with +/- on the left edge.
It would be nice if you could also see graphically which start-line belong to which end-line.
And also display all gotos with vertical lines to display "spaghetti code". -)
(The frame can be enlarged/reduced using a slider)
8) highlight any select text
Whenever in the proc-editor you select a text highlight this and all other occurences.
This is interesting if you want to know where a varaible has hidden itself everywhere
...
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
Hi Osman
[Sorry I didn't get in touch sooner, I was in hospital for a short time :-) ]
1) 'end' correcting
Possible as shown
2) Camel case Variables
How to do this?
How is a tool supposed to know what "syllables" are in the variable name and which of them should be capitalized?
BTW: I don't use camel case but underlines to separate parts.
Everything in capital letters, but often with three-letter abbreviations
I have based this a little on the AS/400 syntax :-)
3) Convert depreciated functions
Not an easy task
I did try this with "run" -> "activate"
But first you have to find "run" (don't believe if the first characters are "r","u","n" it is a "run" as it could also by a tag)
And then the problem with switches for "run" resp. "activate"
And sometimes there is no direct conterpart of the depricated one
4) Indentation
yes, it is possible and you can configure a whole lot.
Maybe I should make my hardwired list of statements manageable via an interface :-)
5) removal of non referenced variables
Nice idea but ...
First it is to discuss which varvles you mean
That on on component level or procedure level?
On component level you have to consider include proc code and globale procedures.
In both cases, it is not enough to search only in the componente itself. For includes, the program must be compiled and UXCROSS must be used to determine whether the variable is still required. For global procedures, ALL (i.e. also recursively) possibly called procedures must be checked for global variable
And then there are the pre processor directives, so for on complitaion with define A a variable ist not in user but with define B
** new ideas regarding formating resp. the proceditor ***
6) inline directives for formating
Like
##formating_config xyz to define a named set of settings
##formating on/off to start/end of formating
...
7) Nice to have "brackets"
At the moment there is only the option to expand or collapse rows with +/- on the left edge.
It would be nice if you could also see graphically which start-line belong to which end-line.
And also display all gotos with vertical lines to display "spaghetti code". -)
(The frame can be enlarged/reduced using a slider)
8) highlight any select text
Whenever in the proc-editor you select a text highlight this and all other occurences.
This is interesting if you want to know where a varaible has hidden itself everywhere
...
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------
I hope you are feeling better Ingo
I wrote a simple camelcase conversion which works for the specific cases we have. Since uniface v9 I am a camel case fan :-)
Got to keep up with the youth ;-)
The deprecation would be the simple ones like $formname -> $instancename etc
In general I think it will take effort to write a remove the 'end' from scratch. it is something that makes the compilation log unreadable. So, I see it as a must have.
non referenced variables are a pet hate of mine and so removal should be easy as uniface already knows them, so it might as well be removed.
A prettify function can have unforseen results such as in the cases you mentioned. I am guessing that is why uniface and me, have not undertaken the task yet :-D
------------------------------
Osman Shariff
------------------------------
I hope you are feeling better Ingo
I wrote a simple camelcase conversion which works for the specific cases we have. Since uniface v9 I am a camel case fan :-)
Got to keep up with the youth ;-)
The deprecation would be the simple ones like $formname -> $instancename etc
In general I think it will take effort to write a remove the 'end' from scratch. it is something that makes the compilation log unreadable. So, I see it as a must have.
non referenced variables are a pet hate of mine and so removal should be easy as uniface already knows them, so it might as well be removed.
A prettify function can have unforseen results such as in the cases you mentioned. I am guessing that is why uniface and me, have not undertaken the task yet :-D
------------------------------
Osman Shariff
------------------------------
I hope you are feeling better Ingo
It was "only" a heart check-up (cardiac catheterization due to a => https://en.wikipedia.org/wiki/Left_bundle_branch_block).
I will no more become an athlete as I was so looking forward to the Olympic Games 2100 *grin*
But apart from that it actually looks quite good :-)
------------------------------
Ingo Stiller
Aareon Deutschland GmbH
------------------------------