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.

DarkBASIC Discussion / Help!!! can anyone see a problem with this code????

Author
Message
Teckno
21
Years of Service
User Offline
Joined: 20th Jan 2004
Location: Inside of your computer, LET ME OUT!!!!!
Posted: 13th Feb 2004 07:10
this function seems fine to me and I cant see a problem with it, but DB (classic) is giving me hell



DB gives me this:
Parameter Mismatch. Array must have a subscript and an assignment value

I am god, now bow before me you stupid peasants
I accept no responsibility for any thing I say while... well..... ever
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 13th Feb 2004 11:08
How did you set the array? Has it only got one dimension?

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Teckno
21
Years of Service
User Offline
Joined: 20th Jan 2004
Location: Inside of your computer, LET ME OUT!!!!!
Posted: 13th Feb 2004 19:24
I put DIM Aroll$(6) at the begining of the program, if that is what you mean.

I am god, now bow before me you stupid peasants
I accept no responsibility for any thing I say while... well..... ever
Crappy Coder
21
Years of Service
User Offline
Joined: 16th Sep 2003
Location: Uk, Bath
Posted: 13th Feb 2004 21:52
you need to change that line to aroll$(z) = str$(E)

that should sort your problem
Teckno
21
Years of Service
User Offline
Joined: 20th Jan 2004
Location: Inside of your computer, LET ME OUT!!!!!
Posted: 13th Feb 2004 22:31
once again, I am in your debt. thank you Crappy Coder

just out of curiosity, is it possable to a numerical variable with the text command rather then a string?

I am god, now bow before me you stupid peasants
I accept no responsibility for any thing I say while... well..... ever
Crappy Coder
21
Years of Service
User Offline
Joined: 16th Sep 2003
Location: Uk, Bath
Posted: 14th Feb 2004 03:19
no problem, gald i could help

err your sentence donsn't make much sense...

i will try to help anyway...

value = 50
text 10,10,str$(value)
number$ = "140"
newvalue = val(number$)

err well thats the best i can do.. . if you could add the missing the words i could probably help
Teckno
21
Years of Service
User Offline
Joined: 20th Jan 2004
Location: Inside of your computer, LET ME OUT!!!!!
Posted: 14th Feb 2004 04:37
sorry about that, i seem to have a tendenicey to forget words (or my keyboard is messed up)

that is what i asked, so thanks.
but now this other related bit of code isent working:


as you can probaly guess, this takes the result from abroll() and prints them at certain places on the screen, the syntax check show notheing wrong but when the program runs the numbers (from abroll()) do not appear. what could be wrong?

I am god, now bow before me you stupid peasants
I accept no responsibility for any thing I say while... well..... ever
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 14th Feb 2004 08:20
Aroll$(A)...
Is that meant to be Aroll$(A) or Abroll$(A)??

That could be your problem, also, what is in the function ABROLL()?? that might be having an effect on the output.

Hope I Helped...
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Teckno
21
Years of Service
User Offline
Joined: 20th Jan 2004
Location: Inside of your computer, LET ME OUT!!!!!
Posted: 14th Feb 2004 21:59
Aroll is the array, Abroll is the function (sorry, im terrable with names)

heres ABroll()


I am god, now bow before me you stupid peasants
I accept no responsibility for any thing I say while... well..... ever
Crappy Coder
21
Years of Service
User Offline
Joined: 16th Sep 2003
Location: Uk, Bath
Posted: 15th Feb 2004 02:00



that appears to work fine for me, try it, you had one thing wrong in the function, i changed this
to this


hope that helps
Teckno
21
Years of Service
User Offline
Joined: 20th Jan 2004
Location: Inside of your computer, LET ME OUT!!!!!
Posted: 15th Feb 2004 02:38
actully i just got it sorta working on my own about 5 minutes ago, but thanks anyway

however, I seem to need to get the NEXT A and NEXT B statment to happen at the same time. the program now takes the random number (from ABROLL()) and places to in all 6 places on the screen, then it does the same with the number. What i need is to make the first number in the first spot, the second number in the second spot, and so on.

I am god, now bow before me you stupid peasants
I accept no responsibility for any thing I say while... well..... ever
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 15th Feb 2004 18:41
Alright, you need to change the Y position of the text, as, at the moment you have it continually set to 2, try changing this line;



To;



As that will print each line of numbers down the screen in lots of 20 pixels at a time.

Hope I Helped...
Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Teckno
21
Years of Service
User Offline
Joined: 20th Jan 2004
Location: Inside of your computer, LET ME OUT!!!!!
Posted: 15th Feb 2004 21:25
actully, its quite important that I place eash number in the specified place, an there not soposed to lots of numbers. its only 6 numbers. the program rolls ability scores for dungeons and dragons characters.

I am god, now bow before me you stupid peasants
I accept no responsibility for any thing I say while... well..... ever
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 16th Feb 2004 07:07
So what you want is to print 6 of the numbers, then wait for, say, a keypress, then print the next six numbers?

Well, to do that try;



( That code should run stand alone )

And hopefully that solves your problem?

Jess.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Teckno
21
Years of Service
User Offline
Joined: 20th Jan 2004
Location: Inside of your computer, LET ME OUT!!!!!
Posted: 16th Feb 2004 21:19
thanks for all your halp but i fix it:


I am god, now bow before me you stupid peasants
I accept no responsibility for any thing I say while... well..... ever

Login to post a reply

Server time is: 2025-05-23 04:01:47
Your offset time is: 2025-05-23 04:01:47