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 / DarkBasic Classic

Author
Message
Skynet Games
10
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 5th Aug 2011 12:38
PERFORM CHECKLIST FOR DISPLAY MODES
CLS
FOR T = 1 TO CHECKLIST QUANTITY()
PRINT T; "" ;CHECKLIST STRING$(T)
NEXT T

DO
IF ASC(inkey$())>48
position=ASC(inkey$())-48
width=CHECKLIST VALUE A(2.000005) (Guessing wildly)
height=CHECKLIST VALUE B(2.000006)(Guessing wildly)
deth=CHECKLIST VALUE C(3.000007)(Guessing wildly)
SET DISPLAY MODE width, height, depth
ENDIF
LOOP

Writing the code is no problem, but when it comes to math i know I'm horrible at it. So I'm putting random numbers such as 2.000005, 2.000006, 3.000007, just to see what happens. Now the program compiles but i don't think its doing what the tutorials specifying, I'm getting back the error. (Run time error at Line 15. Display depth must be between 16, 24 to 32. Now I've tried going back and correcting it and putting 16 in the depth, Same thing, then i tried to put 24 in the depth. Same thing, then i tried to put 32 in the depth and..You guessed it, same thing. So I'm coming to everyone and asking WHAT THE HECK AM I DOING WRONG? i know my math isn't good but what am i missing? I've been hung up on tutorial 3 all night and I've been drinking coffee and smoking cigs like crazy! lol, but seriously. Can any one help me out here?

Speed of the wolf, power of the pack!!
http://www.wolfgames.110mb.com/home.html
TheComet
11
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 5th Aug 2011 13:52 Edited at: 5th Aug 2011 13:54
Well there is no math involved yet here

checklist value a()
checklist value b()
checklist value c()


Those commands expect integer values (not floats like 0.0292, but like 1,2,3,4...), and that value specifies from where you want to read the checklist.

PERFORM CHECKLIST FOR DISPLAY MODES
CLS
FOR T = 1 TO CHECKLIST QUANTITY()
PRINT T; "" ;CHECKLIST STRING$(T)
NEXT T


So here you are listing what display modes are supported. Let's say the user chooses number 3 from that checklist, then you have to insert that 3 in your code below:

DO
IF ASC(inkey$())>48
position=ASC(inkey$())-48
width=CHECKLIST VALUE A(3)
height=CHECKLIST VALUE B(3)
deth=CHECKLIST VALUE C(3)
SET DISPLAY MODE width, height, depth
ENDIF
LOOP


So...



TheComet

Skynet Games
10
Years of Service
User Offline
Joined: 20th Sep 2008
Location: At home, building stuff.
Posted: 5th Aug 2011 15:14 Edited at: 5th Aug 2011 15:19
Thank you. Now i can finally go to bed...

Speed of the wolf, power of the pack!!
http://www.wolfgames.110mb.com/home.html

Login to post a reply

Server time is: 2019-08-25 17:13:03
Your offset time is: 2019-08-25 17:13:03