|
This may sound very elementary to some. Please forgive me for the ****STUPID**** question.
In VB CHAR () returns the ASCII value. Is there anything similiar to CHAR( ) in c-sharp? Actually I would like test for STX and ETX in a string.
Thank you.
|
|
|
|
|
I know that in C++ a char IS the ASCII value.
(2b || !2b)
|
|
|
|
|
I maybe way off here, and I bet James or someone else will set me straight on this, but here is my guess...
private string TheWord;
private int TheNumber;
TheWord = "Hello Abdul";
TheNumber = (int)TheWord;
MessageBox.Show(TheNumber.ToString());
HTH
Nick Parker
|
|
|
|
|
What is STX and ETX? Are they strings you are looking for or a certain property?
You can get the character code by looking at the character stored in each character, which you can get by using the indexer on a string (string foo; foo[x] ). Then you can convert that character to its unicode value.
string f = "foo";<br />
char c = f[0];
short s = Convert.ToInt16(c);
If memory serves correctly the ASCII set is a subset of Unicode, so an ASCII value will map to the same value in unicode.
HTH,
James
Simplicity Rules!
|
|
|
|
|
STX is the start of text and ETX is end of text and is represented by decimal equivalent of 2 and 3 respectively (like in your case 'f' is represented by decimal value 102).
I have not tried your example yet but I think it should work. Thanks mate.
Abdul.
|
|
|
|
|
i try to transport the msflexgrid control that is very popular in visual basic6.0 development environment to vs.net in windows server2000 environment!
but i try for a whole day,just in vain!hehe!
in vs.net disk1\extra folder,it said i just only need to load the license key register info for the msflexgrid into registery!but not work!
anyone can help me?or we can discuss it?
i will send the msflxgrd.ocx and license key!
|
|
|
|
|
|
hi!
i am a programmer,but i am new to programmer forums!
can everyone tell me other famous and large forums related to programming??
thanks!!
|
|
|
|
|
You could try the VC++ forums if you are a VC++ guy. This is the C# forum.
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
sorry,i mean other websites' forums that is famous and popular and hot other than the forums of codeproject.com
|
|
|
|
|
Oh!
Then try http://codeguru.com
Nish
The rumours that I am an AI bot are absolutely false. These rumours have been propogated by *them* to focus all the attention on to me, while *their* bots take over the planet. Thank y%%%% Divide by zero. Cannot proceed. Abort(y/y)?
|
|
|
|
|
except codeguru.com,codeproject.com,tek-tips.com!
are there any more that is attracting more and more people??thanks!
|
|
|
|
|
This is an odd request. What you're looking for ( flexgrid ) is an odd request, you're unlikely to get an answer. However, codeguru & CP are IMO without doubt the most populated sites on the web. In any case, if you can't figure out www.google.com, you probably shouldn't be programming.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Well said Christian. Coming in here and asking about other forums is tantamount to going into a restaurant and asking the chef there to give you the names of his competitors.
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
*grin* That reminds me of the time I bought pizza from Pizza Hut and took it into McDonalds next door, and sat down to eat it ( some friends wanted the Golden Arches, I wanted something that resembled food ). I was asked to leave.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Man! That's harsh! I'd be like "Hey, my buddies are buying your food and besides you don't even sell pizza!!" Of course, it would not have worked out any better for me. I just like to be argumentative
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
I was well known there - I'd tried to get served in the drive through on foot by getting friends to make car noises while I ordered and holding a plate as a steering wheel.....
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
Sounds like the Jamie Kennedy Experiment to me!
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
i hope you did not overturn the plate!
and Tom,if you say so,you propobly will tangle with the servents,maybe take a beating!and very likely badly battered!haha!
just make fun!
|
|
|
|
|
Tom Archer wrote:
"Hey, my buddies are buying your food and besides you don't even sell pizza!!"
I was at a McDonald's that sold pizza, I think it was somewhere in Kentucky; but that was 7 years ago.
James
Simplicity Rules!
|
|
|
|
|
I have been trying to optimise my screensaver, because when double buffering is turned on it slows right down. I create a bitmap and graphics object in memory, draw to that instead of the screen and in the paint method, draw the bitmap to the screen. There is too much action going on to try and draw only the changed bits. It's slower than turning on double buffering - how can this be ? What faster method for double buffering could exist ? I'm using graphics::drawimageunscaled, but I've tried drawimage.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
I think my next project is going to be a class that manages dirty rectangles.
But for a quickie, what happens if you only update the area that is needed in the OnPaint event (ie use the PaintEventArgs.ClipRectangle). I have a hunch that something is causing the Paint event to be fired outside of your Invalidate(false) so if you draw everything over again, a lot of that is wasted cycles because it will only get clipped off.
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
Invalidate(false)
Ok James, please fill me in on this, what does Invalidate(); do? I don't seem to find a *visible* method called Invalidate(); but I see people calling it.
Nick Parker
|
|
|
|
|
Invalidate is a method that comes from the Control class, calling Invalidate() or Invalidate(bool) forces the control to repaint itself and optionally its child controls.
The other overloads forces a repaint of only a specific area of the control and optionally its child controls.
The term comes from the Win32 API where a window was Invalid if a part of it needed repainting, calling Invalidate set it so the whole window needed updating or just a specific part of it.
James
Simplicity Rules!
|
|
|
|
|