| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 751 人关注过本帖
标题:随机文件 长度求助
取消只看楼主 加入收藏
woa
Rank: 1
等 级:新手上路
帖 子:159
专家分:0
注 册:2008-12-4
结帖率:85.37%
收藏
已结贴  问题点数:20 回复次数:1 
随机文件 长度求助
随机文件 长度求助

Private Sub Command1_Click()

With ProperType
Number = Text1.text
iWidth = Text2.Text
iHeight = Text3.Text
iThick = Text4.Text
BagType = Text5.Text
Price = Text6.Text
End With
Open "E:\2.dat" For Random As #1 Len = Len(Property)‘这句出错,没法帮模块定义的长度带入
Put #1, Number, Property

Close #1



End Sub

模块

Type ProperType
 Number As Integer
 iWidth As String * 4
 iHeight As String * 4
 iThick As String * 4
 Price As String * 3
 BagType As String * 8
End Type
Dim Property As ProperType
搜索更多相关主题的帖子: 长度 文件 随机 
2010-09-04 17:59
woa
Rank: 1
等 级:新手上路
帖 子:159
专家分:0
注 册:2008-12-4
收藏
得分:0 
以下是引用风吹过b在2010-9-4 20:06:32的发言:

模块里需要使用 public 关键字进行全局变量定义
public  Type ProperType
    Number As Integer
    iWidth As String * 4
    iHeight As String * 4
    iThick As String * 4
    Price As String * 3
    BagType As String * 8
End Type
public  Property As ProperType

这样,才能全局使用。

的确,加个Public 就可以了,感谢
2010-09-04 22:43
快速回复:随机文件 长度求助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012456 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved