摘要载入中… 请稍等…
内容载入中… 请稍等…
| ◎→ | 本类最新 |
|
Win95系统API函数大揭秘 WIN32 API的分类介绍-- WIN32 API的分类介绍-- WIN32 API的分类介绍-- WIN32 API VB中用API函数实现文件夹列表 VB中利用API函数实现特殊窗体的两 |
|
| ◎→相关资源 | |
| C语言入门视频教程 C#编程WinForm入门视频 Asp.net入门视频教程下载 VC++编程视频教程下载 VB窗体文章 HTML入门教程 VB基础视频教程 VB窗体文章 VB文件文章 VB数据库文章 VB-API文章 VB控制文章 | |
| ◎→ | 热门资源 |
| ListBox项的控制 HitTest的妙用 HitTest的妙用 B对低层硬件访问控制 《 VB5中注册控件三法 》 指定文件夹 怎样在DELPHI中使用API函数 |
|
一个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), " #### ")
[1]
| 芯友网版权所有 1999-2006 | 著作权与商标声明 | 法律声明 | 服务条款 | 隐私声明 | 联系我们 |