FixedLengthString 생성자

정의

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

오버로드

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 선언에는 특성입니다.

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

참고

Visual Basic 6.0에서 Visual Basic 2008으로의 업그레이드 도구에서 사용할 수 있도록 Microsoft.VisualBasic.Compatibility.VB6 네임스페이스의 함수 및 개체가 제공됩니다. 이러한 함수와 개체에서 제공하는 대부분의 기능은 .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

초기 콘텐츠를 지정하는 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 선언에는 특성입니다.

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

참고

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

적용 대상