Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共18 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:FOXTABLE有没有跳转语句?

1楼
飞鱼 发表于:2010/9/26 9:48:00
就是有一段代码,在几个IF ..... END IF里面都用到,又比较长,如果能公用,使用跳转语句就好了.
2楼
狐狸爸爸 发表于:2010/9/26 9:58:00
Dim number As Integer = 1
Dim sampleString As String
If number = 1 Then
    GoTo Line1
End If
number =2
Line1:
sampleString = "Number equals 1"
3楼
lihe60 发表于:2010/9/26 10:05:00
以下是引用狐狸爸爸在2010-9-26 9:58:00的发言:
Dim number As Integer = 1
Dim sampleString As String
If number = 1 Then
    GoTo Line1
End If
number =2
Line1:
sampleString = "Number equals 1"

Line1:

什么地方结束呀。用return吗?

[此贴子已经被作者于2010-9-26 10:05:44编辑过]
4楼
飞鱼 发表于:2010/9/26 10:05:00
运行提示"line1" 没有定义
5楼
狐狸爸爸 发表于:2010/9/26 10:06:00
line1后面有冒号
6楼
狐狸爸爸 发表于:2010/9/26 10:08:00

GoTo Line1

表示跳转到Line1标记,标记区分大小写,用冒号结尾。

7楼
lihe60 发表于:2010/9/26 10:20:00
Dim number As Integer = 1
Dim sampleString As String
If number = 1 Then
    GoTo Line1
End If
Line1:
sampleString = "Number equals 1"
Line2:
sampleString = "Number equals 2" 
output.show(sampleString)
8楼
lihe60 发表于:2010/9/26 10:29:00

Dim number As Integer
Dim sampleString As String
For number=1 To 2 Step 1
    GoTo Line1
    'GoTo Line" & number & "
    messagebox.show(sampleString)
    'messagebox.show(1)
Next

Line1:
sampleString = "Number equals 1"
Return
Line2:
sampleString = "Number equals 2"
Return

 

 

这个代码怎么没有反应呀?

9楼
飞鱼 发表于:2010/9/27 9:26:00
我在使用GOTO时也发现问题,就是把要跳转的代码挪出去后,代码中涉及到的一些变量,运行时系统提示没有定义,而这些变量在跳转前都已经定义过了的.
10楼
狐狸爸爸 发表于:2010/9/27 9:30:00
请参考帮助“变量的作用范围”
共18 条记录, 每页显示 10 条, 页签: [1] [2]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03125 s, 2 queries.