Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2004, 09:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

SALAM Mehdi:
well I simulated Ord() function using .NET classes & I do believe that opposite could be possible but I dont know that yet!
When we cant do something it doesnt show that its impossible! isnt it!;)
I went the way u suggested, but its not THE WAY!
Im sure there is a way & Im looking for that! acctually I did something but still useless
Tnx for ur Time.

Always:),
Hovik Melkomian.
 
Old July 18th, 2004, 02:03 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

SALAM Hovik
The way I suggested you do evry thing manualy without dealing with .NET classe
I cant get if it has the same algorithm you want it should work fine.
in my way you convert ASCII to UNICODE manualy(without using .NET classes) according to a
table mapping between UNICODE for Farsi characters(1588'Ô') and ASCI code for Englih characters(97'a')
now I have a question from you,
in your Ord simulation function when for example you give the function 'Ô',what you get?
you get 1588 or 91(decimal) or something else?
Hovik,please tell me more about your Ord() simulation or write the code here
I don't know what your simulation implements exactly(I mean what it receives and what it gives out)
and also I don't know how you converted a UNICODE character outside the ASCII range('Ô')to
a ASCI character correctly with using .NET classe like Encoding and ...(I think it is impossible due to the loss of data)
+++++++++++++++++++++
"Hovik to ro khoda ye khorde vasam bishtar begoo asan man nemidoonam to daghighan mikhay chi kar bokoni
age in simulation function ro inja bezari baz ye chizi halim mishe"
+++++++++++++++++++++



-----------------------------------
Mahdi
I'm waiting for your better idea.
 
Old July 18th, 2004, 08:09 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Dear Mehdi: Tnx for ur response & time, but I dont wanna do it Manually! cuz Im sure there is a way for that & as I said before, what ever we cant do doesnt mean there is no way for that!

Right now Im busy with another problem so I dont go much in detail of that. sorry & tnx again.

Oh by the way, my ord function is like:
Code:
private byte Ord(char c)
{
    Encoding enc = Encoding.GetEncoding(1256);
    byte[] buffer = enc.GetBytes(c.ToString());
    return buffer[0];
}
Dont u believe there should be way for my [u]Chr()</u>?!

Always:),
Hovik Melkomian.
 
Old July 18th, 2004, 05:38 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

I still think its impossible!!!:D:D:D becuase in convertion from UNICODE to ASCII there will be loss of data for characters out of the ASCII range
I didn't see any difference between these only three lines you wrote and a instruction
like (int)charVaribale....
some philosophic lessons!!!!
this sentence you write evry time for me "what ever we cant do doesnt mean there is no way for that!"
isn't right under evry situation.....
anyway inform me if you find the solution ....
Always be happy Hovik

--------------------------------------------
Mehdi
I'm waiting for your better idea.
 
Old July 20th, 2004, 06:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

YUH YUH I did it!;):D:)
[u]in all situations</u> Nothing is impossible

Always:),
Hovik Melkomian.
 
Old July 20th, 2004, 10:21 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

haaah
Congratulations...
but I still believe "in all situations Evrything is possible" not "in all situations Nothing is impossible"!!!
LOOOOOOOL
Tell me how,I want to see if it is the same as I expected.(just copy/paste your code)

--------------------------------------------
Mehdi
I'm waiting for your better idea.





Similar Threads
Thread Thread Starter Forum Replies Last Post
C functions...??? ethantinder C# 2 April 25th, 2008 02:25 AM
Functions LTello BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 3 September 15th, 2006 11:15 AM
functions xelepi PHP How-To 1 March 10th, 2006 02:59 AM
Help with Functions megabytes C# 1 August 7th, 2003 12:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.