computer 版 (精华区)
发信人: windoe (为中国电信做贡献), 信区: program
标 题: VB:Visual Basic里面的整数和字符串如何互相转换?
发信站: 听涛站 (Fri Mar 10 19:09:02 2000), 转信
VB提供了系统函数Val()和Str(),可以用来实现整数和字符串之间的
转换。例子如下:
Sub Str2Int()
Dim int1 As Integer
Dim str1 As String
int1=100
str1=Str(int1)
Debug.Print str1
str1=“400”
int1=Val(str1)
Debug.Print int1
End Sub
--By Kammi's SuperPost General Version
--
夜中不能寐,起坐弹鸣琴。
薄帷鉴明月,清风吹我襟。
孤鸿号外野,翔鸟鸣北林。
徘徊将何见,忧思独伤心。
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:0.939毫秒