Below is a function that I wrote to get the North/South footage(123) out of a string with a format of: Fr SE corner 123N 654W.
Function strpnsft(ByVal s1 As String) As integer Dim fr, n, s, a As Integer dim s2 as string s2=ucase$(s1) fr = InStr(1, s2, "FR ") + 5 n = InStr(fr, s2, "N") - 1 s = InStr(fr, s2, "S") - 1 If n > -1 Then n = n ElseIf s > -1 Then n = s Else strpnsft = 0 Exit Function End If For a = n To fr Step -1 Do Case (Mid$(s2, a, 1)) Case "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " " Case Else Exit For End Case Next strpnsft = Val(Mid$(s2, a + 1, n - a)) End Function -----Original Message----- From: Tim.Nuteson [mailto:[EMAIL PROTECTED] Sent: Thursday, May 13, 2004 3:20 PM To: [EMAIL PROTECTED] Subject: MI-L Testing to ensure a string is numeric Listers, Does anyone have a method using MapBasic to test whether a string is numeric? I have a dialog with an edittext box that needs a numeric input. Even if the solution is just a big hack that would be OK, since I am going to make a logical MB function along the lines of IsNumeric("123") = TRUE or something. Thanks, will sum. Tim Nuteson Target --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 11747 --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 11748
