|
What is Qurantext ? If it's a string, why not use the contains method to look for substrings ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
its a string comming from a textbox
Kareem Elhosseny
|
|
|
|
|
OK, so why not use the methods built into the string class to look for substrings ? I think your issue is how convoluted the code is.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I don't get it. What are you trying to do? Why do you deal with unicode issues at all?
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
dear friends thanks for ur attention
i know will C# supported the unicode but i make a comparison for fonts
with unicode
its just a Statistics task
Kareem Elhosseny
|
|
|
|
|
how to create a Clip from a WMV file where user will define the starting and end position of the Clip.
Actually i have to create Functionality as of VCD Cutter.
Regards Rishi
|
|
|
|
|
You'll probably find that DirectX has what you need to do this, but managed DX almost certainly does not, you'll need to interop with DX or use a third party wrapper.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks Christian Graus
can u please tell abt any such Third Party wrapper that can be used with C#.
i had tried a dozen but did't find useful.
Regards
Rishi
|
|
|
|
|
|
Hi all,
I am getting null exception in try block.
what i want to do is:
not breaking the normal execution and run the next line of code.
dont know what to do?
please help me.
thanks in advance
Preetpal Kaur Parhar
|
|
|
|
|
The easiest way is usually to check for null before trying to use the reference.
I don't think that it's useful to be more specific than that without seeing any actual code.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
thanks a lot...
but i have thought of this way before.
and the thing is i have around 20 of fields n i cannot put the check before everything.
so need to do something which applies to all.
can u please guide me little more?
|
|
|
|
|
You have no other choice but to fix your code. You cannot jump back into a try block, your other option is to put a try block around each attempt to assign, and it sounds in general like you're overusing try blocks to allow you to write bad code.
One thing you can do, is write a helper method that takes two values and does the null check and only assigns if it's not null, and call this method 20 times.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
If you apply something to all the code, it can't apply to each of the fields. To handle an exception separately for each field, you would need a try...catch for each of them, which would be a lot more code than checking for a null reference if it's done correctly.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
preetpal wrote: i cannot put the check before everything.
Why not??
There might be another way, depending on your concrete situation. But if it appears that sth. can be null, you simply have to check for it. No escape, no excuse. Everything else is just incorrect code!
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Provide the code that is causing the problem and someone may be able to help you better.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
preetpal wrote: not breaking the normal execution and run the next line of code.
It is generally no good idea to ignore an exception. If you don't care in a certain situation if sth. is null, then you should check that before with an if-statement.
What you are describing sounds like a flaw in your control flow...
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
thx
my code which is causing error is below
XmlNodeList rows = iElement.SelectNodes("./TBODY/TR");
_callerFirstName = rows[2].ChildNodes[0].InnerText.Trim();
_callerLastName = rows[2].ChildNodes[1].InnerText.Trim();
_callerPhone = rows[4].ChildNodes[0].InnerText.Trim();
_callerDept = rows[4].ChildNodes[1].InnerText.Trim();
_callerUserID = rows[6].FirstChild.InnerText.Trim();//error
_callerEMail = rows[8].FirstChild.InnerText.Trim();
user id id null in the html page so i am getting error
its like i can get anything as blank in html page as of now userid is blank
|
|
|
|
|
I'm afraid I don't really get your problem. You are trying to dereference sth. that is null , so you get an exception. This is absolutely correct. I'd be very afraid if I'd see sth. other than that. As I said: Check for null at the appropriate places! Don't try to save typings in the first place.
Remember:
Programming is not about writing the shortest possible code, but about writing code as correct, robust, and readable as possible.
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
preetpal wrote: user id id null in the html page so i am getting erro
So, this is an ASP.NET question ?
This code just plain sucks. You should not be accessing child nodes by index, but by name. Your code is illegible and hard to maintain.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
string getVal(XmlNode node) {
return (node == null ? null : node.InnerText.Trim);
}
|
|
|
|
|
Hello ,
I want to thank you for your great Facebook articles.
I have a question on FaceBook API , is it possible to know if a friend is connected to facebook with a c# code ? I watched all methods , i don't find solution.
Thanks
Si tu aimes ce que tu fais , tu finis par réussir !
(french proverb of David Zenou)
|
|
|
|
|
I haven't written any facebook articles. If you want to speak to someone who wrote an article, use the forum provided under the article itself.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Christian Graus wrote: any facebook articles
Are there any submitted here on CP? Never really noticed it if there has been.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
He said ' I love your facebook articles' so I just assumed another guy who thinks CP is a sweatshop where the same people write the articles and work the forums.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|