📄 63.txt
字号:
一个Format函数
A new Format function
Visual Basic 5 has the Format command that almost works the same as Print. The difference is that Format shortens the output string length if all the format characters are not used. To work around this I wrote a Public Function called FormatNum.
Public Function FormatNum(MyNumber As Double, FormatStr As String) As String
注释: This Function returns number formatted as a string
注释: with the desired minimum number of characters
注释: MyNumber - Use CDbl(MyNumber) in the function
注释: call to prevent type mismatch error.
注释:
FormatNum = Format$(MyNumber, FormatStr)
If Len(FormatNum) < Len(FormatStr) Then
FormatNum = Space$(Len(FormatStr) - Len(FormatNum)) & FormatNum
End If
End Function
Use this function like this:
Print #FileNumber, FormatNum(CDbl(MyVariable), " #### ")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -