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 / D3DFunc installation and a question about arrays

Author
Message
Valdez515
17
Years of Service
User Offline
Joined: 4th Jul 2009
Location: United Kingdom
Posted: 17th Nov 2011 22:06
I apologise for posting so many questions here but the first one has stumped me and I thought I might as well add the second.

The first - I have been unable to successfully install the plugin D3Dfunc (found here http://www.dbdepot.co.uk/d3dfunc.html). I extracted the contents of the .zip file into the Dark Basic Professional directory to no avail. Am I missing something or does this no longer work?

Secondly, can anyone pinpoint the issue here:

Somewhere early in the program (ignore main.dat by the way)...



Later, in an attempt to verify the username is correct(password checking not yet implemented)...

ca = checked accounts
ep$ = entered password
eu$ = entered username



I would appreciate any advice.

[Insert witty remark here]
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 17th Nov 2011 22:44
As for the 3d3 stuff, I don't know.
About your second issue however I think you should access the arrays using simply 'ca' as the index. ca + 1 will start at 1 (ca being initialized to 0) and as demonstrated in your first snippet you stored your user name at the array index 0, leaving index 1 blank.


"Why do programmers get Halloween and Christmas mixed up?"
Valdez515
17
Years of Service
User Offline
Joined: 4th Jul 2009
Location: United Kingdom
Posted: 17th Nov 2011 22:46
Ah, yes. Typical careless error of mine. Thanks.

[Insert witty remark here]
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 17th Nov 2011 23:32
Quote: "I extracted the contents of the .zip file into the Dark Basic Professional directory to no avail. Am I missing something or does this no longer work?"

It should - about the only requirement is that you extract with a full directory structure. If you look in your DBPro installation directory and see the DLL there, then that's what you've done wrong.

Valdez515
17
Years of Service
User Offline
Joined: 4th Jul 2009
Location: United Kingdom
Posted: 18th Nov 2011 09:27
I think everything has gone in the right place but it simply informs me that the command wasn't recognised.

[Insert witty remark here]
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Nov 2011 11:48
The file D3DFunc.dll should be in the Compilers\plugins-user directory. If it isn't then it hasn't gone into the right place.

Valdez515
17
Years of Service
User Offline
Joined: 4th Jul 2009
Location: United Kingdom
Posted: 18th Nov 2011 18:12 Edited at: 18th Nov 2011 18:12
The help file looks like this:

Quote: "D3D INIT : D3D_INIT"


I thought that the one on the left was the command. It was actually the one of the right. Sorry about that; thanks anyway.

[Insert witty remark here]
Valdez515
17
Years of Service
User Offline
Joined: 4th Jul 2009
Location: United Kingdom
Posted: 18th Nov 2011 19:03 Edited at: 18th Nov 2011 22:15
The second issue is still not resolved, I'm afraid. I expanded both pieces of code a little:



Therefore, it is only triggered when there are no data files at all to prevent the program overwriting the user's data.

The second part now works, but only if you delete the data files then run the program. If you try and run it again, somehow the array is not being recognised as it doesn't print anything:



Thanks, sorry for the volume of questions and persistent issues.

[Insert witty remark here]
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 19th Nov 2011 23:29
Not sure if it matters but I always save/load arrays using a 0 in the () I think I remember reading that it needs a number there to Id it


Rais
23
Years of Service
User Offline
Joined: 7th Jul 2003
Location:
Posted: 20th Nov 2011 08:51 Edited at: 20th Nov 2011 08:52
Move the 2 DIM statements to before the IF like this



they will not get executed when the files exist where they are.
Valdez515
17
Years of Service
User Offline
Joined: 4th Jul 2009
Location: United Kingdom
Posted: 20th Nov 2011 11:27
Quote: "Not sure if it matters but I always save/load arrays using a 0 in the () I think I remember reading that it needs a number there to Id it"


Thank you, I will try that.


Quote: "they will not get executed when the files exist where they are."


Is there a need to declare the arrays after loading them? I will try it anyhow.

[Insert witty remark here]
Rais
23
Years of Service
User Offline
Joined: 7th Jul 2003
Location:
Posted: 20th Nov 2011 12:24
I think they must be declared before loading.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Nov 2011 13:06
The definition of an array is usually global - it doesn't matter where in the code the array is declared, it will be picked up and be available.

However unless the flow of execution runs directly through the DIM statement, the array will have no memory allocated to it.

Valdez515
17
Years of Service
User Offline
Joined: 4th Jul 2009
Location: United Kingdom
Posted: 20th Nov 2011 13:38
Quote: "The definition of an array is usually global - it doesn't matter where in the code the array is declared, it will be picked up and be available.

However unless the flow of execution runs directly through the DIM statement, the array will have no memory allocated to it."


Ah. Thank you.

[Insert witty remark here]

Login to post a reply

Server time is: 2026-07-10 21:41:45
Your offset time is: 2026-07-10 21:41:45