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 / functions and types error

Author
Message
Krash
22
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 23rd Feb 2003 05:37
I was wondering if someone could test this for me as I am using the demo version of DBP and need to know if this works on the retail version.



This is just a quick test piece to see if this works, but for me I get an error on line 9 that didn't show up 'till I got the new DBP demo(patch 3). Thanks for any help.
It's all fun and games 'till someone loses an arm...
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd Feb 2003 05:50
try...



Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Krash
22
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 23rd Feb 2003 06:01
Thanks, but what I need is the user(1).name$ = "bob" inside of the function as well as the dim statement. It worked fine before the update.

It's all fun and games 'till someone loses an arm...
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd Feb 2003 07:43
i'm not sure why you'd need it inside the statement
the point is that when you make it global is for global access - it doesn't matter where you input the data from, its just you can't global an already global statment.

its a causality error

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Krash
22
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 23rd Feb 2003 22:07
The dim statement and the input will be DB code created by a program I am writing and output to a file that will be #included by other projects... Do you see what I'm saying? if it is in an included file it must be in a function as far as I know. I have found that if I don't make the variable global, then it becomes local to that function only. After exiting the function, the variable is lost. I was just wondering if this change was made on purpose because the code worked fine before patch 3.

It's all fun and games 'till someone loses an arm...
Krash
22
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 23rd Feb 2003 22:11
by the way, this only causes an error when using string data. Numbers work fine.

It's all fun and games 'till someone loses an arm...
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Feb 2003 00:20
its mostly because you were using the $ and also declaring as a string ... double declaration

plus you redeclared the array as a global when it was already such

its all about knowing how the language interacts, i know the help isn't fantastic in this area ... but alot of the bugs were cleaned up by the double declarations - see if you did something like

MyValue# as string, that'd be a double declaration but it would instantly die when you loaded up cause its trying to fit a string into a float

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Krash
22
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 24th Feb 2003 04:53
thanks, but even the code you submitted in your second post did not compile correctly. "variable user does not exist at line 7". Parser error I think. And as far as variable types go, declaring name as - name$ - or - name as string - causes the same problem. Something is wrong with using user defined data types in functions. The about box of my demo says version 1... could someone have put the wrong version up for download? One work-around I found is just using sloppy old gosub routines. Works fine that way, but not inside a function. Go figure...

It's all fun and games 'till someone loses an arm...
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Feb 2003 05:19
yeah the function is actually notriously bugged, download Patch 3.1 and install it - move the libraries and compiler across ... should help

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Feb 2003 05:20
i ment to say demo... you know having that edit button there is like dangling a mars bar infront of a one-armed etheopian who is hanging from a cliff

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?

Login to post a reply

Server time is: 2025-05-19 02:39:37
Your offset time is: 2025-05-19 02:39:37