“基本问题” [英] "Basic Question"

查看:75
本文介绍了“基本问题”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些声明有什么区别:

Dim strMyData()as string





Dim strMyData as string()


-Peter

What is the difference between these declarations:
Dim strMyData() as string

and

Dim strMyData as string()

-Peter

推荐答案

我相信它们是等价的。我认为第二个已被弃用。

虽然,它在VB 2005测试版1中运行良好。


Dim strMyData()As String = {" a" ;," b"," c"}

Dim strMyData As String()= {" a"," b"," c"}

>
Greg

" pmclinn" < PE *** @ mclinn.com>在消息中写道

news:11 ********************* @ f14g2000cwb.googlegro ups.com ...
I believe they are equivalent. I think the second has been deprecated.
Although, it works fine in VB 2005 beta 1.

Dim strMyData() As String = {"a", "b", "c"}
Dim strMyData As String() = {"a", "b", "c"}

Greg
"pmclinn" <pe***@mclinn.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
这些声明有什么区别:
Dim strMyData()as string


Dim strMyData as string()

-Peter
What is the difference between these declarations:
Dim strMyData() as string

and

Dim strMyData as string()

-Peter



Peter,


正如格雷格说他们有相同的结果,


但是

dim str(10)字符串去了

dim str()as String(10)不去


有点令人困惑的是,在一个函数或其他你需要的地方

你要写的类型:

private function myfunction(byval str as String())as string()

Ctype(mytype,String())


我希望这有帮助吗?


Cor


" pmclinn" < pe *** @ mclinn.com>
Peter,

As Greg said they have equal results,

However
dim str(10) as String goes and
dim str() as String(10) does not go

A little bit confusing is that in a function or other places where you need
the type you will write:
private function myfunction (byval str as String()) As string()
Ctype(mytype, String())

I hope this helps?

Cor

"pmclinn" <pe***@mclinn.com>
这些声明之间有什么区别:
Dim strMyData()as string



Dim strMyData as string()

-Peter
What is the difference between these declarations:
Dim strMyData() as string

and

Dim strMyData as string()

-Peter



" Cor Ligthert" <无************ @ planet.nl> schrieb:
"Cor Ligthert" <no************@planet.nl> schrieb:
正如Greg所说他们有相同的结果,

然后
dim str(10),因为String去了并且
dim str()as String (10)不去
As Greg said they have equal results,

However
dim str(10) as String goes and
dim str() as String(10) does not go




但是'Dim astr As String(10){}''将起作用。


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB < URL:http://dotnet.mvps.org/dotnet/faqs/>



But ''Dim astr As String(10) {}'' will work.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


这篇关于“基本问题”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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