TypeInfo

Tagged: 

This topic contains 4 replies, has 2 voices, and was last updated by  abakobo 1 year, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #8913

    abakobo
    Participant

    I can’t figure out how to use TypeInfo. I’ve seen the reflexion test but…

    How would i get the kind the kind or array element or…. here is a look at my failing attemts

    [/crayon]
    #8921

    Mark Sibly
    Keymaster

    Have you looked at the reflection section in the language manual? This shows the correct use of TypeOf and TypeInfo.

    (you may need to grab the latest github develop branch, this may have only recently been added).

    #8937

    abakobo
    Participant

    I only see how to do it with user defined types..

    TypeInfo also includes functions for inspecting all user defined types:

    Function TypeInfo.GetType( name:String )

    Returns the TypeInfo for a named type. A named type is a namespace or class declared by your app – it does not include primitive types, pointer types, array types etc. Class names must be prefixed by the namespace they are declared in.

    To get an array of ALL named types:

    Function TypeInfo.GetTypes:TypeInfo[]()

    But can we have type info for simple pointers, array…? Some public properties (ArrayRank, PointeeType,..) let me think so but maybe TypeInfo is for user defined only.

    #8943

    Mark Sibly
    Keymaster

    But can we have type info for simple pointers, array…?

    Still not sure what you mean – this works (as per docs):

    What are you trying to do is the 64k Q?

    #8954

    abakobo
    Participant

    My bad. I though Typeof was just returning a string.. Was missing the first lines of the reflexion docs.

    what I was looking for was:

    [/crayon]
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.