JsonObject:GetType() What can I have as returns from GetType

Posted by goo on 14-Mar-2017 11:30

I have tried to find documentation on what the integers means, can anyone point me to a correct place to find that info?

{"Adresser":[
{"name":"rune aasheim","action":" "},"Person",{"name":"rune aasxxx","email":"rune.aasxxx@xx.com","ID":"6320695"}

]}

When I check GetType on the array on "Person" I get 1 in return. What does that mean? 

All Replies

Posted by Peter Judge on 14-Mar-2017 11:42

Compare the results of GetType() to the values in the Progress.Json.ObjectModel.JsonDataType enum class.
 
The values basically are
 
 
enum OpenEdge.Core.JsonDataTypeEnum :
    define enum       String      =  1 /* = JsonDataType:STRING */
                      Number   /* =  2 = JsonDataType:NUMBER */    
                      Boolean  /* =  3 = JsonDataType:BOOLEAN */
                      Object   /* =  4 = JsonDataType:OBJECT */
                      Array    /* =  5 = JsonDataType:ARRAY */
                      Null     /* =  6 = JsonDataType:NULL */
                      .
end enum.
 
 
You can display names with some tapdancing ….
 
Def var enumDataType as JsonDataTypeEnum.
Def var intDataType as int.
 
intDataType = someJsonData:GetType(“Person”).
 
enumDataType = JsonDataTypeEnum:GetEnum(intDataType).
 
Message “Person is a “ string(enumDataType).
// Person is a String
 
 
 

Posted by goo on 14-Mar-2017 15:30

Thanks J
 
Fra: Peter Judge [mailto:bounce-pjudge@community.progress.com]
Sendt: tirsdag 14. mars 2017 17.43
Til: TU.OE.Development@community.progress.com
Emne: RE: [Technical Users - OE Development] JsonObject:GetType() What can I have as returns from GetType?
 
Update from Progress Community
 
Compare the results of GetType() to the values in the Progress.Json.ObjectModel.JsonDataType enum class.
 
The values basically are
 
 
enum OpenEdge.Core.JsonDataTypeEnum :
    define enum       String      =  1 /* = JsonDataType:STRING */
                      Number   /* =  2 = JsonDataType:NUMBER */    
                      Boolean  /* =  3 = JsonDataType:BOOLEAN */
                      Object   /* =  4 = JsonDataType:OBJECT */
                      Array    /* =  5 = JsonDataType:ARRAY */
                      Null     /* =  6 = JsonDataType:NULL */
                      .
end enum.
 
 
You can display names with some tapdancing ….
 
Def var enumDataType as JsonDataTypeEnum.
Def var intDataType as int.
 
intDataType = someJsonData:GetType(“Person”).
 
enumDataType = JsonDataTypeEnum:GetEnum(intDataType).
 
Message “Person is a “ string(enumDataType).
// Person is a String
 
 
 

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

 

This thread is closed