Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Dark Basic Pro Quick Start Tutorial 6

Author
Message
VGHero11
12
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 29th Nov 2011 20:04
Hello other Dark Basic Pro users. I have been working through the Quick Start tutorials that are hosted on this site and during Tutorial 6 I have encountered an annoying syntax error. I believe I have corrected everything and they don't show where the error occurs. If someone could show where my error is occurring that would be great.



When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 30th Nov 2011 07:15
Hi there. You seem to be getting an error because you are trying to assign a value to a variable called oldpositionx# but you have () after it. The lines in question are these:



Which should be these:



So the full correct code (with corrected indentation) would be:



Hope that helps and makes sense . If it doesn't, do just ask.

VGHero11
12
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 30th Nov 2011 18:17
Thank you Lucas Tiridath. That allowed it to compile successfully.

When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!
VGHero11
12
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 30th Nov 2011 18:35
I have another problem however. For some when I run my program, the screen comes up black. I believe this is a coding error since when I run the source code of the program that comes with the tutorial, it works and runs. However when I run mine, it comes up black. If anyone could spot the problem, that would be great.



When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 30th Nov 2011 20:58 Edited at: 30th Nov 2011 22:07
It's because of your misspellings/mistypes.
Specifically "cubsize" instead of "cubesize" in the camera setup.



Another cubsize instead of cubesize


And...




I just did a find and replace. working on editing some of your code

sometimes dbpro lets you get away with it, but your for next loop has the wrong next variable, next yy# should be next zz. (OR the FOR zz## should be For yy....
And since you are stepping in whole numbers there is no reason for your indexes like yy xx etc... to be floats #'s, they should be normal integers.


There are other mistypes like backcolor as blackcolor, when coloring the backdrop, so look over your code carefully. check numbers too, as those are harder to spot.

=============================================
I changed the formatting of your source to make it a bit easier to read (at least to me).
There may still be some typos...




good luck

~ZENassem
VGHero11
12
Years of Service
User Offline
Joined: 15th Nov 2011
Location:
Posted: 1st Dec 2011 18:07
Thank you zenassem for spotting the errors in my code. Once I corrected them, the program was able to run.

When we all lend our power together, there is nothing we
can't do!
Please Lend me your STRENGTH!

Login to post a reply

Server time is: 2024-05-20 06:12:42
Your offset time is: 2024-05-20 06:12:42