What category of data types is a string

As I understand it, there are two different ways to categorize data types in VBA.

  • Object Type vs. Non-Object
  • Value Type and Link Type

I would suggest that the types of objects match the types of links. But I read that there is a difference in assignment between objects and non-object types:

Dim i As Integer
i = 1

Dim chrt As Chart
Set chrt = something

Pay attention to "Install." Now in the following link, String is classified as a reference type.

http://msdn.microsoft.com/en-us/library/t63sy5hs.aspx

But

Dim str As String
Set str = "abc"

wrong and

Dim str As String
str = "abc"

is correct. Thus, the reference type and the type of the object are not equivalent. What is the difference?

+4
source share
2 answers

MSDN Visual Studio 2013 (.NET), String - (, .net).

VBA - , .

, VBA.

  • -

. - , - .

VBA Set; , Let ( , , ); Let , Public Property Let Foo(value As Integer), Set , Public Property Set Foo(value As Object).

, Let ; Set , .

VBA a String - , Integer Boolean.

+4

VBA , Strings, Arrays .

, :

  • - , .

  • , .

Objects , Reference Types, , Value Types:

  • Boolean
  • Integer
  • Long
  • Single

Strings Arrays . , Reference Types, , VBA Strings Arrays Value Types.

, Strings Arrays, VBA :

  • Set String Array ( Array).

  • String Array .

  • Strings =.

+3

All Articles