请问如何在命令行交互输入字符串?
请问如何在命令行交互输入字符串?我想对某一层进行操作,用"Getstring",输入层名时总是出错。 <PRE class=Code>Utility.GetString</PRE><PRE class=Code>AutoCAD里有帮助</PRE><PRE class=Code>Sub Example_GetString()' This example demonstrates different ways of returning a string
' entered by a user.
Dim returnString As String
' Prompt & Input cannot contain blanks
returnString = ThisDrawing.Utility.GetString(False, "Enter text (a space or <enter> terminates input): ")
MsgBox "The string entered was '" & returnString & "'", , "GetString Example"
' Prompt & Input can contain blanks
returnString = ThisDrawing.Utility.GetString(True, "Enter text (<enter> terminates input):")
MsgBox "The string entered was '" & returnString & "'", , "GetString Example"
' Prompt & Input can contain blanks, but not an empty string
Dim NoNull As Integer
NoNull = 1 ' Disallow null
ThisDrawing.Utility.InitializeUserInput NoNull
returnString = ThisDrawing.Utility.GetString(True, "Enter text (<enter> terminates input): ")
MsgBox "The string entered was '" & returnString & "'", , "GetString Example"
End Sub</PRE> 谢谢
页:
[1]