Next: 13.5 Sample Variable Programs Up: 13. Programming With Variables Previous: 13.3 Changing Variable Values Contents Index

# 13.4 Writing blocks using variables

Right about now, the conventional program code writer will realize that it is a bit easier to just write the real numbered code than it is to write the variable code. It is also easier to read and make sense of real numbered code as the following two lines illustrate.

Hard code T55 M6 G43 H55 G55 X55 A55

Variable code T#1000 M6 G43 H#1000 G#1000 X#1000 A#1000

And real numbered code will take less time to write if you want to use that code or those numeric values only one time. The real value of code written with variables becomes obvious if you want to re use code for different sized parts, paste in the same code several times, or when using different setups and tools.

Variables can also be of value where a location is repeated many times during a program. Rather than typing (x21.1345) in a dozen locations in a program you can assign that value to a variable at the top of your program and reference it wherever you need to within. Then if a program wide change needs to be made to that value it can be done once and all references will shift to the new value.

Under any of these conditions variable programming becomes much more efficient than repeating or editing all those lines of code with the correct values.

Next: 13.5 Sample Variable Programs Up: 13. Programming With Variables Previous: 13.3 Changing Variable Values Contents Index