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.

Newcomers DBPro Corner / Strange editor behaviour - DBPro

Author
Message
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 21st Mar 2004 15:53
I was wondering if anyone else has problems with the editor that ships with DarkBasic Pro.

Occasionally, it appears to be corrupting my code - here's an example of what I mean :



If I remove the line, the error simply moves down to the following line - and this is previously perfectly working code.

Another problem I have is sometimes it doesn't show what I am typing immediately and all of a sudden it will "catch up" often with disasterous results as my deletes and backspaces when wondering what the hell is going on are also caught up.

I have patched to the latest editor (I did this at the same time I upgraded to 5.5 on DBPro itself).

The typing thing is not so much of a problem but this corruption is really beginning to annoy me - I have no idea how to get around it - I have tried pasting the entire code into Notepad, deleting it all from the DBPro editor, and pasting it back in afterwards but the same problem returns.

Any suggestions would be appreciated.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 21st Mar 2004 17:09
with this line:
Global SpecialTimer = Timer() + (20*1000)
change it to:
Global SpecialTimer
SpecialTimer = Timer() + (20*1000)

its got somehting to do with it not liking sums in global declarations i guess

In the beginning, the universe was created...
This made alot of people very angry and it has been widely regarded as a bad idea...
Visit http://redeye.dbspot.com
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 21st Mar 2004 17:17
The error is because Timer doesent have ()'s. Change it to timer() and it should work.

"All programmers are playwrites and all computers are lousy actors" -Anon
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 21st Mar 2004 17:22
I had already sorted that timer() line out and it still did it - there was, however, an error further down (about 200 lines further down!) which when I removed the falsely identified error lines, it picked up on.

I was then able to re-enter the lines that were being flagged as an error and it began to work again.

Question is - why did it incorrectly highlight the wrong line in error? Very frustrating.

Thanks for the tips though - one to remember for the future - majority of the errors have been correctly pointed out (not to say I have bug-riddled code!)
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 21st Mar 2004 17:29
It always highlights the wrong line for me. I just memorize what the error messages mean, and look for that error in my code manually.

"All programmers are playwrites and all computers are lousy actors" -Anon
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 21st Mar 2004 17:42
you might want to more strongly TYPE the variables with:

Global X AS Integer/Float/String/whatever = xyz



Home of the VB.NET Class Builder Utility - Demo available now!
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 22nd Mar 2004 03:58
I'm quite used to strong typing but I'm just getting into DarkBasic again and wanted to get my program going before going back in and making it more streamlined and professional - although I am not convinced strongtyping would have sorted this one out if the error was a missing () from the timer function as it was - the compiler was getting a little confused as to the line number.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Mar 2004 04:32
you assume I meant that strongly typing was an answer to your original question - it wasn't. The () comment above regarding Timer function was most likely the key, or one possible part of the problem. I was only suggesting that you take every precaution, including strongly typing your vars, especially in DBP, as it can be flakey as compared to other programming languages. I should have been more specific in my answer, I apologize. To say that you only wanted to "get it going" and come back later and stream-line the code seems like extra work to me when you can simply Type the var at the time you declare it. Refining definitions later is just asking for headaches. Coming back later to streamline logic and flow would make more sense but that's just me.

Happy Coding and Best of Luck
James



Home of the VB.NET Class Builder Utility - Demo available now!
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 22nd Mar 2004 13:03
I think I also have not been very clear - I hadn't touched DarkBasic for over 18 months when I got back into it a few days ago - my code as it stands is a hackeneyed knock together that works as I want it to in terms of final result, but is inefficient to make the understatement of the century.

But - the fundamental logic is sound.

Streamling is a fancy term for "rewrite properly" - the program isn't a sprawling tangle of loops and conditions it's quite a short program (less than 600 lines) that I will make even shorter and efficient now I know the guts of it will work.

I appreciate the help you have offered.

The timer was the problem - but the issue I was raising was the incorrect line number the compiler threw at me - and other editor glitches that I have - and I was just wondering if anyone else had similar experiences.

Future programs will not be done the same way now I have gotten used to some of the funnies once again.

Cheers for the help.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Mar 2004 17:09
good luck with all of your projects.
Yes, the compiler usually throws the wrong line number, and the debugger.....



Home of the VB.NET Class Builder Utility - Demo available now!
Scouseknight
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Bootle, Merseyside, UK
Posted: 23rd Mar 2004 02:29
heh I'm beginning to realise this!

Thanks for the good luck - I've stuck my neck out and posted my first game on the Announcements forum ready to be ripped to shreds but to be honest, it's not a bad little game and I even enjoy playing it myself which has to be something :o

Cheers for the help once again.

Login to post a reply

Server time is: 2024-11-26 09:37:48
Your offset time is: 2024-11-26 09:37:48