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 / Unknown error in random lines

Author
Message
Tank202
14
Years of Service
User Offline
Joined: 23rd May 2012
Location:
Posted: 23rd May 2012 09:10 Edited at: 23rd May 2012 20:52
Hi everyone, I am trying to write a bbbGUI program for my game and after a lot of SUCCESSFUL program tests i started getting error - could not understand command in line 86 or 159 or 158 or 157 or 156.
I've tried to put recently edited code into rem statements but it wont do any good. Can anyone tell me whats the problem?

I've already moved the code into new project,
Reinstalled my drivers, DirectX and DBPro so the problrm is elsewhere
Maindric
16
Years of Service
User Offline
Joined: 22nd Jul 2009
Location:
Posted: 23rd May 2012 16:23
We are missing the GUI Constants file...

zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 23rd May 2012 19:52
A lot of times when I get an error like that that goes to random lines in my code, it is generally because I didn't close an IF-ENDIF or FOR-NEXT statement, so I would suggest looking for something along those lines. I did notice in your Win32GUI.dba the ConstructMainWindow subroutine is missing an 'n' in return at the bottom.

I looked at the code, but to me, it's a little tough seeing it all in different files.

I would suggest that instead of using GOSUB, you instead use FUNCTIONS.

So instead of:


You could use:


Best of luck on resolving your problem!

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.
Tank202
14
Years of Service
User Offline
Joined: 23rd May 2012
Location:
Posted: 23rd May 2012 20:51 Edited at: 24th May 2012 15:19
Thanks to zeroSlave my problem was solved. It was return command .
About those functions... In the past i tried to use functions in my projects, but when I tried to add more files into the project i needed to declare global variables so could use functions and only the ones from Main.dba file . Then i noticed that for subroutines i didn't need to declare global variables so until now I prefer subroutines(For big projects) .
About 'Constants file' it comes with BBB GUI.
zeroSlave
17
Years of Service
User Offline
Joined: 13th Jun 2009
Location: Springfield
Posted: 24th May 2012 20:20
I hear you! I didn't really like functions for the same reason when I started using them. It can be a pain to declare globals, but I've found globals to be pretty handy, also. They highlight your variables for you! This has helped me many times to catch a typo rather than search through tons of code and find 'ThisVaraible' when it should have been 'ThisVariable'

You can utilize functions in several different ways, too. They are very handy! For instance:




Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.

Login to post a reply

Server time is: 2026-07-22 00:35:41
Your offset time is: 2026-07-22 00:35:41