Dim sReturnFile, sVisitNo As String

Actually dim's sReturnFile as a variant and sVisit as a String
Breaking them up forced strong typing

This is fixed in dot net.

-David


-----Original Message-----
From: Lew Hundley [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 12:58 PM
To: BostonWorkStation Talk

 
I just spent the better part of an hour tracking down an issue with my
script. It turned out to be a VBA problem, I think.
 
Since my last testing, I had added sVisitNo to the following Dim:
 
Dim sReturnFile, sVisitNo As String
 
When I ran my code to test, I got this error:
 
 

 
 
 
After pulling my hair (as in only one left) out trying to debug this, I
finally did a comparison of the code in issue, found the aforementioned Dim,
and decided to break it apart, like this:
 
Dim sReturnFile As String
Dim sVisitNo As String
 
 
Of course, you know the outcome; it words fine now, no compile error.
 
So my question is, why, when multiple Dims are broken down into single Dims,
does the compiler change its mind and recognize this as a ByVal Dim, and not
the apparent ByRef of the multiple Dim?
 
I am up and running now, so this is not a critical question. I am just
curious. My VB6 training, as I remember, taught me that I could do multiple
Dims using a common 'As' command. Or am I hallucinating...
 
TKs
 
Lew Hundley
Information Specialist - Programmer
Silverton Hospital
Silverton Oregon
503.873.1657
[EMAIL PROTECTED]
 
 
 


The information contained in this message is confidential and is intended for the 
addressee only.  If you have received this message in error or there are any problems, 
please notify the sender immediately.  The unauthorized use, disclosure, copying or 
alteration of this message is strictly forbidden. 



Reply via email to