Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by AndrewAMD. 12/02/26 15:26
SGT_FW
by Aku_Aku. 11/30/26 08:19
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 6,080 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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