|
-
Feb 8th, 2002, 11:04 AM
#1
Thread Starter
Fanatic Member
"Compile Error: Expected: =" when trying to call a sub
I'm trying to call a sub with three parameters.
Code:
CenterPrint(Titl, "Arial", 24)
.
.
.
Private Sub CenterPrint(ByVal Text As String, Optional ByVal FName As String, Optional ByVal FSize As Integer)
If FName Then Printer.Font.Name = FName
If FSize Then Printer.Font.Size = FSize
Printer.CurrentX = Printer.ScaleX / 2 - Printer.TextWidth(Text) / 2
Printer.Print Text
End Sub
Why does VB tell me "Compile Error: Expected: ="
-
Feb 8th, 2002, 11:06 AM
#2
Fanatic Member
Coz your not doing anything with the return value you need to remove the parenthasis from around the arguments...
CenterPrint Titl, "Arial", 24
or use
Call CenterPrint(Titl, "Arial", 24)
Leather Face is comin...
MCSD
-
Feb 8th, 2002, 11:08 AM
#3
Thread Starter
Fanatic Member
God bless you, young man.
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
|