| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1265 人关注过本帖
标题:我是初学着,而且是自学的,现在有个问题请教下啊,里面的i值是什么啊?
只看楼主 加入收藏
柔儿梦婷
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2015-1-24
收藏
得分:0 
以下是引用wangkaicosl在2015-1-15 16:23:26的发言:

Public Class Form1
    Dim i0, i1, i2, i3, x As Integer
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load

        x = 400
        i1 = Val(TextBox1.Text)
        i2 = Val(TextBox2.Text)
        i3 = Val(TextBox3.Text)
        i0 = i1 + i2 + i3 + i2
        Timer1.Interval = 100
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Static i As Integer, dx%
        Dim k%
        i = i + 1
        If i <= i1 * 10 Then
            PictureBox4.Image = PictureBox1.Image
            k = 1
        ElseIf i <= (i1 + i2) * 10 Then
            PictureBox4.Image = PictureBox2.Image


            k = 2
        ElseIf i <= (i1 + i2 + i3) * 10 Then
            PictureBox4.Image = PictureBox3.Image
            k = 3
        ElseIf i <= i0 * 10 Then
            PictureBox4.Image = PictureBox2.Image
            k = 2
            If i = i0 * 10 Then i = 0

        End If
        If k = 3 Then
            If dx < 4 Then dx = dx + 1
        Else
            If x > 130 Or x < 100 Then
                dx = 4
            ElseIf x > 120 Then
                dx = 3
            ElseIf x > 110 Then
                dx = 2
            ElseIf x > 100 Then
                dx = 1
            Else
                dx = 0
            End If
        End If
        x = x - dx
        If x <= -100 Then x = 400
        PictureBox5.Left = x
    End Sub
End Class

说白点就是你买了苹果你要告诉计算机它是苹果,然后开始买了三个个苹果,后来买五苹果那一起就8个苹果就这意思 Dim i0, i1, i2, i3, x As Integer
Private Sub Command1_Click()
i1 = 3
i2 = 5
Print "i1 + i2=8"
End Sub
2015-01-25 18:57
renxiaoyao36
Rank: 9Rank: 9Rank: 9
来 自:七宝中学
等 级:贵宾
威 望:31
帖 子:347
专家分:1077
注 册:2014-9-18
收藏
得分:0 
Dim i0, i1, i2, i3, x As Integer我很好奇这句代码是干嘛的?看样子楼主的本意是要把五个变量都声明为整型变量,但是这样声明的话只有x是整型变量,其他都是自变量。

编程蛋疼的不是枯燥,而是辛辛苦苦编完几百行的代码,运行,“Runtime Error “xxx””。
2015-02-01 22:28
andy1234
Rank: 1
等 级:新手上路
威 望:1
帖 子:16
专家分:7
注 册:2014-6-15
收藏
得分:0 
i是time的步长值,i AS integer 整形数值。
2015-02-10 22:39
快速回复:我是初学着,而且是自学的,现在有个问题请教下啊,里面的i值是什么啊 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020284 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved