In Visual Basic = Chr(65), in Symbian = ?

Login to reply to this topic.
Tue, 2003-12-02 09:16
Joined: 2003-10-02
Forum posts: 73
I have this question.

I developed a program in Visual Basic that create this kind of string:

Dim byte1 As String
byte1 = Chr(65)

Chr gaves me (in this case) the character "A".
You know, 65 is the ASCII code for A.

Now, how can I do the same thing in Symbian C++ Huh?
Wich library Huh Let me know...

Screener_it


Tue, 2003-12-02 09:45
Joined: 2003-07-22
Forum posts: 70
In Visual Basic = Chr(65), in Symbian = ?
Hi
U can do like this

TBuf16<256> tgt;

_LIT16(KFormat,"[%c]");
tgt.Format(KFormat,65); // U Get 'A'


Hope it may help u
Tue, 2003-12-02 11:34
Joined: 2003-10-08
Forum posts: 106
In Visual Basic = Chr(65), in Symbian = ?
Cheezy You don't need a library to do that. It's a basic part of C++.

  If you want to use the variable, the following will suffice :-

 
  char aMyChar;
  aMyChar = 65;
 


  Just like any normal C++ program.

  If you want to print it, meenuj's solution is correct, but a 256 character buffer will be overkill. Try the following modification :-

 
 TBuf<2> tgt;
 _LIT(KFormat,"[%c]");
 tgt.Format(KFormat,65); // U Get 'A'
 


  Regards,
  Varun

Regards,
Varun

Thu, 2005-03-31 04:55
Joined: 2004-08-31
Forum posts: 27
Buffersize
[I know the original post is a while back, but in case someone digs this one out -just like I did- and for the sake of completeness...]

The TBuf's length should be at least 3, two for the [] and one for the character. Otherwise a USER11 panic will be raised.

Regards, inv

"Help a man when he's in trouble and he will remember you...when he is in trouble again."

  • Login to reply to this topic.