miscfunctions.bas

来自「超级C&C有没有搞错,VB还能编出这种即时策略游戏来!没错,这就是我们的超级C&」· BAS 代码 · 共 45 行

BAS
45
字号
Attribute VB_Name = "MiscFunctions"
Public Function ConvertTrueFalse(VarBlE) As Boolean
If VarBlE = "True" Then ConvertTrueFalse = True Else ConvertTrueFalse = False
End Function
Public Function GetCommandLineArg(ArguementString$) As String
GamePlace = InStr(1, LCase$(Command$), ArguementString$)
If GamePlace > 0 Then
  BeginSpacePlace = InStr(GamePlace + 5, Command$, " ")
  EndSpacePlace = InStr(BeginSpacePlace + 1, Command$, " ")
  If EndSpacePlace = 0 Then EndSpacePlace = Len(Command$) + 1
  GetCommandLineArg = Mid$(Command$, BeginSpacePlace, EndSpacePlace - BeginSpacePlace)
Else
  GetCommandLineArg = "NULL"
End If
End Function
Public Function GetPropertyValue(TextString) As String
GetPropertyValue = Right$(TextString, Len(TextString) - InStr(1, TextString, " "))
End Function
Public Function GetPropertyName(TextString) As String
If InStr(1, TextString, " ") = 0 Then
  GetPropertyName = TextString
Else
  GetPropertyName = Left$(TextString, InStr(1, TextString, " ") - 1)
End If
End Function
Public Function RemoveSpaces(Txt)
NewTxt = Txt
Do
  If Left$(NewTxt, 1) = " " Then
    NewTxt = Right$(NewTxt, Len(NewTxt) - 1)
  Else
    Exit Do
  End If
Loop
RemoveSpaces = NewTxt
End Function

Public Sub Wait(TimeAmount)
EndTime = Timer + TimeAmount
Do
  DoEvents
  If Timer > EndTime Then Exit Do
Loop
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?