请先登录 | 注册 |
MYCSG.CN |
■标题:B4A常见语法(VB) |
■作者:IPSC [2025/3/17 19:58:02] If test1 Then 'code1 Else If test2 Then 'code2 Else code3 End If ----------------------- Select TestExpression Case ExpressionList1 ' code1 Case ExpressionList2 ' code2 Case Else code3 End Select Select Value Case 1, 2,3,4 Select a + b Case 12, 24 Select Txt.CharAt(Index) Case "A","B","C" -------------------------------- For i = n1 To n2 Step n3 ' Code bloc Next -------------------------------- Label1.Text = IIf(EditText1.Text <> "", EditText1.Text, "Please enter value") -------------------------------- Example For - Each: Private Numbers() As Int Private Sum As Int Numbers = Array As Int(1,3,5 ,2,9) Sum =0 For Each n As Int In Numbers Sum = Sum + n Next -------------------------------- Do While test ' code Loop Do Until test code Loop Do Until Loop: Private i, n As Int i=0 Do Until i=10 ' code i=i+1 Loop Do While Loop: Private i,n As Int i=0 Do While i<10 ' code i=i+1 Loop ----------------------- 【回复/版区/上篇/下篇/发贴/仅文字/HTML】 |
【倒序/最近21条回复】(暂无) |
(查看完整版网页) |
短讯|首页|登录|算法|电脑版 . DK MiniBBS Plus v2.0 mm0759.com 31 毫秒 . |