zoukankan      html  css  js  c++  java
  • Lazarus -Pascal常量

    2.常量

    2.1.普通常量

    仅仅下面类型可以被定义为常量
    Ordinal类型
    Set类型
    指针类型 (but the only allowed value is Nil). 
    real类型 
    Char, 
    String
    下面是定义的类型
    Const  
      e = 2.7182818;  { Real type constant. }  
      a = 2;          { Ordinal (Integer) type constant. }  
      c = ’4’;        { Character type constant. }  
      s = ’This is a constant string’; {String type constant.}  
      sc = chr(32)  
      ls = SizeOf(Longint);  
      P = Nil;  
      Ss = [1,2];  
    常量定义后是不能被赋值的,所以:
    s := ’some other string’; 
    这样编译器是会报错的。

    2.2.资源字符串

    resourcestring  
      Part1 = ’First part of a long string.’;  
      Part2 = ’Second part of a long string.’;  
      Sentence = Part1+’ ’+Part2; 
    看下面代码:
    resourcestring  
      Yes = ’Yes.’;  
      No = ’No.’;  
     
    Var  
      YesNo : Array[Boolean] of string = (No,Yes);  
      B : Boolean;  
     
    begin  
      Writeln(YesNo[B]);  
    end. 

  • 相关阅读:
    underscore.js,jquery.js源码阅读
    css3动画知识点
    ajax防止重复提交
    jquery data属性的使用
    文字换行
    vue的生命周期
    iphone与安卓的兼容性问题汇总
    python 上下文管理器
    form 校验
    常用的字段和字段参数
  • 原文地址:https://www.cnblogs.com/China3S/p/3290337.html
Copyright © 2011-2022 走看看