Click here to Skip to main content
15,890,973 members
Home / Discussions / Mobile
   

Mobile

 
QuestionConfiguring Network Pin
Dushan1232-Dec-08 1:53
Dushan1232-Dec-08 1:53 
Questionhelp with socket programming ???? Pin
viku20082-Dec-08 1:11
viku20082-Dec-08 1:11 
Questionhow to send email Pin
spring 271-Dec-08 21:22
spring 271-Dec-08 21:22 
AnswerRe: how to send email Pin
Joel Ivory Johnson2-Dec-08 7:53
professionalJoel Ivory Johnson2-Dec-08 7:53 
QuestionANSI versions for Win API functions Pin
akirilov1-Dec-08 4:31
akirilov1-Dec-08 4:31 
AnswerRe: ANSI versions for Win API functions Pin
Giannakakis Kostas4-Dec-08 20:39
professionalGiannakakis Kostas4-Dec-08 20:39 
GeneralRe: ANSI versions for Win API functions Pin
akirilov10-Dec-08 3:36
akirilov10-Dec-08 3:36 
QuestionDecimal numbers and Devices languages. [modified] Pin
Hurricane300028-Nov-08 6:42
Hurricane300028-Nov-08 6:42 
Hi all,

I written the below code with the purpose to sort several string-arrays and two ComboBox.Items.
It's important to precise that I only want to change the order with witch them are stored (in arrays) or displayed in ComboBox.Items (not to sort them alphabetically).
It's also important to precise for Lat1 and Lon1, I input them in TextBox3, using the "." (dot) separator. Using ",", return me an error.
Well, the following code works perfectly (as I espected from it) in emulator of English VS 2005, but doesn't works perfectly in real device (PPC Windows mobile 2003 SE).
I obtain in ComboBoxes. items a not correct and different order of items.
I am almost sure that cause of the problem is the different Language of device (Italian) because the logic of the code is correct, but I don't know how to resolve it.
Italian language use the comma "," as decimal delimitator, instead of the dot.
Can someone help me, please?

Thanks

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Dim Lat1, Lon1, Lat2, Lon2 As Double
Distances = New Single(LatsWpt.GetLength(0) - 1) {}
Dim Distance As Single
Dim Index As Integer
Dim NRow As Integer
Dim LatString As String = ""
Dim LonString As String = ""

For Counter = 1 To Len(TextBox3.Text)
If Microsoft.VisualBasic.Mid(TextBox3.Text, Counter, 1) <> " " Then LatString = LatString + Microsoft.VisualBasic.Mid(TextBox3.Text, Counter, 1) Else Exit For
Next
For Counter = Counter + 1 To Len(TextBox3.Text)
If Microsoft.VisualBasic.Mid(TextBox3.Text, Counter, 1) <> " " Then LonString = LonString + Microsoft.VisualBasic.Mid(TextBox3.Text, Counter, 1)
Next
Lat1 = Val(LatString)
Lon1 = Val(LonString)

For Index = 1 To LatsWpt.GetLength(0) - 1
Lat2 = LatsWpt(Index)
Lon2 = LongsWpt(Index)
Distance = (6371 * 3.1415926 * Math.Sqrt((Lat2 - Lat1) * (Lat2 - Lat1) + Math.Cos(Lat2 / 57.29578) * Math.Cos(Lat1 / 57.29578) * (Lon2 - Lon1) * (Lon2 - Lon1)) / 180)
Distances(Index) = Distance


Next

For Index = Distances.GetLength(0) - 1 To 1 Step -1
For Counter = 1 To Index
If Distances(Counter) > Distances(0) Then Distances(0) = Distances(Counter) : NRow = Counter
Next

