Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET General

Post new topic   Reply to topic
HELP!
View previous topic :: View next topic  
Author Message
computerreality
Newbie


Joined: 13 May 2004
Posts: 1

PostPosted: May 13th, 2004 06:38 PM    Post subject: HELP! Reply with quote

[vb:1:18eb989224]Option Explicit
Dim char(37) As String
Dim mess As String
Dim ctr, ctrb As Integer

Private Sub cmdStart_Click()
Dim FSO As New FileSystemObject
Dim txtFile As File
Dim txtStream As TextStream
cmdStart.Enabled = False
cmdStop.Enabled = True
cmdStart.Caption = "Please Wait!"
Set txtFile = FSO.CreateTextFile("myfile.txt", True)
Set txtStream = txtFile.OpenAsTextStream(ForWriting)
For ctrb = 0 To 35
For ctr = 0 To 35
txtStream.WriteLine (ctr)
Next ctr
txtStream.Write (ctrb)
Next ctrb
txtStream.Close
End Sub

Private Sub cmdStop_Click()
cmdStart.Enabled = True
cmdStop.Enabled = False
cmdStart.Caption = "Start"
End Sub

Private Sub Form_Load()
For ctr = 0 To 9
char(ctr) = Chr(ctr + &H30)
Next ctr
For ctr = 65 To 91 'A to Z
char(ctr - 55) = Chr(ctr)
Next ctr
End Sub

Private Sub Form_Unload(Cancel As Integer)
End
End Sub[/vb:1:18eb989224]

getting a type mi-smatch error, anyone know why
Back to top
View user's profile Send private message AIM Address
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Jul 29th, 2004 04:32 AM    Post subject: Reply with quote

On which line does this happen?
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
CheatKing64
Freshman


Joined: 06 Aug 2004
Posts: 32
Location: The US of A

PostPosted: Aug 18th, 2004 03:15 PM    Post subject: Reply with quote

dunno if this would cause a type mismatch error, but in your variable declarations (and I'm assuming VB.NET is similar in syntax to VB6) at the top of the code, you have declared ctr as a variant. The line reads:
[vb:1:eca409bf8a]
Dim ctr, ctrb As Integer
[/vb:1:eca409bf8a]
when it should read:
[vb:1:eca409bf8a]
Dim ctr As Integer, ctrb As Integer
[/vb:1:eca409bf8a]
to get the effect.
_________________
NCSA Certified in HTML 4.0:


EasyMail POP/SMTP Server:
http://easymail.sourceforge.net
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Aug 23rd, 2004 11:54 AM    Post subject: Reply with quote

.NET will interpret "Dim a, b as Integer" as "Dim a as Integer, b as Integer". It's one of the new features.
The way the code is layed out indicates to me that the person might be using VB4, 5, or 6 instead of .NET. .NET is not as friendly as VB. The Option and the arrays would not be declared where they are, the Form_Load defaults to having variables passed to it.
What it looks like is they took VB6 code and paste it in VB.NET and expected it to work.
_________________
If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » .NET General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic