PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → [WD22] - Array..Class not working
[WD22] - Array..Class not working
Started by Sascha77, Oct., 19 2017 10:02 AM - 4 replies
Posted on October, 19 2017 - 10:02 AM
HI,

does anyone know how to get type of class used in an array?

I have an array like this:
mylist is array of oPrdMain
myList..class --> error
according to PCSoft Help myList..Class should return me oPrdMain.

https://doc.pcsoft.fr/en-US/?2514004&name=Class#sample_code

however using the class property on the array does throw an error.

when i am adding an item to the array like this ..Class works for an item in the array
cdr is oPrdMain
mylist is array of oPrdMain
ArrayAdd(mylist,cdr)
myList[1]..Class --> oPrdMain

any idea on how to check what classes are in the array BEFORE the array gets filled?

Thanks
Sascha
Registered member
13 messages
Posted on October, 19 2017 - 4:01 PM
Hi

This may help

Trace({"mylist[1]"}..Class)

// or

FOR EACH obj OF mylist
Trace(obj..Class)

END


Regards
Mat
Message modified, October, 19 2017 - 4:01 PM
Registered member
13 messages
Posted on October, 19 2017 - 4:08 PM
Or
od is dynamic

od = mylist[1]

Trace(od..Class)
Posted on November, 01 2017 - 1:30 PM
Use this:

ItemDef is Definition = ArrayInfo(Array, tiElementDefinition) IF ItemDef..Name = "oPrdMain" ... END
Posted on November, 01 2017 - 8:09 PM
HI,

works in windev and webdev. unfortunately it´s not available on android :(

thx
sascha