导航
  • 全部
...

大家好,好久不来这里了。此段代码的错误提示该如何处理?

大刘0417 2010-03-22 07:42:09
Option Strict On
Structure CUSTOMER
Dim COMPANY As String
Dim MANAGER As String
Dim ADDERSS As String
Dim CITY As String
Dim COUNTRY As String
Dim CUSTOMERSINCE As Date
Dim BALANCE As Decimal
End Structure

Public Class Form1
'该数组保存了10个客户的数据
Private CUSTOMERS(9) As CUSTOMER

Private CUST As CUSTOMER
Private CURRENTINDEX As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
'该按钮调用GETCUSTOMER()函数来获取下一个客户的数据,并利用SHOWCUSTOMER()子程序把客
'户的数据显示在窗体上的标签里,然后增加变量CURRENTINDEX的值,让它指向当前客户的索引
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If CURRENTINDEX = COUNTCUSTOMERS() Then CURRENTINDEX = 0

End Sub
'返回CUSTOMERS数组里的记录数量
Function COUNTCUSTOMERS() As Integer
Return (CUSTOMERS.Length)
End Function
Function GETCUSTOMER(ByVal IDX As Integer) As CUSTOMER

End Function
End Class

红色部分提示:
错误 1 “GETCUSTOMER”不能通过 class“Form1”在项目外部公开类型“CUSTOMER”。 C:\Documents and Settings\Administrator\Local Settings\Application Data\Temporary Projects\types项目(包括自定义数据类型)\Form1.vb 32 51 types项目(包括自定义数据类型)

这是书上的例子,该怎么办?
...全文
给本帖投票
120 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
大刘0417 2010-03-22
  • 打赏
  • 举报
回复
非常感谢,看来得从头学起了!
结贴给分!
xingyuebuyu 2010-03-22
  • 打赏
  • 举报
回复
Public Structure CUSTOMER
Dim COMPANY As String
Dim MANAGER As String
Dim ADDERSS As String
Dim CITY As String
Dim COUNTRY As String
Dim CUSTOMERSINCE As Date
Dim BALANCE As Decimal
End Structure

CUSTOMER前面加上Public
大刘0417 2010-03-22
  • 打赏
  • 举报
回复
将变量、过程参数或函数返回的访问级别更改为至少与其数据类型的访问级别具有相同的限制性。

我是新手,请问如何更改?
wiki14 2010-03-22
  • 打赏
  • 举报
回复
变量、过程参数或函数返回在其容器外公开,但却声明为不得在容器外公开的类型。

将变量、过程参数或函数返回的访问级别更改为至少与其数据类型的访问级别具有相同的限制性。

16,722

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧

手机看
关注公众号

关注公众号

客服 返回
顶部