|
ups my fault. i made a misstake again.
lat=482344 ->lat 4839556
it´s for converting from nmea to google earth kml files if someone cares.
|
|
|
|
|
I still don't get excatly your question, but I've google for something like this:
http://home.online.no/~sigurdhu/Deg_formats.htm
(which is 2nd answer for "nmea coordinates" in google btw)
It has conversions from dd.ddddd to dd.mm.ss, is this is what you were looking for?
|
|
|
|
|
|
How about explaining it in detail?
|
|
|
|
|
basically, i can achieve it by having an overloaded funciton, but, it is just a small issue that i do not want to have another overload of the function. I am having a funciton with 2 parameters and now i want to introduce a 3rd optional parameter. I just want to know whether the caller of the function passed the 3rd argument or not?
|
|
|
|
|
Simple
When declaring an optional parameter you have to give it a default value.
Just check if the value is different than the default, if it is it was passed, if its the same it wasn't.
|
|
|
|
|
|
I don't want to be nit-picky, but C# 4.0 actually does support default parameters
modified 12-Sep-18 21:01pm.
|
|
|
|
|
In Microsoft published Framework 2.0, few examples exists when you need to passing optional parameters... i haven't book with me now but i know it is possible.
I'll show you examples later bec i already used it....
Thanks
Naresh Prakash
|
|
|
|
|
I also heard they were already supported in the .NET 2.0 CLR, but for some reason the features were not exposed to the C# language.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
abhiram_nayan wrote: now i want to introduce a 3rd optional parameter.
Would you please paste the code? I really do not know how to do this...
I Love KongFu~
|
|
|
|
|
If it is there then it is passed...
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
For a pretty damn perfect explaination MSDN[^]
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hi, dude, optional keyword is for VB.net, not C#.
I Love KongFu~
|
|
|
|
|
There is nothing like optional parameter in C#.
Time is the best teacher; unfortunately it kills all of its students.
जय हिंद
|
|
|
|
|
Not until C# 4, at least.
(Oook, DaveyM69 posted the same thing at the same time... )
|
|
|
|
|
Can't do that until C# 4.0 which hasn't been released yet.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
this means, i should go with an overloaded function, that's it?!
|
|
|
|
|
If there is not anything that stops you from adding another overload (such as conflicting signature with another overload), yes.
Alternatively, you can mimic an optional parameter by addin a parameter that accepts null values, and using a default value in the method body if null has been received.
|
|
|
|
|
In reference to C# 4.0, I was just curious, would it be possible to know if an optional parameter was passed or no ? If we did not pass the value, it would take the default value which is defined. But how will the body know if the optional parameter was passed or no ?
|
|
|
|
|
Well, it will not know. It will use the default value without worring if it was passed by the caller or automatically used.
The whole point of optional parameters is to make that logic transparent to the method implementation.
|
|
|
|
|
Well, I understand that. Looking at the OP's question and the given reference to C# 4.0 Optional parameters, made me curious.
|
|
|
|
|
Hi
Any body help me
I am new in MVC design pattern. i want call one main form to
another form using MVC design pattern, How can handle the Model view
control object. Please give some article path about this.
Thank you
|
|
|
|
|
|