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 / Uhh... Have I gone stupid or should this code work?

Author
Message
denki
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd Apr 2003 09:36 Edited at: 2nd Apr 2003 09:37
hmm ... Well, I've done this kind of code before (more complicated even ) but this simple code doesn't work ... any ideas why? I get a "type definition player could not be understood" error when it gets the the Array line.



Thanks.

Edit - I just copied some old code in and it didnt work weird thing is ... if I load that prject it works ...

[url][/url]
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 2nd Apr 2003 09:48
try this example



denki
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd Apr 2003 09:55
Thanks.

Well, it copiled on its own, but not in my project Methinks I'll start again. I'll write a full game engine that way ... Still a VERY odd thing (maybe bug).

[url][/url]
Superbeest
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: Netherlands
Posted: 2nd Apr 2003 10:00
Perhaps if you take the as integer out of your code?

By steel will thy flesh divide
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 2nd Apr 2003 10:46
variable labels arn't case sensitive...



you can't have recursive names, this is another reason why i add my little tags to them

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?
Beta1
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 2nd Apr 2003 13:40
Yeah I've had the same problem, changing the neame of the type or variable fixed it for me. I used type o, then dim object(X) although ravens way of adding _t to identify a type is better I think

denki
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 2nd Apr 2003 17:44
I already tried all this and trying again, it still doesnt work.

[url][/url]
rapscaLLion
23
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 3rd Apr 2003 06:51
I guess your just stupid then!

What r u coding there anyway? (If I may ask)

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Beta1
23
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 3rd Apr 2003 12:18
I dunno then - I use code that looks just like ravens example all the time.

Could you be more specific - in what way does it not work?

Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 3rd Apr 2003 12:40
dim player as player

Would that not compile as....

dim player as player as dimmed player as player as dimmed player as player...

Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 3rd Apr 2003 14:24
i dunno... if it doesn't then the types must have a preprocessing done on them - cause else it'd cause a loop like you mentioned Pneu

but as you can't type arrays, it's just popup "cannot get type cast" or something.

my example works for me - i tested it and compiled fine, so erm why not for you?

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?
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 3rd Apr 2003 16:21
Re-install DBPro, by the sound of it...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
denki
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 3rd Apr 2003 20:28
Ok ok I figured it out!!!

You can't start a user defined type in a function. Humm... ya... I did get stupid ...

[url][/url]
Shadow Robert
23
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 3rd Apr 2003 20:36
oki try this then



should work fine (^_^) - else put the type elsewhere...
oftenly i throw all my types into an include (thanks to the addition of that in 3.x) so i'll have an include file full of types and constants oftenly for specific things

make sure in functions you use 'local' because it'll try to global the type and next time the function runs the type will already exist causing problems, but is oki if you need it once - but then you add 'global' to the start

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?
denki
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 4th Apr 2003 00:13
Ah I see ... I should have thought about that Lol ... I'm very tired ...

[url][/url]

Login to post a reply

Server time is: 2026-07-11 12:02:17
Your offset time is: 2026-07-11 12:02:17