<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Edit field change detection]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1950&amp;type=atom" />
	<updated>2025-03-26T06:00:43Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1950</id>
		<entry>
			<title type="html"><![CDATA[Re: Edit field change detection]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=5983#p5983" />
			<content type="html"><![CDATA[<p>The RemoteXY does not provide a data change flag. This is not always necessary. But it is very easy to implement. To check if the data has changed, you must keep a copy of the data.<br />For simple variables this is always easy. Here is some example code.<br /></p><div class="codebox"><pre><code>float copySetTemp = 0;
void loop () {
  if (RemoteXY.setTemp != copySetTemp ) {
    copySetTemp = RemoteXY.setTemp;
    
    // do something when data is changed

  }
}</code></pre></div><p>For strings it&#039;s a bit more complicated, but the idea is the same. You have to keep a copy of the string and use some function to compare and copy the strings. An example of such a function is below</p><p>// The length of the copy must be the same as the original in the RemoteXY structure<br /></p><div class="codebox"><pre><code>char * copyMyString[11]; 

void loop () {
  if (strCompareAndCopy (copyMyString, RemoteXY.myString) == 0) { 
    
    // do something when data is changed

  }
}

uint8_t strCompareAndCopy (char* to, char* from) {
  uint8_t compare = 1;
  while (*from) {
    if (*to != *from) compare = 0;
    *to++ = *from++; 
  }
  if (*to) compare = 0;
  *to = *from;  // zero
  return compare;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2025-03-26T06:00:43Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=5983#p5983</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Edit field change detection]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=5981#p5981" />
			<content type="html"><![CDATA[<p>Having a lot of issues when using the Edit field specifically strings.&nbsp; Trying to detect when there&#039;s a change in the edit field, but trying to manage this in the code is a mess at times.&nbsp; I searched for examples and found one that makes perfect sense.&nbsp; It had a flag when a valid change was made in the &quot;edit field&quot;..&nbsp; &nbsp;However, to my knowledge this flag is not available in the present version of REMOTEXY.</p><p>Would appreciate any help in whether or not this flag is available ....</p>]]></content>
			<author>
				<name><![CDATA[cableop76]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=1139</uri>
			</author>
			<updated>2025-03-25T17:35:46Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=5981#p5981</id>
		</entry>
</feed>
