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 / Newbie problem with Darkmatter 2 example

Author
Message
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 28th Oct 2004 02:35
I am running DBPro 1.057 and just bought Darkmatter 2. The DM2Browser.dbpro example does not run. I get an error on line 15 Array does not exist or array subscript out of bounds. No biggy, I am new to DB, but the debugger should help me. When I run in debug, I get the Microsoft app crashed sending report dialog....
I ran the simple BulletHole example and it works, but debugging it crashes dbpro also....
Where do I start repairing this?

thanx
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 28th Oct 2004 02:43
Also, it seems that DBPRO crashes everytime I run the debugger no matter what the project is. This seems more than a little rude of the DBPro.
Is there a setting somewhere to correct the debugger?

thanx
Lampton Worm
22
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 29th Oct 2004 03:08
Sounds strange, I just loaded it up and it compiles ok. Hmm.

If you start a new project, does this compile...



Cheers,
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 29th Oct 2004 03:57
Thanx for the help. Now I get that same error on line 10. Since I posted this problem, I have un-installed DBPro and re-installed it and the latest patch which still puts me at 1.057. Do I have to install all the interim patches in the correct order?

Thanx
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 29th Oct 2004 04:32
More information.... I changed line 9 from

for i=0 to listmax

to

for i=1 to listmax

and now it runs. I also added WAIT KEY at the very bottom so I could see the window before it shut down.
I thought BASIC did not have a 0 index (i am a c++ guy...).

The thing is that making that change to the DarkMatter example did not fix it. BUT I did change line 9 in dm2browser from

listmax=2+array count(list$())

TO

listmax=array count(list$())

AND now it runs except I do not see the names of all the objects....

NOW I AM COMPLETELY CONFUSED! How is a newbie supposed to figure this stuff out without a debugger to step through the code??!!!

thanx
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 30th Oct 2004 04:24
just install the latest patch when you re-install
basic arrays run from 0 to the specified value ie:

dim a(5)

gives you slots

[0] [1] [2] [3] [4] [5]

(six slots), this is unlike C/C++ which would give you five slots

[0] [1] [2] [3] [4]

unlike C/C++ you don`t need to specify the variable size or jump 4 bytes for every dword, each index is a complete variable (they may have changed this in C/C++...it`s been a while since I used it)

ATM you just need to use print or text to display variables onscreen during the program run, the debugger is waltz (working at less than zero ), so you can forget that for the moment, I don`t get why you keep getting array out of bounds errors, this should work fine

dim a(40)
for i=0 to 40
a(i)=rnd(500)
next i
for i=0 to 40
print a(i)
next i
wait key

try cutting and pasting that into the editor, if that fails to run then maybe you have some system issue or something, in that case contact TGM and tell them all you can about the problem.

Mentor.

PS; it may be that you are running the code outside the intended folder or something, or maybe that you have not rebooted since you re-installed (some people are on all the time I understand)

PC1: P4 3ghz, 1gig mem, 3x160gig hd`s, Radeon 9800pro w cooler (3rd gfx card), 6 way speakers.
PC2: AMD 2ghz, 512mb ram, FX5200 ultra, 16 bit SB.
Mini ATX cases suck.
roujesky
20
Years of Service
User Offline
Joined: 4th Jun 2004
Location:
Posted: 13th Nov 2004 03:54
Quick follow-up to this issue. I contacted support and here is their response:
>
Due to changes in the way the compiler works you are right, this source code no longer compilers with DarkBASIC Professional. We will have a look into this and present a solution on the web site and/or in a future newsletter.
>

Login to post a reply

Server time is: 2024-11-27 15:39:55
Your offset time is: 2024-11-27 15:39:55