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 / type compile errors in functions

Author
Message
OrcishBlue
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Canada
Posted: 24th Feb 2003 05:22
why am i getting an error on mycube.x = 0 in the function ? mycube is global.

synthetic test:

sync on : sync rate 0

type TCube
x as float
x as float
x as float
endtype
mycube as TCube
mycube.x = 0 `
OrcishBlue
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Canada
Posted: 24th Feb 2003 05:23
what the heck happened there ?
the board cut off my msg, oh well



thanks

OrcishBlue.
OrcishBlue
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Canada
Posted: 24th Feb 2003 05:26
uhmm yes i'm still with the demo.

I hope my DBP order arrives soon, will fix alot i think
Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 24th Feb 2003 13:27
Apparently there are still some "issues" with types.

However I've been using them in a similar way to you without any problems. The only difference is that my variables are all array types ( name(1).position.x ) or whatever.

Maybe if you try changing the mycube AS TCube to DIM mycube(1) AS TCube it would work.

And that way if you decide you want more than one cube you can always change the array size to 2+

Shadow Robert
22
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 24th Feb 2003 13:32
erm... you notice that your actually declaring 'X' 3x?

try this instead


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?
OrcishBlue
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Canada
Posted: 24th Feb 2003 15:52
yeah, the first one is the actual declare, the next one is a test assign that actually works and the third one in the function that never gets called is the one that fails.

I wanted to show that mycube.x worked outside a function but not inside it for some reason.

I tried your code and it still dosen't work.
Gives an error on that assign in the function.

The Arrays don't seem to have that problem.

so far i'm 0 - 3 with the demo
- bsp texture stretching
- dynamic arrays works partially
- Global Types in functions same as above

Guys, don't spend anymore time on this as i'm removing the demo from my system.

I'll sit tight and wait for the nice mailman to bring me my copy of DBP

How long does it usually take to arrive from order to your doorstep ?

I'm hoping that once patched to 1.3, most of the above will resolve itself.

Thanks,

OrcishBlue
Beta1
22
Years of Service
User Offline
Joined: 28th Dec 2002
Location:
Posted: 24th Feb 2003 16:11
errr no what raven meant (and I missed Doh!) is that inside you type, endtype you have declared x as float 3 times - thats not right you need to do it once (or change the other 2 to y and z as raven did.)

The error pointing at the function that didnt get called is probably cos everything inside a function is meant to be local - ie you cant use your mycube variable inside you function cos its not declared within that function. It works if you use a typed array (my solution) cos arrays are always global - ie you can use them inside an array.

Anyway my DPro took around a week to arrive (in the UK)

OrcishBlue
22
Years of Service
User Offline
Joined: 9th Feb 2003
Location: Canada
Posted: 24th Feb 2003 17:00
Doh indeed, my bad.

the actual code in my program is x y z, i got lazy while typing in this window and did copy and paste.
forgot to change the yz afterwards.

wow, one week is pretty good time.
i'll still put my expectations to 2-4 just incase.

Thanks

Login to post a reply

Server time is: 2025-05-18 20:47:10
Your offset time is: 2025-05-18 20:47:10