⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 63.txt

📁 介绍VB里的各种控件的使用方法,窗口控制,图像编程以及OCX等内容,还提供了一个API集供参考.
💻 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 + -