troubleshooting Question

Type/With prob

Avatar of shifty12
shifty12 asked on
Visual Basic Classic
2 Comments1 Solution198 ViewsLast Modified:
I can't get this to work. The compiler err is shown in Form_Load. I want to write this to a relative file so I can run my hex-editor to take a peek at it.

'--------------------- in .BAS
 Public Type TP
    ln As Long  ' len of this whole thing
    Tstr As String
    Tlng As Long
    Tint As Integer
  End Type

  Global Rec As TP

'---------------------- in .FRM
Private Sub Form_Load()

  With Rec
    .ln = Len(Rec)
    .Tstr = "ABC"
    .Tlng = 1
    .Tint = 2
  End With

  A$ = Rec  ' <=== type mismatch err
 
  FR = FreeFile
  Open "TYP.DAT" For Random Access Read Write As #FR Len = 50

  Put #FR, 1, A$
  Close FR
 
End Sub

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros