TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: rik on August 10, 2011, 09:04:18 AM
-
How can I automatically reformat (arrange) a DCL file?
Change this
DCL1 : dialog { label="My Dialog"; : image_button { key = "MyImage1" ;
width = 25.0 ; height = 4.0 ; color = black ; alignment = top ;
is_tab_stop = false ;} : button { key = "Button1" ;
label = "MyButton" ; width = 25 ; height = 2.0 ;
alignment = top ; is_tab_stop = false ;} ok_cancel;}
to
DCL1 : dialog {
label="My Dialog";
: image_button {
key = "MyImage1" ;
width = 25.0 ;
height = 4.0 ;
color = black ;
alignment = top ;
is_tab_stop = false ;
}
: button {
key = "Button1" ;
label = "MyButton" ;
width = 25 ;
height = 2.0 ;
alignment = top ;
is_tab_stop = false ;
}
ok_cancel;
}
Thanks for reading.
-
Try this routine.
http://www.theswamp.org/index.php?topic=10398.msg132473#msg132473
-
http://www.theswamp.org/index.php?topic=32513.msg380119#msg380119
-
Thanks CAD and GDF,
I found no real solution for my problem.
-
I hate to say this but...Vim can
quick two pass search and replace.
:%s/;/;\r/g | :%s/{/{\r/g
DCL1 : dialog { label="My Dialog"; : image_button { key = "MyImage1" ;
width = 25.0 ; height = 4.0 ; color = black ; alignment = top ;
is_tab_stop = false ;} : button { key = "Button1" ;
label = "MyButton" ; width = 25 ; height = 2.0 ;
alignment = top ; is_tab_stop = false ;} ok_cancel;}
goes to:
DCL1 : dialog {
label="My Dialog";
: image_button {
key = "MyImage1" ;
width = 25.0 ;
height = 4.0 ;
color = black ;
alignment = top ;
is_tab_stop = false ;
} : button {
key = "Button1" ;
label = "MyButton" ;
width = 25 ;
height = 2.0 ;
alignment = top ;
is_tab_stop = false ;
} ok_cancel;
}
-
I hate to say this but...Vim can
nice