DELPHI SQL語句中使用IN 的變量如何寫
*rmfile(filepath);
*;
* := '
select * from *_sn where serial_number in (' + * +')';
*;
這里有一個問題,當serial_number是字符串時,需要分詞并加上‘’號
delphi 語句
語句 首先要說一下begin 。
end; 相當于c或者c++中的{ 。 }。
(1)聲明語句 常量:const 常量標識符[:類型]=常值; 變量:var 變量標識符:數據類型; (2)表達式語句 由運算符組成的合法語句 運算符優先級: 運算符 優先級 @ not 1 (最高) *,/,div,mod,and,shl,shr,as, 2 +,-,or,xor 3 >,<,>=,<=,<>,=,in,is, 4 (最低) (3) with 。 do。
end 語句 主要在操作記錄類型或組件時使用。 示例:type people=Record //定義記錄people name:string; addr:string; age:integer; sex:string; end; var Me:People; //定義people型的變量 with Me do begin name:='Paul'; addr:='Guangzhou'; age:=23; sex:='male'; end; (4)goto 語句 現在所有聲音都是說要減少goto語句是使用,所以盡量少用為是。
示例: Label MyLabel; //用Label保留字聲明MyLabel MyLabel: //標記 、、、 //其它語句 goto MyLabel; //跳轉到MyLabel 處 (5)條件語句 a、if 。 then 。
語句 if布爾表達式 then ..; 或 if布爾表達式 then begin 。 end; 其它格式: if 。
then。 else 。
; if 。 then .. else if 。
then 。 else 。
; b、case 。 of 語句 case表達式 of 值1:。
值2:。 。
值n:。 end; 6)循環語句 a、for 。
to 。 do 語句 for 循環變量:=初值 to 終值 do 。
; 或 for 循環變量:=初值 to 終值 do begin 。
。 end; b、while 。
do 語句 while 布爾表達式 do 。; 或 while 布爾表達式 do begin 。
end; c、repeat 。 until 語句 repeat。
until布爾表達式; (7)循環的中斷 break: 循環結束 continue:結束本次循環 goto:(略) exit:退出當前函數或過程 halt():終止整個程序,參數為整數 RunError():(略) 三、過程與函數 (1) 過程(無返回值) 聲明: procedure <;過程名> (<;參數列表>); (2)函數(有返回值) 聲明: function <;函數名> (<;參數列表>;):返回值類型; 用Result 或 <;函數名>;返回函數值; 即在函數中用 Result:=函數值;或 <;函數名>;:=函數值;返回;。
關于delphi語句的理解
類函數\類過程.
它們是直接操作在類上面(沒有實例化的對象)
下面是Delphi Help 的描述
A class method is a method (other than a constructor) that operates on classes instead of objects. The definition of a class method must begin with the reserved word
class. For example,
type
TFigure = class
public
class function Supports(Operation: string): Boolean; virtual;
class procedure GetInfo(var Info: TFigureInfo); virtual;
。
end;
The defining declaration of a class method must also begin with class. For example,
class procedure *o(var Info: TFigureInfo);
begin
。
end;
In the defining declaration of a class method, the identifier Self represents the class where the method is called (which could be a descendant of the class in which it is defined). If the method is called in the class C, then Self is of the type class of C. Thus you cannot use Self to access fields, properties, and normal (object) methods, but you can use it to call constructors and other class methods.
A class method can be called through a class reference or an object reference. When it is called through an object reference, the class of the object becomes the value of Self.
求delphi編程語句
procedure *ox1Change(Sender: TObject);
var
a:double;
b:double;
c:double;
begin
a := StrToFloat(*);
b := StrToFloat(*);
case *dex of
0: c := a + b;
1: c := a - b;
2: c := a * b;
3: c := a / b;
end;
*n := FloatToStr(c);
end;
procedure *eate(Sender: TObject);
begin
*;
*m('+', ComboBox1);
*m('-', ComboBox1);
*m('*', ComboBox1);
*m('/', ComboBox1);
end;
轉載請注明出處華閱文章網 » delphiin語句