|
Well, first off, you would have to remove all the non-numeric characters. Then you could do System.Convert.ToInt32(string); where string is the string that you want to pass in.
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
I'm sure that ToInt32 would throw an InvalidCast exception, you could use a try catch to catch them, or use a regular expression to strip all non-numeric content. PLan A is a hack, plan B would take a tiny bit longer to impliment.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
I think I said to remove non-numeric characters...
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
You sure did, but while imran has been here for six months, in that time he does not seem to progress beyond asking the simplest of questions, and not explaining HOW to remove the characters is just begging for another post from him, so may as well answer it all at once.
In fact, he's now asked the same question in the C++ forum. I'm not sure if he was lost when he posted here, or if he's decided to change languages for this project after looking at the RegEx help in MSDN....
It's funny how often you answer a question though, and a day later, someone else posts the exact same answer to the same question.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
dear first of all let me tell you that i am doing my work in dot net that's why i can use any language it might be c# or vc++ (does not matter for myself atleast)?
but some time there are wrong answers for a question thats why it asked again.
as well well as the progress is consern let the day come when i put my project here.
r00d0034@yahoo.com
|
|
|
|
|
imran_rafique wrote:
dear
Why is it that I need to keep telling people who don't speak English that calling me 'dear' is inappropriate ? *sheesh*
I guess you were using .NET, seeing as you asked on the C# forum. Duh. The point is, is how easily you can do some simply string mashing a good reason to choose one language over another ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Hey Christian, what's your MSN IM address?
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
Sorry, don't have one. I've managed to avoid the IM thing. I ran up Sonork last night when CP when down, but I usually don't run that ( and certainly not here at work ).
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
I've managed to avoid the IM thing
Why? It's really convenient. I wouldn't have known about this little fiasco here had not James alerted me via IM.
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
Check my post count now, and tomorrow. Then ask yourself, if this man had IM, would he get any work done at all ? Plus work frowns on it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
Check my post count now, and tomorrow.
No need. You're number two on the Most Active list.
Christian Graus wrote:
if this man had IM, would he get any work done at all ? Plus work frowns on it.
There's always home...
What time is it there? It's about 8 PM here...(Southern Cali, US, North America, Western Hemisphere, Earth, Inner Space, Solar System, Milky Way, Universe, God's hand)
What about your neck of the woods?
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
David Stone wrote:
No need. You're number two on the Most Active list.
I was number one for a long time, but Nish overtook me. I don't think he posts much anymore though, so maybe I might find my fortunes taking a turn for the better.....
David Stone wrote:
What time is it there?
2:30 pm. By the time I am on my PC at home working into the night, most CPians are asleep. I'm thinking of keeping Sonork running though. I am MeanManOz on Sonork ( a long story ).
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
2:30 pm. By the time I am on my PC at home working into the night, most CPians are asleep.
How sad...don't you hate the fact that we actually have to sleep.
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
Yes, I often think about how much more productive I could be if I could just stay up and work. I only get 2-3 hours most nights for my own projects.....
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
Yes, I often think about how much more productive I could be if I could just stay up and work
I think Nish would have an answer for that one.
Cheers
Kannan 
|
|
|
|
|
ROTFLMAO! This is great! Your post, and his are only 3 minutes apart!
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
*grin* Yes, I liked that, too. I hope he gets it together and looks up regular expressions in MSDN, it's gotta be easier than string mashing in C++.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
how to remove non-numeric content?
r00d0034@yahoo.com
|
|
|
|
|
Hello, I am having problem adding a new excel worksheet using C#. I am able to acquire the first worksheet no problem, but when I try to add a new worksheet, the code bombs out with a COM exception. Here is what I have:
m_Excel.Worksheets.Add(null, null, 1, Excel.XlSheetType.xlWorksheet);
In vb, this function is easy because it has default parameters, so you can just call Worksheets.Add, however, in C# this is not the case. Any help would be greatly appreciated.
|
|
|
|
|
If you're getting a COM Exception, then I'm going to guess that you aren't using the OfficeXP Primary Interop Assemblies.
You should use these for any Office XP work.
Office XP Primary Interop Assemblies[^]
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
in C# default parameters are handled differently, if you problem is because of default parameters
try
<br />
Object o = System.Reflection.Missing.Value;<br />
m_Excel.Worksheets.Add(ref o,ref o,1,Excel.XLSheetType.xlWorksheet);<br />
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Can we make the progress bar a solid line instead of one composed of squares? Also, how can I make text appear, like the progress percentage?
tx
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
The Standard Progress Bar sucks. Use this one instead:
Enhanced Progress Bar[^]
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
I am writing a wizard that will execute a process to generate some source code files. As a part of that wizard, I want to have the user navigate to a directory so that I can save the source files and a project file in that directory. The only file dialog I see in the Windows Forms toolbox collection is FileSaveDialog and FileOpenDialog. When I use these dialog boxes (even with VerifyFileExists set to false) the dialog requires clicking on a file.
Any suggestions on how to do a dialog that only requires a browse to a directory WITHOUT using the old COMM dialog box?
_____________________________________________
I have a tendancy to where my mind on my sleeve I have a habit of losing my shirt...
|
|
|
|
|
There isn't one...You just have to use the SHBrowseForFolder API Call. There is no way around it.
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|