Home > Software engineering >  Array as a function parameter, followed by parentheses should take?
Array as a function parameter, followed by parentheses should take?

Time:10-23

Functions are defined as follows:
The Function CRC8 (ByRef Data () As Byte) As Boolean

When using this function
DIM Buffer (10) as byte
1, If CRC (Buffer)=False Then the Exit Function
2, If CRC (Buffer ())=False Then the Exit Function

Use 1 and 2, the two USES (i.e. parameter Buffer, Buffer ()) is it all right, and what is the difference between these two kinds of usage?

CodePudding user response:

Seems to have no what, can use the

CodePudding user response:

Array itself is equivalent to a variable, so don't write bracket, such as
Dim (s) As String
S=Split (" 1, 2, 3, "",")

CodePudding user response:

This doesn't have to ask, you write code, run the don't know?

Array declaration, when used with or without parentheses, have said is to use the array (except empty parentheses, subscript),
If some kind of writing do not conform to the grammar, it inevitably will prompt you have wrong,
If is not prompt, according to two kinds of writing,

CodePudding user response:

To estimate the original poster is to tell him the official help consistent explanation of the effect of these two kinds of writing the words,

To be honest, I feel this is a lexical analysis problems, in other languages, similar needs, whether you need to add table array brackets also true to say, at least in VB is to add don't add,
  • Related