Hi, what is up with those special characters?
VB Code:
Public Function OpenLab(ByVal LabFile$) As Boolean
and
VB Code:
Public Function PrintLab(ByVal Num%) As Boolean
What do they do?
Printable View
Hi, what is up with those special characters?
VB Code:
Public Function OpenLab(ByVal LabFile$) As Boolean
and
VB Code:
Public Function PrintLab(ByVal Num%) As Boolean
What do they do?
Its old VB for declaring the var type.
$ = string
% = int
Has something to do with data types, I don't remember what symbols go with which data types though =/
Edit
Listen to the above =)
Didn't see his post when I sent mine.
Edit 2
Wow, now listen to the undersigned as well =)
THey are data types....
DIm Boo$
Dim Boo%
Dim Boo&
$ = string
% = integer
& = Long
:wave:VB Code:
Public Function OpenLab(ByVal LabFile as string) As Boolean 'Public Function OpenLab(ByVal LabFile$) As Boolean Public Function PrintLab(ByVal Num as integer) As Boolean 'Public Function PrintLab(ByVal Num%) As Boolean
OK I kinda figured it was something like that. I used to program in QBASIC and numerals were suffixed in '#' and strings were suffixed in '$'.
Thanks all!
for the record your fellow programmers will shoot you if you use them now
I wonder If I can get away with a global search and replace:
Replace "$"
With "As String"
The replace might not be a good idea, what about the mid$ function, than would look : mid as string (str1,2,5).....
Only the extra 2 :pCode:$ = String
% = Integer
& = Long
! = Single
# = Double
Phreak
no a global search and replace would be a BAD idea
You can reference the strings like this
which after your replace would look likeVB Code:
Dim MyString$ MyString$ = "HELLO WORLD"
VB Code:
Dim MyString As String MyString As String = "GOODBYE WORLD"
In the code, the suffixes were not used. Only on the Dim... line or in the argument line.
After his replace wouldn't it look like this:Quote:
Originally posted by kleinma
no a global search and replace would be a BAD idea
You can reference the strings like this
which after your replace would look likeVB Code:
Dim MyString$ MyString$ = "HELLO WORLD"
VB Code:
Dim MyString As String MyString As String = "GOODBYE WORLD"
VB Code:
Dim MyString As String MyString As String = "HELLO WORLD"
:D
yup except it would be "goodbye" cause the code wouldnt compile ;)Quote:
Originally posted by dsheller
After his replace wouldn't it look like this:
VB Code:
Dim MyString As String MyString As String = "HELLO WORLD"
:D
Then it should be:Quote:
VB Code:
Dim MyString As String MyString As String = "GOODBYE WORLD"
VB Code:
Dim MyString As String MyString As String = "GOODBYE CRUEL WORLD"
speaking of cruel, i have to convert a QBasic program myself and there about 200 variables, all declared at a global level, and they are all 1 or 2 digit namesQuote:
Originally posted by Dave Sell
Then it should be:
VB Code:
Dim MyString As String MyString As String = "GOODBYE CRUEL WORLD"
Dim a1$
Dim a2$
etc....
oooo that is going to be fun :( :( :(