zoukankan      html  css  js  c++  java
  • (三) 语句

    1、if语句

         if 条件表达式 then

    语句块

         else

    语句块

         endif;

    或者是

        if 条件表达式 then

    语句块

       elseif 条件表达式

    语句块

        ....

       endif; 

    例如:

     

     2、if goto语句

    if 条件表达式 goto 标号;

    例如:

     

    3、switch .. endswitch;

      switch (表达式)

    case 常量1: 语句1

      case 常量2: 语句2

    …… 

    default: 语句n+1 

      endswitch;

    例如:

    4、 while语句

     while (表达式)

    语句块

    endwhile;

    注:不能在循环中定义标号 

    例如: 

    5、 repeat .. until语句

    repeat

    语句块

    until (表达式); 

    注:不能在循环中定义标号

    例如:


    6、 for .. endfor语句

     for X = A to B step C

    语句块

    endfor;

    注:X为循环变量,A为初值,B为变量终值,C为单位步长。这里的to也可以变量成downto,如果省略step,则增量自动为1

    注:不能在循环中定义标号

    例如:

     

  • 相关阅读:
    System 类的使用
    StringBuffer 与 StringBuilder类的使用
    String 类 的 使用
    多线程
    音乐播放
    数据库
    表示图编辑
    UITextView(2)
    UITextView
    tarBar
  • 原文地址:https://www.cnblogs.com/wang-can/p/3554458.html
Copyright © 2011-2022 走看看