寻找关于声明语法的解释 [英] Looking For Explanation Regarding Declaration Syntax

查看:93
本文介绍了寻找关于声明语法的解释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有一个问题,我希望有人可以为我澄清。我的问题

关于变量/数组变量的声明。无论如何,我是想知道是否有人可以向我解释以下声明:


Dim sendBytes as [Byte]()= Encoding.ASCII.GetBytes( 是否有人

正在听...)


看起来类型字节是一个数组。它是否正确?另外,

括号代表什么?我尝试找到某种解释但是

不成功。以下语法是否可以替代?


Dim sendBytes as Byte()= Encoding.ASCII.GetBytes(有人在听......)


谢谢,

-

TC

Hello, I have a question I''m hoping someone can clarify for me. My question
regards the declaration of a variable/ array variable. Anyhow, I was
wondering if someone can explain the following declaration to me:

Dim sendBytes as [Byte]( ) = Encoding.ASCII.GetBytes("Is anybody
listening...")

It looks like type byte is an array. Is this correct? Also, what do the
brackets represent? I tried finding some type of explanation but is
unsuccessful. Would the following syntax be an alternative?

Dim sendBytes as Byte( ) = Encoding.ASCII.GetBytes("Is anybody listening...")

Thanks,
--
TC

推荐答案

括号表示''转义''的名称或标识符。


Terrance写道:
The brackets indicate an ''escaped'' name or identifier.

"Terrance" wrote:
您好,我有一个问题,我希望有人可以为我澄清。我的问题
关于变量/数组变量的声明。无论如何,我想知道是否有人可以向我解释以下声明:

Dim sendBytes as [Byte]()= Encoding.ASCII.GetBytes(" Is anybody
听......看起来像字节是一个数组。它是否正确?另外,
括号代表什么?我试着找到某种解释,但是不成功。以下语法是否可以替代?

Dim sendBytes as Byte()= Encoding.ASCII.GetBytes(有人在听......)

谢谢,
-
TC
Hello, I have a question I''m hoping someone can clarify for me. My question
regards the declaration of a variable/ array variable. Anyhow, I was
wondering if someone can explain the following declaration to me:

Dim sendBytes as [Byte]( ) = Encoding.ASCII.GetBytes("Is anybody
listening...")

It looks like type byte is an array. Is this correct? Also, what do the
brackets represent? I tried finding some type of explanation but is
unsuccessful. Would the following syntax be an alternative?

Dim sendBytes as Byte( ) = Encoding.ASCII.GetBytes("Is anybody listening...")

Thanks,
--
TC



谢谢Mercer,好的,有人现在可以告诉我一个名词。你知道我不是那么聪明的...... b $ b b
-

TC

" AMercer"写道:
Thanks Mercer, OK, can someone now tell me in laymens term. You know I''m not
that smart...lol
--
TC
"AMercer" wrote:
括号表示''转义''的名称或标识符。

Terrance写道:
The brackets indicate an ''escaped'' name or identifier.

"Terrance" wrote:
您好,我有一个问题,我希望有人可以为我澄清。我的问题
关于变量/数组变量的声明。无论如何,我想知道是否有人可以向我解释以下声明:

Dim sendBytes as [Byte]()= Encoding.ASCII.GetBytes(" Is anybody
听......看起来像字节是一个数组。它是否正确?另外,
括号代表什么?我试着找到某种解释,但是不成功。以下语法是否可以替代?

Dim sendBytes as Byte()= Encoding.ASCII.GetBytes(有人在听......)

谢谢,
-
TC
Hello, I have a question I''m hoping someone can clarify for me. My question
regards the declaration of a variable/ array variable. Anyhow, I was
wondering if someone can explain the following declaration to me:

Dim sendBytes as [Byte]( ) = Encoding.ASCII.GetBytes("Is anybody
listening...")

It looks like type byte is an array. Is this correct? Also, what do the
brackets represent? I tried finding some type of explanation but is
unsuccessful. Would the following syntax be an alternative?

Dim sendBytes as Byte( ) = Encoding.ASCII.GetBytes("Is anybody listening...")

Thanks,
--
TC



Terrance写道:
Terrance wrote:
感谢Mercer,好的,现在有人可以用非专业术语来告诉我。你知道我不是那么聪明......大声笑
Thanks Mercer, OK, can someone now tell me in laymens term. You know I''m not
that smart...lol




在VB中的标识符周围放置方括号可以让你使用

VB保留字作为变量名。你提供的例子并不是
真的需要它们。这是一个例子:


Dim [String] As String =" Hello World"

MsgBox([String])



Putting square brackets around an identifier in VB allows you to use a
VB reserved word as a variable name. The example you provided does not
really need them. Here''s an example:

Dim [String] As String = "Hello World"

MsgBox([String])


这篇关于寻找关于声明语法的解释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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