FixedLengthString 생성자

정의

FixedLengthString 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
FixedLengthString(Int32)

길이를 지정하여 클래스의 FixedLengthString 새 인스턴스를 초기화합니다.

FixedLengthString(Int32, String)

길이와 초기 값을 지정하여 클래스의 FixedLengthString 새 인스턴스를 초기화합니다.

FixedLengthString(Int32)

길이를 지정하여 클래스의 FixedLengthString 새 인스턴스를 초기화합니다.

public:
 FixedLengthString(int MaxChars);
public FixedLengthString(int MaxChars);
new Microsoft.VisualBasic.Compatibility.VB6.FixedLengthString : int -> Microsoft.VisualBasic.Compatibility.VB6.FixedLengthString
Public Sub New (MaxChars As Integer)

매개 변수

MaxChars
Int32

Integer 문자열의 길이를 지정하는 값입니다.

예제

다음 예제에서는 선언 하 고 사용 하는 방법을 보여 줍니다 FixedLengthString.

Private Sub DemoFixedLengthString()
    ' Declare a string that has a length of 7 characters.
    Dim fixedString As New FixedLengthString(7)
    ' Assign a value to the string.
    fixedString.Value = "Hello World"
    ' Display the string in a message box.
    ' Note that only the first 7 characters are shown.
    MsgBox(fixedString.ToString)
End Sub

설명

Visual Basic 6.0에서는 해당 선언에서 문자열의 길이를 지정할 수 있습니다. Visual Basic 선언에서 VBFixedStringAttribute 특성을 사용하지 않는 한 문자열을 고정 길이로 선언할 수 없습니다.

이 클래스를 사용하여 특성을 사용하지 않고 고정 길이 문자열을 선언합니다.

메모

Microsoft.VisualBasic.Compatibility.VB6 네임스페이스의 함수 및 개체는 Visual Basic 6.0에서 Visual Basic 2008로 업그레이드하는 도구에서 사용할 수 있도록 제공됩니다. 대부분의 경우 이러한 함수와 개체는 .NET Framework의 다른 네임스페이스에서 찾을 수 있는 기능을 복제합니다. Visual Basic 6.0 코드 모델이 .NET Framework 구현과 크게 다른 경우에만 필요합니다.

적용 대상

FixedLengthString(Int32, String)

길이와 초기 값을 지정하여 클래스의 FixedLengthString 새 인스턴스를 초기화합니다.

public:
 FixedLengthString(int MaxChars, System::String ^ InitialValue);
public FixedLengthString(int MaxChars, string InitialValue);
new Microsoft.VisualBasic.Compatibility.VB6.FixedLengthString : int * string -> Microsoft.VisualBasic.Compatibility.VB6.FixedLengthString
Public Sub New (MaxChars As Integer, InitialValue As String)

매개 변수

MaxChars
Int32

Integer 문자열의 길이를 지정하는 값입니다.

InitialValue
String

초기 내용을 지정하는 A String 입니다.

예제

다음 예제에서는 선언 하 고 사용 하는 방법을 보여 줍니다 FixedLengthString.

Private Sub DemoFixedLengthString()
    ' Declare a string that has a length of 7 characters and assign the
    ' initial string. The additional 5 positions will be padded with
    ' spaces.
    Dim fixedString As New FixedLengthString(7, "He")
    ' Display the string in a message box.
    MsgBox(fixedString.ToString)
    ' Assign a new value to the string.
    fixedString.Value = "Hello World"
    ' Display again. Note that only the first 7 characters are shown.
    MsgBox(fixedString.ToString)
End Sub

설명

Visual Basic 6.0에서는 해당 선언에서 문자열의 길이를 지정할 수 있습니다. Visual Basic 선언에서 VBFixedStringAttribute 특성을 사용하지 않는 한 문자열을 고정 길이로 선언할 수 없습니다.

이 클래스를 사용하여 특성을 사용하지 않고 고정 길이 문자열을 선언합니다.

메모

Microsoft.VisualBasic.Compatibility.VB6 네임스페이스의 함수 및 개체는 Visual Basic 6.0에서 Visual Basic 2008로 업그레이드하는 도구에서 사용할 수 있도록 제공됩니다. 대부분의 경우 이러한 함수와 개체는 .NET Framework의 다른 네임스페이스에서 찾을 수 있는 기능을 복제합니다. Visual Basic 6.0 코드 모델이 .NET Framework 구현과 크게 다른 경우에만 필요합니다.

적용 대상