Notifications
Clear all

[Closed] GetValue(…) and arrays?

I managed to retrieve data from my custom scripted objects with GetValue like

float mval;
pb2->GetValue(pD.ID,GetCOREInterface()->GetTime(),mval,FOREVER);

But what I should do if I wanna retrieve an array?

I’ve tried

float listValues[100];
 pb2->GetValue(pD.ID,GetCOREInterface()->GetTime(),*listValues,FOREVER);

and

float listValues[100];
 for(int k=0;k<100;k++)
     pb2->GetValue(pD.ID,GetCOREInterface()->GetTime(),listValues[k],FOREVER);

But I had no luck with both tries. Any ideas? Thanks in advance.

4 Replies
2 Replies
(@denist)
Joined: 11 months ago

Posts: 0

you can’t. use tab index to get a value of the TAB.


virtual BOOL GetValue(ParamID id, TimeValue t, float& v, Interval &ivalid, int [b]tabIndex[/b]=0)=0;

(@malvado)
Joined: 11 months ago

Posts: 0

Oh thank you! a really fast and useful solution!

An array is just a pointer, so you should just have to pass the address of an array that has the same size as the one you want to retrieve.

1 Reply
(@malvado)
Joined: 11 months ago

Posts: 0

Yes, that was my intention but I didn’t find the way to retrive a pointer.

Thank you anyway.