Visual_Basic 板


LINE

想请问大家一个问题 我在类别库中写了一个阵列,类别库的namespace为studyhost,程式码如下: Public Class math Private _buffername as String Private _idx as integer Private _xaxis() As Single Private _yaxis() As Single Private _fname() as string Property buffername() As String Get Return _buffername End Get Set(ByVal value As String) value = _buffername End Set End Property Property fname() As String() Get Return _fname End Get Set(ByVal value() As String) value = _fname End Set End Property Property idx() As Integer Get Return _idx End Get Set(ByVal value As Integer) If IsNumeric(value) = False Then Exit Property End If value = _idx End Set End Property Property xaxis() As Single() Get Return _xaxis End Get Set(ByVal value As Single()) value = _xaxis End Set End Property Property yaxis() As Single() Get Return _yaxis End Get Set(ByVal value As Single()) value = _yaxis End Set End Property 而主程式如下 Public Class Form1 Dim buffer As String = "" Dim mytool As New studyhost.math Sub open() mytool.idx = 0 Me.OpenFileDialog1.Filter = "文字档(*.txt)|*.txt" If Me.OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then For Each record As String In Me.OpenFileDialog1.FileNames mytool.fname(mytool.idx) = record ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^在这边出现"使用new关键字建立 物件值型个体" mytool.idx = mytool.idx + 1 mytool.buffername = mytool.buffername +_ mytool.fname(mytool.idx) & vbNewLine Next Me.TextBox1.Text = mytool.buffername End If 曾经也试过加入redim 语法去修正这个错误,不过还是无法正确的解决问题,希望大家 可以提醒一下,要怎样去修正,谢谢!! -- --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.114.43.86
1F:推 fumizuki:为什麽math没看到fname这个成员@@ 08/02 14:36
2F:推 fumizuki:而且fname也指定为Nothing 要如何存取? 08/02 14:36
3F:→ jonsen:对不起我漏贴了 08/02 14:36
※ 编辑: jonsen 来自: 140.114.43.86 (08/02 14:38)
4F:→ jonsen:nothing是後来才加的,我是想要先初始化阵列 08/02 14:41
5F:→ jonsen:不过就算是把它拿掉 还是会出现一样的问题@@ 08/02 14:41
※ 编辑: jonsen 来自: 140.114.43.86 (08/02 14:44)
6F:→ fumizuki:重点是重点没有初始化@@ 08/02 14:49
7F:→ fumizuki: 阵列 08/02 14:50
8F:→ jonsen:恩,原来是这样,谢谢您:),不过我拿掉nothing,还是会出现 08/02 14:55
9F:→ jonsen:一样的问题 08/02 14:56
10F:→ fumizuki:拿不拿都一样是nothing... 08/02 17:14







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:Tech_Job站内搜寻

TOP