Sign in to follow this  
Followers 0
pctester2020

how do i make array for objects?

1 post in this topic

hi,

I can make object like this:

;=========================================================

; Create the struct

; struct {

; int var1;

; unsigned char var2;

; unsigned int var3;

; char var4[128];

; }

;=========================================================

$str = "int var1;ubyte var2;uint var3;char var4[128]"

$a = DllStructCreate($str)

if @error Then

MsgBox(0,"","Error in DllStructCreate " & @error);

exit

endif

;=========================================================

; Set data in the struct

; struct.var1 = -1;

; struct.var2 = 255;

; struct.var3 = INT_MAX; -1 will be typecasted to (unsigned int)

; strcpy(struct.var4,"Hello");

; struct.var4[0] = 'h';

;=========================================================

DllStructSetData($a,"var1",-1)

DllStructSetData($a,"var2",255)

DllStructSetData($a,"var3",-1)

DllStructSetData($a,"var4","Hello")

DllStructSetData($a,"var4",Asc("h"),1)

But this is one object, how do i make array of object and using it ? we can't declare: Dim $array[50]

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0