Gamestudio Links
Zorro Links
Newest Posts
Alternative to Stooq for Zorro S
by Petra. 10/14/26 07:04
ZorroGPT
by TipmyPip. 10/13/26 17:08
Stooq now requires an API key
by cwford. 10/08/26 23:27
Purchase A8 full licence version
by jcl. 10/05/26 12:12
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 25,252 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Strukt vars and vectors #284655
08/14/09 12:36
08/14/09 12:36
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline OP
Expert
Puppeteer  Offline OP
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
This doesnt work...
Why?
Quote:

typedef struct
{
var testvar;
} teststrukt;

function test(VECTOR* testvec, teststrukt* bla)
{
(bla->testvar)=testvec[1];
}


Thank you =)

EDIT:
(bla->testvar)=testvec.y;
works

Last edited by Puppeteer; 08/14/09 13:56.

Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: Strukt vars and vectors [Re: Puppeteer] #285113
08/17/09 08:34
08/17/09 08:34
Joined: Apr 2009
Posts: 33
Germany
B
Bunsen Offline
Newbie
Bunsen  Offline
Newbie
B

Joined: Apr 2009
Posts: 33
Germany
Hello Puppeteer,

"testvec[1]" means the second element of type "VECTOR" within an array of vectors.
You can't assign the content of a "VECTOR" struct (size = sizeof(VECTOR))
to a var typ (size = sizeof(var)).

Re: Strukt vars and vectors [Re: Puppeteer] #285116
08/17/09 08:43
08/17/09 08:43
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Vectors are no longer an array of vars, they are just structurally like one.
You MUST use x,y,z with Vectors in lite-c

BUT, you MIGHT be able to do it with (untested)
(bla->testvar)=((var*)testvec)[1];
if you REALLY want to add the extra typing....

You may also be able to use
function test(var* testvec, teststrukt* bla)
...
If the function isnt "overload"ed.

Neither of these ideas are tested.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1