Distances(NRow) = Distances(Index) : Distances(Index) = Distances(0) : Distances(0) = 0
WptFile(0) = WptFile(NRow) : WptFile(NRow) = WptFile(Index) : WptFile(Index) = WptFile(0) : WptFile(0) = Nothing
NamesWpt(0) = NamesWpt(NRow) : NamesWpt(NRow) = NamesWpt(Index) : NamesWpt(Index) = NamesWpt(0) : NamesWpt(0) = Nothing
DescriptionsWpt(0) = DescriptionsWpt(NRow) : DescriptionsWpt(NRow) = DescriptionsWpt(Index) : DescriptionsWpt(Index) = DescriptionsWpt(0) : DescriptionsWpt(0) = Nothing
LatsWpt(0) = LatsWpt(NRow) : LatsWpt(NRow) = LatsWpt(Index) : LatsWpt(Index) = LatsWpt(0) : LatsWpt(0) = Nothing
LongsWpt(0) = LongsWpt(NRow) : LongsWpt(NRow) = LongsWpt(Index) : LongsWpt(Index) = LongsWpt(0) : LongsWpt(0) = Nothing

Next

ComboBox1.Items.Clear()
ComboBox4.Items.Clear()
For Index = 1 To Distances.GetLength(0) - 1 : ComboBox1.Items.Add(NamesWpt(Index)) : Next
For Index = 1 To Distances.GetLength(0) - 1 : ComboBox4.Items.Add(DescriptionsWpt(Index)) : Next

End Sub

modified on Saturday, November 29, 2008 11:17 AM

QuestionHelp mee,,,, I'm confused,,, Pin
VANDAWAA25-Nov-08 15:11
VANDAWAA25-Nov-08 15:11 
QuestionI cannot run Java App on Samsung Pin
elshorbagy25-Nov-08 0:35
elshorbagy25-Nov-08 0:35 
QuestionProgramming joystick with Ms embedded vc on the pocket pc Pin
mousemicky24-Nov-08 8:13
mousemicky24-Nov-08 8:13 
QuestionThe problem of scrolling a scroll in a dialog ? Pin
oppstp24-Nov-08 5:47
oppstp24-Nov-08 5:47 
QuestionHow to connect a PDA to a remote mysql database? Pin
baburman24-Nov-08 5:41
baburman24-Nov-08 5:41 
QuestionWinCE Services and Logging Pin
Like2Byte18-Nov-08 11:07
Like2Byte18-Nov-08 11:07 
AnswerRe: WinCE Services and Logging Pin
Giannakakis Kostas19-Nov-08 3:14
professionalGiannakakis Kostas19-Nov-08 3:14 
GeneralRe: WinCE Services and Logging Pin
Like2Byte19-Nov-08 3:48
Like2Byte19-Nov-08 3:48 
QuestionGDI: How do we repaint a static control placed on gradient background Pin
vmsjames17-Nov-08 12:42
vmsjames17-Nov-08 12:42 
QuestionWriteFile returns Success(Nonzero Value) NumberofBytesWritten is 0 Pin
Shiva Prasad9-Nov-08 2:50
Shiva Prasad9-Nov-08 2:50 
QuestionExcel file Pin
Praful Nand N7-Nov-08 22:12
Praful Nand N7-Nov-08 22:12 
QuestionRe: Excel file Pin
danhpt8-Nov-08 17:28
danhpt8-Nov-08 17:28 
AnswerRe: Excel file Pin
ujjawal kumar12-May-09 2:45
ujjawal kumar12-May-09 2:45 
QuestionConfiguration Quandary Pin
pdohara7-Nov-08 5:55
pdohara7-Nov-08 5:55 
QuestionHow to load a client driver programatically... Pin
abupriabi@yahoo.com6-Nov-08 10:45
abupriabi@yahoo.com6-Nov-08 10:45 
Questionstop multiple instance of same program Pin
Cory Kimble5-Nov-08 4:42
Cory Kimble5-Nov-08 4:42 
AnswerRe: stop multiple instance of same program Pin
Joel Ivory Johnson5-Nov-08 17:59
professionalJoel Ivory Johnson5-Nov-08 17:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.