type yf
    name as string
    sex as boolean
end type

解决方案 »

  1.   

    public type point
     x as long
     y as long
    end typedim cur as pointmsgbox cstr(cur.x) & "x" & cstr(cur.y)
      

  2.   

    public/private type 类型名
                        元素名 as 变量类型
                        元素名 as 变量类型
                          .
                          .
                          .
                   end type
    注:若在模块中定义自定义类型,则前面需加public,若在窗体中定义自定义类型,则只能用private