Private Sub Form_Load()
Dim location As Integer, n As Integer, source As String, target As String
Show
source = "East and west,home is best!": target = "st"
location = 1: n = 0
location = InStr(location, source, target) + 1
Do While location > 1
n = n + 1
location = InStr(location, source, target) + 1
Loop
Print n
End Sub
其中source = "East and west,home is best!": target = "st"
location = 1: n = 0
这两条语句何解?请大家指点,谢谢了
Dim location As Integer, n As Integer, source As String, target As String
Show
source = "East and west,home is best!": target = "st"
location = 1: n = 0
location = InStr(location, source, target) + 1
Do While location > 1
n = n + 1
location = InStr(location, source, target) + 1
Loop
Print n
End Sub
其中source = "East and west,home is best!": target = "st"
location = 1: n = 0
这两条语句何解?请大家指点,谢谢了
解决方案 »
- 置顶贴中的QQ表情模拟程序中的要求纯底色的flash是啥意思?
- 有两个表(都含有ID字段),如何查询两个表中ID不一样的记录?很急啊!
- 我们的论坛正式运行,希望大家踊跃注册.
- 如何在VB中调试Active X DLL的文件?各位大虾帮忙了,谢谢!!
- 偶想做一个打印的控件,不知如何下手呵,请高手讲一下原理是什么。
- 如何使一个外部程序(非vb本地程序)在后台运行?
- api程序响应键盘上下光标,如同word一样
- 做考试系统中的评分模块时,文本核对得出分数如何实现?
- 请问如果将控件数组的index参数传递给另一个窗体?
- 有人知道吗?
- 将JPG转灰度然后二值化,速度,显示和打印的问题
- 如何向远程服务器的传送伪造的http头(http_Referer)??
location = 1: n = 0====其实是4条语句,可分解为:
source = "East and west,home is best!"
target = "st"
location = 1
n = 0: 在此处的作用就是分隔两条语句。没什么意义,可以节省一点行数。
好像分行用的 _ 符号一样。没有实际意义。但是不是同时执行的。也是分开执行,从左到右的顺序。
以前学习机上我就误解成同时执行,导致这样的错误:goto abc: number=5
楼上的答案非常完美,fxy_2002(阿勇) 乃是顶尖高手!