I need some help with my program. It's right below. It continues to say (Runtime error on line 38. Object already exists.) I use DarkEdit, just to let you know.
remstart
This is a test for me to see how well I am with DarkBASIC. I
am going to make a working calculator that is 3D. It won't be too
great, so don't expect alot. I am expecting the following from my
program:
- To be able to multiply
- To be able to subtract
- To be able to add
- To be able to divide
- To be able to have program calculate it for me
- To use variables correctly
- To have working buttons
- To be able to close the program without the use of the
escapekey
Hopefully I will accomplish all these tasks.
remend
rem I should load all sounds, bitmaps, and music before the program begins to run.
load sound "C:\Documents and Settings\Owner\My Documents\wavs\menuUpDown.wav", 1
load sound "C:\Documents and Settings\Owner\My Documents\Sound Recorder\SC Mission 1 Sounds\ComBeep0.wav", 2
rem Now that all sounds are loaded, I need to begin my main loop.
do
rem I need to reset all variables before the program ends.
m = 0
d = 0
a = 0
s = 0
rem I need to create my multiply, divide, subtract, addition, and equal buttons.
Make object cube 1, 2
Make object cube 2, 2
Make object cube 3, 2
Make object cube 4, 2
Make object cube 5, 2
rem Now that's completed, I need to recolor and move these to their proper locations.
position object 1, 12, 0, 0
position object 2, 15, 0, 0
position object 3, 12, 12, 0
position object 4, 15, 15, 0
position object 5, 13.5, 13.5, 0
rem Now, I need to color my objects so I know which one is which.
color object 1, rgb(100, 0, 0): rem This one will be my addition.
color object 2, rgb(0, 100, 0): rem This one will be my subtraction.
color object 3, rgb(0, 0, 100): rem This one will be my multiplication.
color object 4, rgb(100, 100, 100): rem This one will be my division.
color object 5, rgb(0, 0, 0): rem This one will be my equal button.
rem I got to let the user know which button does which.
text 0, 0, add$
text 0, 10, sub$
text 0, 20, mul$
text 0, 30, div$
rem This will end my loop.
loop