Isn't written in foxpro, but this is what I use to create the maps that I'm
working on, and so far I haven't had a problem with it

<?php
require("phpsqlajax_dbinfo.php");

function parseToXML($htmlStr) 
{ 
$xmlStr=str_replace('<','&lt;',$htmlStr); 
$xmlStr=str_replace('>','&gt;',$xmlStr); 
$xmlStr=str_replace('"','&quot;',$xmlStr); 
$xmlStr=str_replace("'",'&#39;',$xmlStr); 
$xmlStr=str_replace("&",'&amp;',$xmlStr); 
return $xmlStr; 
} 

// Opens a connection to a MySQL server
$connection=mysql_connect (localhost, $username, $password);
if (!$connection) {
  die('Not connected : ' . mysql_error());
}

// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}

// Select all the rows in the markers table
$query = "SELECT * FROM lca2014 WHERE left(LCA_CASE_8,2) = '39'";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}

header("Content-type: text/xml");

// Start XML file, echo parent node
echo '<markers>';

// Iterate through the rows, printing XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
  // ADD TO XML DOCUMENT NODE
  echo '<marker ';
  echo 'name="' . parseToXML($row['LCA_CASE_3']) . '" ';
  echo 'address="' . parseToXML($row['STATUS']) . '" ';
  echo 'lat="' . $row['LAT'] . '" ';
  echo 'lng="' . '-' . $row['LNG'] . '" ';
  echo 'type="' . $row['STATUS'] . '" ';
  echo '/>';
}

// End XML file
echo '</markers>';

?>

-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Jean MAURICE
Sent: Tuesday, January 27, 2015 2:20 PM
To: ProFox Email List
Subject: shared memory

I would like to test transmission of datas between two exe with shared
memory (CreateFileMapping, OpenFileMapping, MapViewOfFile, UnmapViewOfFile).

I can do it work with strings (I can send a string and I can receive it in
the second exe).

But now, I want to improve it : I would like to transmit 'objects' (things
that are called 'structure' in C) like

DEFINE CLASS test AS custom
     toto = "toto"
     tata = "tata"
     tutu = -2
     titi = .T.
ENDDEFINE && test

XML seems to be my friend for that. I found on Ed's download page
"ctxml.prg" 
that works with object built with SCATTER NAME but not with an instance of
the 'test' class above.

1) has anyone already done this and can give me help and ... encouragement
;-)

2) is there a tool that can translate properties of classes to XML and
vice-versa ?

The Foxil

[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to