Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21751

Type mismatch : array or user-defined type expected

$
0
0
Hello everyone , i'm came up with an error:
Compile error
Type mismatch : array or user - defined type expected
when i was trying to process such code :

in module i have :
Code:

Public type book
    Object(2) as string
End type

Public Record as book

public sub Proc(Object() as textbox, Record as book)
    for i = 0 to 2
        Record.Object(i) = Object(i).text
    next i
    put 1, 1, Record
end sub

In main form i have following
I have three text boxes with name Object with index'es 012 - an array

and folowing code in cmdbutton :
Code:

Open FilePath for Random as 1
Call Proc(Object(2), Record)

And then i get mismatch error while object(2) being highlighted
Can anyone suggest anything or point what i'm doing wrong
Than you in advance

Viewing all articles
Browse latest Browse all 21751


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>