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 / help with my code.... one of the most erronous youll ever see...

Author
Message
The Mucky Duck
21
Years of Service
User Offline
Joined: 25th Aug 2003
Location:
Posted: 15th Sep 2003 21:26
ive been programming for a couple of days, so i decided to test out my limited knowledge... ive learnt alot from changing bits but i just cant see whats wrong in some places, i might be trying to do some things that arent possible with the commands im using. a little push in the right direction would be great.
thanks,
(ps. its a kinda shares game, very simple)
Velorien
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 15th Sep 2003 22:24
You must put a $ on the end of the input command like this

INPUT "SELL FROM WHICH COMPANY?";F$

And you must put an endfunction here

The Mucky Duck
21
Years of Service
User Offline
Joined: 25th Aug 2003
Location:
Posted: 15th Sep 2003 22:43
thanks alot
The Mucky Duck
21
Years of Service
User Offline
Joined: 25th Aug 2003
Location:
Posted: 15th Sep 2003 22:48
my main problem is the loop for days, is it because the next command is circumstantial and so it may never count on, just a guess. any answers???
Velorien
21
Years of Service
User Offline
Joined: 13th Sep 2003
Location:
Posted: 16th Sep 2003 01:44 Edited at: 16th Sep 2003 01:44
Don't know i'll think about it. For now just try this


I'm also new to DB so don't get mad if it doesn't work
zzabb
21
Years of Service
User Offline
Joined: 25th Apr 2003
Location: Seattle, USA
Posted: 16th Sep 2003 06:40
Well you have several probs

I’m not sure but I think you want to loop for 11 days?

First you can’t have an ‘IF’ statement nested outside of your loop
If you have an else statement you must have an endif statement
You cannot stack commands on top of an else

if this
do that
else
do this
do that
endif


Your program has no way to go back to your ‘D’ loop

Is ‘IN’ a variable?

If you want it to be an input you must make it an input
If you want it to be an inkey$() (a key pressed) then you have to make it that, but then it won’t be a number it will be in string form

The things you want to happen must be before your main loop or inside of your main loop or you have to give your program a way to get to it, as it is now your program will count through your ‘D� D1,D2,D3,D4 ect and then since the last ‘D’ is D11 it will go to the end
you need a way for your program to get back to your ‘D’ loop

your function must have endfunction

short of rewriting it that’s all I can do, just keep with it

some advice for what its worth

try and keep things in order
place data, arrays at the top or at the bottom
placing them in the middle gets confusing

use a ‘gosub’ if you want to return
a ‘goto’ if not

hope it helps

My advice is free -
unfortunately you get what you pay for (-:
The Mucky Duck
21
Years of Service
User Offline
Joined: 25th Aug 2003
Location:
Posted: 16th Sep 2003 10:34
alot to take in but it seems to be workin, thanks

Login to post a reply

Server time is: 2024-09-21 01:11:26
Your offset time is: 2024-09-21 01:11:26