BEGIN {cc=0}
$1=="print" && $2=="\"//" { n=index($0,"print");
                            print substr($0,n+7,length($0)-(n+7)); 
                            if($3=="------------\"") { print " "; print " " };
                            next }

NF == 1 && $1 == "begin" { next }
NF == 1 && $1 == "end" { next }
NF == 1 && $1 == "sqlbegin" { next }
NF == 1 && $1 == "sqlend" { next }
$1 == "channel" { next }
$1 == "connect" { next }
$1 == "disconnect" { next }
$1 == "submit" { next }
$1 == "if" && $NF != "then" { print $0 "  &"; cc=1; next }
cc==1 && $NF == "then" {print $0; cc=0; next }
cc==1 { print $0 "  &"; next }
$1 == "positionform" && $2 ~ "^dwgrp" { p=index($0,"positionform");
          if(p>1) {spc=substr($0,1,p-1)} else spc="";
          n=split($2, a, "."); m=split(a[n],b,"[");
                               print spc "dwgrp.setFocus()";
                               print spc "dwgrp.setRow(row)";
                               print spc "dwgrp.setColumn(\"" b[1] "\")"; next }
$1 == "positionform" && $2 ~ "curgroup" { p=index($0,"positionform");
          if(p>1) {spc=substr($0,1,p-1)} else spc="";
          R=$0; gsub(" ","",R); gsub("positionform","",R);
          n=split(R, a, "."); print spc "dwgrp.setFocus()";
          p=index(R,"+");
          if(p>0) { print spc "dwgrp.setRow(row + 1)" }
            else  { print spc "dwgrp.setRow(row - 1)" };
                    print spc "dwgrp.setColumn(\"" a[n] "\")"; next }                                     
{ print $0 }

