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 / Weird Array Values Problem

Author
Message
Metal Nihilist
15
Years of Service
User Offline
Joined: 26th Oct 2010
Location:
Posted: 27th Oct 2010 01:32
Hi all,

I've been avoiding arrays in my programs because I seem to have a weird bug or something, but I could really use arrays for my next game project. I've updated DarkBasic Professional to version 7.5 and I've done everything I can think of, but I am still having a major issue with the DIM command.

I'm trying to assign values in an array and I keep having a problem in which all cells of any array are assigned the same value. I've tried using the default integer arrays (e.g. Dim array(10)) and float arrays (e.g. Dim array#(10)), but every time I assigned a value to any element of the array, all elements of the array contain that same value. To demonstrate the problem, I copied the simple code from the DarkBasic Professional help file for DIM (which uses a 1-dimensional array of integers), compiled/ran it, and grabbed a screenshot of this code with the output program. The output should obviously be 24 and 42, not 24 and 24.

Can anyone tell me why all elements of the array are being assigned the same value? Any help or suggestions would be greatly appreciated.

Thanks!
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 27th Oct 2010 09:45
I think it might be tripping up because ARRAY is a reserved word, try renaming it and see if it works then. There was a similar issue recently with someone using an array called MESSAGE, which conflicted with a plugin.

Health, Ammo, and bacon and eggs!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Oct 2010 15:29
I'd try reapplying the update to see if that fixes it.

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 27th Oct 2010 20:11
I would uninstall Darkbasic Pro, delete the directory that remains, reinstall, then install the update.

Daniel TGC
Retired Moderator
19
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 28th Oct 2010 00:15
This problem appears to be local to your PC.

What operating system are you using, and is it 32 or 64 bit.
Which Update are you using.
What is your machines CPU?
Are you running in any kind of virtual environment?
Metal Nihilist
15
Years of Service
User Offline
Joined: 26th Oct 2010
Location:
Posted: 28th Oct 2010 02:35
Thank you for all the responses.

@Van B: I thought the same thing. I changed the array name to "somevariable(10)" and I still get the same issue. I've attached a screenshot showing more code and the program output.

@IanM and Grog Grueslayer: I uninstalled DB Pro, deleted the directory, reinstalled and re-applied the update for the newest version (7.5). Still no luck.

@Daniel TGC: I agree, it could be local to my PC, but I don't understand why it's only an array problem. I've loaded old DB Pro games that I've made years ago and they work fine (however, I didn't use arrays with these older programs). I had the same problem with arrays in DB Pro on my old laptop, which was running Windows XP 32-bit. My new laptop has Windows 7 64-bit (all Windows updates applied), Intel i5 2.67 GHz processor, 8 GB RAM, and a 1 GB ATI Mobility Radion HD 5650 graphics card. I'm running DB Pro as an administrator on the new PC. I'm wondering if maybe there's a compatibility problem? I'm guessing that's not it because I have the same issue on my old laptop - I used to get around it by avoiding arrays, which becomes cumbersome with larger games.

Any other ideas or suggestions? I really appreciate the help. Thanks again everyone!
Daniel TGC
Retired Moderator
19
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 28th Oct 2010 02:39
Do you have any common applications installed or running in the background on your new machine from your old machine? It's an unusual problem, I can only assume there's some kind of common denominator between the two machines. I've run the array test on a Dell Inspiron, Asus 1005HA, Toshiba L300 and a custom made desktop I built myself. None of them are displaying any kind of issue I'm afraid.
Metal Nihilist
15
Years of Service
User Offline
Joined: 26th Oct 2010
Location:
Posted: 28th Oct 2010 20:28
All of the applications that I installed on my new PC are fresh installs - I only transferred documents. Thanks for the idea though Daniel. I've determined that the problem is caused by the newest update for DB Pro...

I reinstalled Dark Basic Professional from the CD and tried running the simple DIM program with version 1.x. The program was working fine and displayed the correct values. Then, I downloaded update 7.5 again, ran the update, and re-activated from the CD. When I ran the same program, I encountered the same array problem with version 7.5. I guess I'll try uninstalling everything again and running earlier updates. I'm pretty disappointed that the newest update seems to cause a major problem with arrays - I'd really like to have a current version of DB Pro that works.

Has anyone else encountered problems with version 7.5? Any other ideas? Thanks again everyone!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Oct 2010 21:42
No-one's had problems with arrays in 7.5 in the 4 months it's been available - it just seems to be you.

Unless it's trivial example code, every piece of code I write in DBPro uses arrays as they are so fundamental, so I'd be darned quick to spot a problem if there was one. I'm using Windows Vista SP1 32 bit and Windows 7 64 bit.

Rather than installing into the Program Files area, try creating a new folder in your C: drive and then installing into that instead.

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Oct 2010 03:36
My guess is that you are using an old version of the editor that is not executing the compiled version of the code you are now looking at. I had very similar problems some time back when we were testing the new editor and I just couldn't see what the problem was till I realised the editor was running the previous exe file.

For what it's worth, I've just entered your code and it ran perfectly.

Which editor build date do you see when you go to Help/About Dark Professional Basic Editor? I see Jun 23 2010.
Metal Nihilist
15
Years of Service
User Offline
Joined: 26th Oct 2010
Location:
Posted: 30th Oct 2010 00:11
@IanM: I tried installing into a new folder on the C: drive (not in the program files) and I still had the same problem. Thank you for the suggestion.

@Green Gandalf: When I go to the help menu, I see that the editor has the correct date (Jun 23 2010) and the version is 1.075. That was a good call, though - I was hoping that was the issue.

Oddly, version 1.069 and earlier versions work perfectly, but any of the more recent versions have the array command problem on my PC. I'd really like to have the most recent version so I think I'm just going to purchase the downloadable version of DB Pro. I bought the DB Pro CD off amazon.com years ago when the price was higher, so it's probably worth it to just get a fresh copy (who knows, maybe the CD is somehow part of the problem even though I take good care of them). If it fixes the problem and I can finally use arrays, it would be worth it to me. It's funny that all the higher level code works fine and it's just this one issue that's been holding up my game making hobby.

Thanks again everyone for all your advice. I really do appreciate it!
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 30th Oct 2010 17:42
Before you buy, might want to see if they can just give you access to a downloadable installer. I mean, you have paid for your license, etc already.

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 30th Oct 2010 17:44
Maybe it would help is someone else ran the compiled exe, this would help isolate whether it's a darkbasic problem, or an OS problem.

Login to post a reply

Server time is: 2026-07-22 04:37:03
Your offset time is: 2026-07-22 04:37:03