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 / Program Ran Into A Function Declaration

Author
Message
Stephen
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Appalachians
Posted: 26th May 2008 23:07 Edited at: 26th May 2008 23:09
I am currently using the trial version of dark basic classic. I have windows vista and have already downloaded the d3drm.dll.

When I try to run a program with functions at the end, an error says "Error at line XX. Program ran into a function declaration." But this doesn't happen every time. Sometimes it will work fine. It's not in the code, because it did the same with the "room" project that came with the download.

I was wondering if anyone else had the same problem. Could it be because of Windows Vista or the Trial Version?

I also made a simpler example that gave the same error:


What has been will be again, what has been done will be done again; there is nothing new under the sun.
-Former King in Jerusalem
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 27th May 2008 01:40
seems like an odd bug. a quick fix would probably be to put all of your functions into another file and INCLUDE it in your main file. This could cause problems with subroutines if it is skipping end. Perhaps try putting end twice, just to see if it works.

Hope this helps

Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th May 2008 02:47
try putting a WAIT before the END
WAIT usually fixes weird bugs

It is far better to complete a 10 line program than to start a 10,000 line program.
Stephen
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Appalachians
Posted: 27th May 2008 22:08 Edited at: 27th May 2008 22:17
Thanks y'all. I tried putting a WAIT command before the end as well as adding another END after the first one. Neither worked. I also took out the functions, used them in another file, and added the #INCLUDE command, but it gave me the same error.

Then I tried running a program that didn't use functions.

That also ended the program to the DarkBASIC Command Line, but it did not give me an error.

I've also tried running several other short programs - some just using PRINT and DO LOOP. They all end immediately to the CLI. And every time, the background behind the CLI rapidly flashes between black and white.
But everything usually works fine for the first few times after opening the DarkBASIC program.

What has been will be again, what has been done will be done again; there is nothing new under the sun.
-Former King in Jerusalem
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 28th May 2008 01:47
If you are using the DB built-in editor then try using a proper Windows IDE - like DarkEdit.

I can't see how this can be connected to your problem, but as it's so strange, it's worth trying anything...

TDK_Man

Stephen
21
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Appalachians
Posted: 28th May 2008 23:15
Thanks, TDK. It worked fine as long as I was using DarkEdit, so I guess I won't be using the regular editor anymore.
Thank yall.

What has been will be again, what has been done will be done again; there is nothing new under the sun.
-Former King in Jerusalem

Login to post a reply

Server time is: 2025-06-05 21:22:45
Your offset time is: 2025-06-05 21:22:45