You could use something similar to this to verify the input:
Public Function DistToReal(ByVal Text As String, ByVal FromUnit As Integer,
ByVal Reset As Double) As Double
Dim Dist As Double
If Text <> "0" Then
On Error Resume Next
Dist = ThisDrawing.Utility.DistanceToReal(Text, FromUnit)
Err.Clear
If Dist = 0 Then Dist = Reset
End If
DistToReal = Dist
End Function
--
R. Robert Bell, MCSE
www.AcadX.com
"Rodney Crowley" wrote in message
news:D29149A19C5A4A7DE16E9017D47D5CE8@in.WebX.maYIadrTaRb...
| I have considered that, but only as a last option.
|
| Thanks!
|
| "Ed Jobe" wrote in message
| news:D7F9D8DC497815C62720924D43556F83@in.WebX.maYIadrTaRb...
| > I think its sinking in now. I don't have time to try it, but how about
the
| > SendKeys function?
| >
| > --
| > --
| > Ed
| > --
| > "Rodney Crowley" wrote in message
| > news:D08C96B98C92438AE039707FEA8ED898@in.WebX.maYIadrTaRb...
| > > I guess I am having trouble explaining what I am trying to do. with
the
| > > getdistance method, you can feed it a distance at the command line as
an
| > > alternative to picking points. I am looking to do the same thing, but
| > > instead of from the command line, I would like it to pass it from a
| > textbox.
| > > when using the getdistance method from the command line, you can feed
it
| a
| > > value of 1'-4 1/2" and the get function will strip away all of the
| garbage
| > > and store it as 16.5 in your variable. that is what i am trying to
get.
| > >
| > >
| > >
| > >
| > > "Ed Jobe" wrote in message
| > > news:18BEEB741A04E8F74B6CE0A0DC1449D1@in.WebX.maYIadrTaRb...
| > > > Perhaps I don't understand you, but isn't (1'-4 1/2") already a
| > distance?
| > > > The (getdist) function only accepts points, so it wouldn't accept
| (1'-4
| > > > 1/2") without some reformatting.
| > > >
| > > > --
| > > > --
| > > > Ed
| > > > --
| > > > "Rodney Crowley" wrote in message
| > > > news:A0D4FCEB309ABB4545A67C511A0371E1@in.WebX.maYIadrTaRb...
| > > > > I am trying to take the value of a textbox, regardless of how it
is
| > > > entered,
| > > > > and feed it into the getdistance method. In lisp if you pass a
value
| > > > through
| > > > > the (getdist) function it will accept architectural units (1'-4
| 1/2").
| > I
| > > > > would like to give my users the same option in vba, instead of
| writing
| > a
| > > > > function that will take 1'-4 1/2" and convert it to 16.5 I would
| > rather
| > > > pass
| > > > > it through the getdistance method, something that does it for me
| > > already.
| > > > >
| > > > >
| > > > >
| > > > > "Ed Jobe" wrote in message
| > > > > news:F1596219339F86F7B9CB67CB2C459433@in.WebX.maYIadrTaRb...
| > > > > > Value of a text box? I assume you mean the data is two points.
| Just
| > > > > > calculate it yourself. Try this
| > > > http://code.acadx.com/visualbasic/013.htm
| > > > > >
| > > > > > --
| > > > > > --
| > > > > > Ed
| > > > > > --
| > > > > > "Rodney Crowley" wrote in message
| > > > > > news:B34523D4807EE870EB5B7A33E026CDF8@in.WebX.maYIadrTaRb...
| > > > > > > Is there a way to pass the value of a text box to the
getdistanc
| e
| > > > > method?
| > > > > > >
| > > > > > >
| > > > > > > Thanks in advance.
| > > > > > > --
| > > > > > > Rod Crowley
| > > > > > >
| > > > > > >
| > > > > >
| > > > > >
| > > > >
| > > > >
| > > >
| > > >
| > >
| > >
| >
| >
|
|