Page 40 - ePB316_最佳案例 Visual Basic 2017 程式設計
P. 40

Visual Basic 2017 程式設計





                       敘述區塊(Block Statement)或複合敘述(Compund Statement)
                        ί΂О̙˸׳ఊɓાࠑٙή˙dɰఱঐ׳ાࠑਜ෯dાࠑਜ෯͵၈މልΥાࠑf

                    ɓࡈልΥાࠑ݊͟Շࡈ˸ɪٙાࠑଡ଼ΥϾϓdνɨהͪf

                        t = a
                        a = b
                        b = t


                    ɚe༶ၑό€Expression

                        ΂О̙Ӌ੻࠽ٙόɿdѩ၈މ༶ၑόfԷνj5+3 ึෂΫɓࡈᅰ࠽dה˸ 5+3

                    ݊ɓࡈ༶ၑόfɓছϾԊd̙˸׳ίഃ໮̛ᗙٙ؇Гdே̙˸၈މ༶ၑόfԷνj
                    ˸ɨܼ໮ʫٙ؇Гѩ၈މ༶ၑόf

                        i = 0 : a = 3 : b = 5
                        Console.WriteLine (i+1)          '1
                        Console.WriteLine (a+b)          '8

                        If (a>b)           'False
                        While (a=b)        'True

                    ɧeൗ༆€Comments


                        ቇ຅ٙ೻όൗ༆ঐᄣ̋೻ό̙ٙᛘ׌fՉϣdൗ༆݊ഗɛ޶ٙdᇜᙇኜѩʔʚ
                    ଣึൗ༆ٙʫ࢙fVB ٙൗ༆ϞՇ၇ڌͪ˙όdɭ݊ఊˏ໮€'א Rem ˸ܝٙાࠑd

                    VB ѩൖމൗ༆fԷνj˸ɨાࠑٙ˜ਗ਼ y ࠽ଢ଼̋Ї sum™މൗ༆dʔึ஗ੂБf

                        sum = sum + y                    ' ਗ਼ y ࠽ଢ଼̋Ї sum
                        Rem ਗ਼ y ࠽ଢ଼̋Ї sum

                    ՉϣdVB ᇜᙇኜึਗ਼ൗ༆ᔷމၠЍdνɨྡהͪf





                                                                             ၠЍο











              32
   35   36   37   38   39   40   41   42   43   44   45