TypeName将不显示结构类型 [英] TypeName won't display Structure Type

查看:59
本文介绍了TypeName将不显示结构类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用用于存储Prgs设置的结构,到目前为止,一切都正常进行了-现在,我正在改善一些错误处理的过程,但我偶然发现了以下问题"无法弄清楚..
我正在尝试读出结构中保存的变量的类型(布尔值,字符串,整数..)

下面的代码只是我今天如何初始化结构的一个无效示例(很显然,我的结构工作正常)

如果尝试读取结构

I''ve been using structures for storing Prgs settings and so far everything is working nicley- Now I''m in the process of improving some of my error handling and I stumbled over the following "problem" I''m not able to figure out ..
I''m trying to read out the type of the variable held in the structure ( Boolean, string, int ..)

Below code is just as a non working sample of how I initalize the structures today(obvosuly my structures are working just fine )

If I try to read the Typename on my structure

ST.S_string

上的Typename,我会得到一个例外.
如何从我的结构变量中读取类型名称?我想念什么??
tyypname在我的普通变量

, I get an exeption ???
How can I read the typename off my structure variable ?? What am I missing ??
tyypname is working just fine on a my normal varible

D_String


上工作正常




 Dim D_string As String
Public Module T_structures
        Public ST As S_T
        Public Structure S_T
        Public S_string as string
        End Structure
    End Module
    MsgBox(TypeName(D_String))
    MsgBox(TypeName(ST.S_string))

推荐答案

是否给出任何错误?
我发现这是错误的.检查这是拼写错误还是代码错误.应该是
Does it give any error?
I found this to be wrong. Check if it is a typo, or error in code. It should be
Public S_string as string


这篇关于TypeName将不显示结构类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