| 发表于:2007-10-11 15:01:006楼 得分:10 |
vb6里对应struct的关键字是type.根据你的描述,在vb6里你可以用class封装一个type.如下: option explicit '学生信息 private type stdinfo id as long name as string address as string '..... end type '班级信息 private type clsinfo number as string '班级人数 students() as stdinfo end type private curcls as clsinfo public function add(id as long, name as string, address as string) as string '前置断言 '...... curcls.number = curcls.number + 1 redim curcls.students(curcls.number) '添加操作 '...... end function public function del(id as long) as string '删除预处理 '...... curcls.number = curcls.number - 1 redim curcls.students(curcls.number) end function public function getxxx(id as long) as string '如 getname \ getaddress ...... end function public function setxxx(id as long) as string '如 setname \ setaddress ...... end function | | |
|