Index: work/scripts/ruler.awk =================================================================== --- work/scripts/ruler.awk (nonexistent) +++ work/scripts/ruler.awk (revision 19305) @@ -0,0 +1,23 @@ +# An action to draw a ruler +function ruler(user_input) +{ + for (x=0; x < user_input+0 + 1 ; x++){ + if (x != 0 && x % 10 == 0 ){ + ddraft("line from " x "mm,1 to " x "mm,3.5mm") + message("x is " x ); + createtext( "#8" , 0, x - 0.6 "mm", "4.0mm", 0 , 100, x "") + } + else{ + ddraft("line from " x "mm,1 to " x "mm,2mm") + } + } + return 0 +} + + +BEGIN { + fgw_func_reg("ruler") +} + +#oneliner +#for (x=0; x < 150, x++){if (x % 10 == 0) ddraft("line from " x "mm,0 to " x "mm,10mm") else ddraft("line from " x "mm,0 to " x "mm,1mm")}