In the real code the tildes in the printf as objects are "->". Made a
mistake when I type the code manually.
On 4/19/21 3:50 PM, Ruurd Idenburg wrote:
Given the following code:
/**
* Method: OsmMapPointNew
*
* Create a new OsmMapPoint.
*
* @return 0
**/
RexxMethod3(int, // Return type
OsmMapPointNew, // Method name
CSTRING, lat, // Latitude in decimal degrees
CSTRING, lon, // Longitude in decimal degrees
OSELF, self) // Self
{
printf("As CSTRINGs - Latitude: %s;Longitude: %s\n", lat, lon);
RexxStringObject rxlat = context->String(lat);
RexxStringObject rxlon = context->String(lon);
printf("As objects - Latitude: %s;Longitude: %s\n)",
context~StringData(rxlat), context~StringData(rxlon));
double flat; context->ObjectToDouble(rxlat,&flat);
double flon; context->ObjectToDouble(rxlon,&flon);
printf"(As doubles - Latitude: %.6f; Longitude: %.6f \n", flat,
flon);
OsmGpsMapPoint *point = osm_gps_map_point_new_degrees((float)flat,
(float)flon);
context->SetObjectVariable("POINT", context->NewPointer(point));
return 0;
}
And given the following result when invoked:
ruurd@Paradigit2:~/newrxgtk/GTKv3/test$ osmmap.rex
As CSTRINGs - Latitude: 52.289875;Longitude: 4.8448525
As objects - Latitude: 52.289875;Longitude: 4.8448525
As doubles - Latitude: 52,000000; Longitude: 4,000000
ruurd@Paradigit2:~/newrxgtk/GTKv3/test$
Is there some misunderstanding on my side or does it look like
"ObjectToDouble" is in trouble?
Running Mint 20, which is based on Ubuntu 20.4
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel