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 Professional Discussion / Can someone help me with this code?

Author
Message
Anomaly452
14
Years of Service
User Offline
Joined: 14th Aug 2011
Location: Cyberspace
Posted: 19th Aug 2011 03:04
Here is the peice of code that I am having trouble with:



The SET DISPLAY MODE command will not accept the STRINGS. Is there any way I can convert the STRINGS into INTEGERS or force it to accept the STRINGS. When I try to replace all of the $ symbols with # symbols to indicate that they are INTEGERS, the program compiles correctly but the values of dispx#, dispy#, dispd#, and vsync# are reset to 0 instead of the values that were there when they were in STRING format.

I hope I made sense Can anyone help me with this problem?

Oh yeah, here is a copy of the file that it is reading from:





The wisest leader is the one that can avoid the conflict in the first place.
Bluespark
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 19th Aug 2011 05:25
Try this:
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 19th Aug 2011 06:56 Edited at: 19th Aug 2011 06:59
You're over complicating reading a .cfg file... there's no need to read it byte-by-byte. A .cfg file is just a .txt file with a different extension so you can use the READ STRING command to read the entire line at once. You don't need to have "endfile" in the string because the FILE END() command knows when the file naturally ends. Also if you wrote that .cfg file yourself you can make it a lot easier to work with by getting rid of the variable names and using IanMs SPLIT STRING() commands to separate everything.

Change your Settings.cfg to this:


And read it with this (after you get IanMs Matrix 1 Utilities Plugin):


If you don't have IanMs Matrix 1 Utilities Plugin it's time for you to join the rest of us in the 21st century.

https://forumfiles.thegamecreators.com/download/2192430

Webber
15
Years of Service
User Offline
Joined: 27th May 2011
Location:
Posted: 20th Aug 2011 03:37
I'm gonna have to agree with Grog, but there is a way to convert strings into numerical values.



I like games, and stuff.

Login to post a reply

Server time is: 2026-07-10 20:58:21
Your offset time is: 2026-07-10 20:58:21