Re: Newbie help please
- From: "Ralph" <nt_consulting64@xxxxxxxxx>
- Date: Sun, 29 Oct 2006 22:03:47 -0600
"Rick Rothstein (MVP - VB)" <rickNOSPAMnews@xxxxxxxxxxxxxxxxx> wrote in
message news:%23TGmKE8%23GHA.4320@xxxxxxxxxxxxxxxxxxxxxxx
assignMinor point Rick, but the above will produce a runtime error (13) if the
user doesn't enter anything.
I know... I mentioned as much in my last paragraph (the one following that
code snippet).
dblXinput = InputBox("Enter Lower Right X Coordinate") & 0#
will avoid the error.
The OP is a newbie, I didn't want to bog him down with those kind of
tricks... yet.<g>
Dim dblXinput As String
Do
dblXinput = InputBox("Enter Lower Right X Coordinate")
Loop While dblXinput = ""
lblxinput.Caption = CStr(dblXinput)
With the above the CStr() conversion is not necessary as dblXinput was
declared as a string. All is well of course until Wally attempts to
variableto a double - which will then produce an error. Unless he provides a
conversion Dbl(dblXinput_str).
Bad editing on my part. The OP's initial code declared dblXinput as a
Double, so I used that initially. Then I went back and changed the
to a String and missed the CStr function I had used. Thanks for noticingit.
Which is just a boorish way to agree with you - there is always more to
even
the simplest task than often meets the eye.
Sort of the point I was making in the last paragraph of my previous post.
Rick
Plus the fact that sooner or later someone would have come in here and
suggested that the OP not use an InputBox, but create his own dialog. Then
we could go into the best means for 'returning' the value (public member,
event, Registry, ...), and the necessity of using a double for a coordinate
(wasting 8-bytes when 4 or 2 might do) which would lead to ...
With any luck, we could turn this whole thing into a 12-page dissertation.
<G>
-ralph
.
- Follow-Ups:
- Re: Newbie help please
- From: Mike Williams
- Re: Newbie help please
- References:
- Newbie help please
- From: cmw_ca
- Re: Newbie help please
- From: Mike Williams
- Re: Newbie help please
- From: Wally
- Re: Newbie help please
- From: Rick Rothstein \(MVP - VB\)
- Re: Newbie help please
- From: Ralph
- Re: Newbie help please
- From: Rick Rothstein \(MVP - VB\)
- Newbie help please
- Prev by Date: Re: How to allow a specific number of Instances of my app?
- Next by Date: Re: How to allow a specific number of Instances of my app?
- Previous by thread: Re: Newbie help please
- Next by thread: Re: Newbie help please
- Index(es):
Loading