PDA

View Full Version : Variables?



romper
05-18-2001, 03:14 AM
where can i get a detailed explination of what they are and how to use them.

bill.young
05-18-2001, 08:36 AM
The best way to get started using variables is to go to the downloads section of the ShopBot web site and download the Programming Handbook pdf file. It will tell you what variables are, and then give you specifics on how to use them in your part files.

Once you start using variables you'll find them really handy for a lot of things. I use them for all of my Z-axis moves now; it makes it really easy to make changes in cutting depths and z-up moves. I also combine them with INPUT statements so that the part file can do things like ask the user for the ACTUAL thickness of their material, save that value in a variable, and then use the variable to calculate the correct depth for grooves and recesses.

Bill

Mkuhrau@hotmail.com
09-11-2002, 10:07 AM
Sorry, but the handbook does not help much with my problem.
I want to increase or decrease a variable through user input. I wanted to use a variable &A and change it by adding the variable &B like this:

Input "Increase (+) or decrease (-) by:" &B
&B="&B"
&A=&A+&B

Somehow it does not work, I always get only &A as a result.

What do I wrong?

bill.young
09-11-2002, 12:09 PM
Hi Mike,

Try eliminating the second line...the one that reads &B = "&B" ... and I think it will work. I believe that you would use this line if you wanted to use &B as a string ( the actual characters that you typed, like a name or a letter ), instead of using the value of the number that you typed in a calculation.


As an example, let's say you had an input statement that said "Type 1 to PAUSE and 2 to continue". You would want to test for the keyboard characters "1" and "2", not the nummeric values 1.0 and 2.0 , and would a line like the second one in your example

If you want to see some examples of this look at the edge-finding routines that come with the ShopBot software.

Hope this helps,
Bill