<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[RemoteXY community — Текстове поле]]></title>
	<link rel="self" href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1677&amp;type=atom" />
	<updated>2023-07-30T06:57:45Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.remotexy.com/viewtopic.php?id=1677</id>
		<entry>
			<title type="html"><![CDATA[Re: Текстове поле]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=5166#p5166" />
			<content type="html"><![CDATA[<p>Вы можете определить массив ссылок на переменные из структуры RemoteXY и далее уже через этот массив ссылок обращаться к полям структуры по индексу.<br /></p><div class="codebox"><pre><code>struct {
  char text_1[11];
  char text_2[16];
  char text_3[5];
  char text_4[11];
} RemoteXY;

//дополнительный массив ссылок
char *textLinks[] = {
  RemoteXY.text_1, 
  RemoteXY.text_2, 
  RemoteXY.text_3, 
  RemoteXY.text_4
}; 

void setAllText()  { 
  for (int i=0; i&lt;4; i++) {
    sprintf (*textLinks[i], &quot;Field %d&quot;, i+1);
  }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[remotexy]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2</uri>
			</author>
			<updated>2023-07-30T06:57:45Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=5166#p5166</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Текстове поле]]></title>
			<link rel="alternate" href="https://forum.remotexy.com/viewtopic.php?pid=5146#p5146" />
			<content type="html"><![CDATA[<p>тут такое дело для выведение в интерфейс значений нада писать допустим sprintf (RemoteXY.text_2, str);, так вот RemoteXY.text_2 - указывает на поле в котором должно вывести значение str, а если мне допустим нада по очеререди вывести в 10 полей значение, не писать же 10 раз&nbsp; sprintf (RemoteXY.(название поля), допусти 10 полей text_1-10, можно как то написать чтоб например RemoteXY.text_1....RemoteXY.text_2.....RemoteXY.text_3... например&nbsp; <br />text_1;<br />text_2;<br />text_3;<br />text_4;<br />text_5;</p><p>int r=0;<br />int str=1;<br />sprintf(RemoteXY.text_&#039;r&#039;, str)<br />str=+1;<br />r++;</p><p>тоесть после каждого выполение кода, значение r меняетса, поетому и меняетса название текстового поля, обясните можна ли так зделать если да то как?</p>]]></content>
			<author>
				<name><![CDATA[rijs4407]]></name>
				<uri>https://forum.remotexy.com/profile.php?id=2354</uri>
			</author>
			<updated>2023-06-11T16:07:28Z</updated>
			<id>https://forum.remotexy.com/viewtopic.php?pid=5146#p5146</id>
		</entry>
</feed>
