title: C++ Builder XE 2 -- How to display variable data in a TEdit control?
body: <p>I hope you can help me here Guys. What I´ve been doing in the past 3 weeks is to try to display the content of 3 variables ( 1  char variable which contains a '-' or a '+' sign accordingly and two other integer variables which contain temperature measurements ) What I´m trying to do id to display the content of those variables in a TEdit control something like : + 26.3 . Simple as that.</p>
  
  <p>I have tried several functionalities with no sucess, let me show you:</p>
  
  <p>(Where temp_txtBox_Cond is the name of the TEdit control) </p>
  
  <pre><code>temp_txtBox_Cond-&gt;Text=(L"%c %i. %i",temp_sign,temp_temp_int,temp_temp_dec,test_buf,n);
  
  temp_txtBox_Cond-&gt;Text.printf(L"%c %i. %i",temp_sign,temp_temp_int,temp_temp_dec);
  
  sprintf(test_buf,"%c %i.%i",temp_sign,temp_temp_int,temp_temp_dec);
  temp_txtBox_Cond -&gt;Text.sprintf(L"%c %i.%i",temp_sign,temp_temp_int,temp_temp_dec,test_buf);
  
  temp_txtBox_Cond-&gt;Text=("%c %i. %i",temp_sign,temp_temp_int,temp_temp_dec);
  
  temp_txtBox_Cond-&gt;Text = AnsiString(temp_sign,temp_temp_int,temp_temp_dec);
  
  temp_txtBox_Cond-&gt;Text = (AnsiString(temp_sign)+AnsiString(temp_temp_int)+AnsiString    (temp_temp_dec));
  
  String s(temp_sign);
  String d(temp_temp_dec);
  String i(temp_temp_int);
  
  temp_txtBox_Cond-&gt;Text = s+" "+i+"."+d;
  </code></pre>
  
  <p>With NO Sucess. This is VERY Frustrating.</p>
  
  <p>PLEASE Guys Need your help. Thanks in advanced.</p>
  
  <hr>
  
  <p>Well it´s kind of weird because with most of the above functionalities What I get is a <code>0</code>, <code>+0.0</code> or <code>hq3Pˆ15PPhå</code> ( this one sounds like memory issue ). Let me show you :</p>
  
  <p>With :</p>
  
  <pre><code>temp_txtBox_Cond-&gt;Text = (L"%c %i.%i",temp_sign,temp_temp_int,temp_temp_dec,test_buf);
  </code></pre>
  
  <p>I get : <code>hq3Pˆ15PPhå</code></p>
  
  <p>With :</p>
  
  <pre><code>temp_txtBox_Cond-&gt;Text.printf(L"%c %i. %i",temp_sign,temp_temp_int,temp_temp_dec);
  </code></pre>
  
  <p>I get Nada the text box is blank</p>
  
  <p>With :</p>
  
  <pre><code>sprintf(test_buf,"%d. %d",temp_temp_int,temp_temp_dec);
  temp_txtBox_Cond-&gt;Text =(test_buf,"%c %d. %d",temp_sign,temp_temp_int,temp_temp_dec);`
  </code></pre>
  
  <p>I get 0.</p>
  
  <p>With :</p>
  
  <pre><code>temp_txtBox_Cond-&gt;Text =("%c %d. %d",temp_sign,temp_temp_int,temp_temp_dec);`
  </code></pre>
  
  <p>I get 0 as well.</p>
  
  <p>and With:</p>
  
  <pre><code>temp_txtBox_Cond-&gt;Text = AnsiString(temp_sign,temp_temp_int,temp_temp_dec): I got +0.0
  </code></pre>
  
  <p>Those are the errors.</p>
  
  <p>Hi Remy,</p>
  
  <p>Sure no problem. This is the code that I use to get the temp_sig, temp_temp_int and temp_temp_dec :</p>
  
  <pre><code> WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
  {    
  ikor_msg_id = ikor_id_bld (app_priority, zone, dest_UCP, 0x20, 0x03);
  wait_for_msg(h, 0x5200, 500, data);
  if (data[0] == 1)
  {
  temp_sign = '+';
  }
  else if (data[0] == 0)
  {
  temp_sign = '-';
  }
  else
  {
  temp_sign = '?';
  }
  
  temp_temp_int = data[1];
  temp_temp_int &lt;&lt;= 8;
  temp_temp_int += data[2];
  temp_temp_dec = temp_temp_int;
  temp_temp_int /= 10;
  temp_temp_dec -= (temp_temp_int * 10);
  }
  </code></pre>
  
  <p>and here where I´m trying to display the data:</p>
  
  <pre><code>void __fastcall TForm1::temp_txtBox_CondChange(TObject *Sender )
  {
  unsigned long ikor_msg_id = 0;
  long ikor_id_bld( long p_temp, long z_temp, long d_temp, int m_temp, int s_temp);
  int wait_for_msg(CANHANDLE handle,int id,int timeout,unsigned char *data);
  CANHANDLE h;
  unsigned char data [8];
  
  /***Here is where i tried all the attempts that I posted ****/
  
  }
  </code></pre>
  
  <p>And the variables I declared them in a header:</p>
  
  <pre><code>#ifndef __Variables_Cond__
  #define __Variables_Cond__
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  
  
  unsigned int temp_temp_int;
  unsigned int temp_temp_dec;
  unsigned char temp_sign;
  
  
  #ifdef __cplusplus
  </code></pre>
  
  <p>}
      #endif</p>
  
  <pre><code>#endif    
  </code></pre>