라이선스가 부여된 사용자만 번역 문서를 볼 수 있습니다. 번역 문서를 보려면 로그인하십시오.


Character array from Automation server


IDL Method Signature

HRESULT GetCharArray([in] BSTR varName, [in] BSTR Workspace,  
[out, retval] BSTR *mlString)

Microsoft Visual Basic Client

GetCharArray(varname As String, workspace As String) As String


str = GetCharArray(h,'varname','workspace')


str = GetCharArray(h,'varname','workspace') gets the character array stored in varname from the specified workspace of the server attached to handle h and returns it in str. The values for workspace are base or global.


This example uses a Visual Basic® .NET client.

  1. Create the Visual Basic application. Use the MsgBox command to control flow between MATLAB® and the application.

    Dim Matlab As Object
    Dim S As String
    Matlab = CreateObject("matlab.application")
    MsgBox("In MATLAB, type" & vbCrLf _
        & "str='new string';")
  2. Open the MATLAB window, then type:

    str='new string';
  3. Click Ok.

        S = Matlab.GetCharArray("str", "base")
        MsgBox("str = " & S)
    Catch ex As Exception
        MsgBox("You did not set 'str' in MATLAB")
    End Try

    The Visual Basic MsgBox displays what you typed in MATLAB.

Introduced before R2006a

Was this topic helpful?