Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

     Define_Com Class(#PRIM_SRVM.HttpClientRequest) Name(#Req)
    Define_Com Class(#PRIM_JSON.Document) Name(#JsonDoc) Reference(*DYNAMIC)
Define_Com Class(#PRIM_JSON.Object) Name(#JsonLocation) Reference(*DYNAMIC)
...
   #Req.DoGet Url('https://maps.googleapis.com/maps/api/geocode/json?...')

* Check if request is successful

     If (#Req.Response.IsSuccessHttpStatusCode)

    * Place the response into PRIM_JSON.Document

       #Req.Response.AsJson Result(#JsonDoc)

    * Place the first location response into PRIM_JSON.Object

       #JsonLocation <= #JsonDoc.RootNode<'results'>.ItemAt<1>.Item<'geometry'>.Item<'location'>.AsObject
    #Latitude := #JsonLocation.Item<'lat'>.AsDecimal
#Longitude := #JsonLocation.Item<'lng'>.AsDecimal
Endif

...