I want a short program that will peck drill a hole around the 4th axis. I have it to start at 45deg and do an 8 hole pattern then end at 360 or 0 deg. The goal is to have something that I can simply edit my #1 value to alter how many holes my pattern consists of. E.g. if I changed #1 to =30 I would get a 12 hole pattern still ending in the same location. This is my first crack at this type of program and is only an excersise so the depths, feeds, and speeds have no meaning. Will what I have work? Any input would be appreciated.

O10080 (program name)
#1=45 (local value)
G54G90G40G80G20 (workzone,ABS,rad comp cancel,can cycle cancel,inch)
M06T3 (call tool 3)
M03S2800 (spin cw 2800rpm)
GOOX1.Y1. (rapid to location)
A45 (rotate 4th axis to 45 deg)
G43Z.25H3M08 (height comp on,rapid Z start,offset 3,coolant on)
WHILE[#1LE360]DO1 (macro condition)
G99G73Z-.75R.1Q.085F4.0 (use R value,peck drill can cycle,max Z depth,clearance plane,peck depth,feed)
X2. (position)
X3. (position)
Y2. (position)
X2. (position)
X1. (position)
G80G00Z.25 (can cancel,rapid to Z start)
#1=#1+#1 (rotate 45 deg past original rotation)
END1 (end of loop)
M05 (spin off)
M09 (coolant off)
G91G28Z0. (INC,home)
G28Y0. (home)
G90 (ABS)
M30 (prog end)