|
-
Aug 4th, 2004, 03:42 PM
#1
Thread Starter
PowerPoster
Wierd Function arguments - % and $ [RESOLVED]
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?
Last edited by Dave Sell; Aug 4th, 2004 at 04:00 PM.
-
Aug 4th, 2004, 03:48 PM
#2
Its old VB for declaring the var type.
$ = string
% = int
-
Aug 4th, 2004, 03:49 PM
#3
Fanatic Member
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 =)
-
Aug 4th, 2004, 03:49 PM
#4
Hyperactive Member
THey are data types....
DIm Boo$
Dim Boo%
Dim Boo&
$ = string
% = integer
& = Long
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
Born to help others
(If I've been helpful then please rate my post. Thanks)
call me EJ or be slapped! 
-
Aug 4th, 2004, 03:59 PM
#5
Thread Starter
PowerPoster
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!
-
Aug 4th, 2004, 04:03 PM
#6
for the record your fellow programmers will shoot you if you use them now
-
Aug 4th, 2004, 04:16 PM
#7
Thread Starter
PowerPoster
I wonder If I can get away with a global search and replace:
Replace "$"
With "As String"
-
Aug 5th, 2004, 12:59 AM
#8
The replace might not be a good idea, what about the mid$ function, than would look : mid as string (str1,2,5).....
-
Aug 5th, 2004, 03:08 AM
#9
Code:
$ = String
% = Integer
& = Long
! = Single
# = Double
Only the extra 2 
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Aug 5th, 2004, 08:41 AM
#10
no a global search and replace would be a BAD idea
You can reference the strings like this
VB Code:
Dim MyString$
MyString$ = "HELLO WORLD"
which after your replace would look like
VB Code:
Dim MyString As String
MyString As String = "GOODBYE WORLD"
-
Aug 5th, 2004, 08:57 AM
#11
Thread Starter
PowerPoster
In the code, the suffixes were not used. Only on the Dim... line or in the argument line.
-
Aug 5th, 2004, 01:20 PM
#12
Fanatic Member
Originally posted by kleinma
no a global search and replace would be a BAD idea
You can reference the strings like this
VB Code:
Dim MyString$
MyString$ = "HELLO WORLD"
which after your replace would look like
VB Code:
Dim MyString As String
MyString As String = "GOODBYE WORLD"
After his replace wouldn't it look like this:
VB Code:
Dim MyString As String
MyString As String = "HELLO WORLD"
-
Aug 5th, 2004, 01:22 PM
#13
Originally posted by dsheller
After his replace wouldn't it look like this:
VB Code:
Dim MyString As String
MyString As String = "HELLO WORLD"
yup except it would be "goodbye" cause the code wouldnt compile
-
Aug 5th, 2004, 01:24 PM
#14
Thread Starter
PowerPoster
VB Code:
Dim MyString As String
MyString As String = "GOODBYE WORLD"
Then it should be:
VB Code:
Dim MyString As String
MyString As String = "GOODBYE CRUEL WORLD"
-
Aug 5th, 2004, 01:32 PM
#15
Originally posted by Dave Sell
Then it should be:
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 names
Dim a1$
Dim a2$
etc....
oooo that is going to be fun
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|