|
このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。 |
This page is "browser friendly". Make your browser window as wide as you want it. The text will flow nicely for you. It is easier to read in a 狭くする window. With most browsers, 圧力(をかける)ing 加える, minus or 無 while the 支配(する)/統制する 重要な (ctrl) is held 負かす/撃墜する will change the texts size. (大きくする, 減ずる, 回復する to default, それぞれ.) (This is more fully explained, and there's another tip, at my 力/強力にする Browsing page.)
Discussed herein....
A programmer should often want to 含む 公式文書,認めるs within the code which makes an 使用/適用 do what it does.
There are three ways to make comments in Lazarus code, three ways to make the compiler ignore text that is part of what has been typed into the Source Editor.
(If you think you know as much as you wish to about comments, skip 負かす/撃墜する to the section about the usefulness of the "使用/適用.肩書を与える" 所有物/資産/財産, and of having a "見解/翻訳/版 ID" constant.)
If you are working through my guide to Lazarus, you will have seen one way already, although I said nothing about the 関連した lines when they arose. Have a look a the に引き続いて... do you understand everything after the line 説 "私的な"? The code is an 抽出する from an earlier tutorial.
TForm1 = class(TForm)
buQuit: TButton;
eAnswer: TEdit;
laQuestion: TLabel;
私的な
{ 私的な 宣言s }
bNum0,bNum1:byte;
public
{ public 宣言s }
end;
In that code, we 宣言する bNum0 and bNum1.
What difference do you think the line that says....
{ 私的な 宣言s }
.. makes to the code created by the compiler? Decide your answer before you scroll 負かす/撃墜する!
--
--
--
--
... If you said "The line makes no difference at all.. no code is created because of it"...
--
--
...you are 訂正する! It makes no difference to the code for the 使用/適用 created by the compiler.
That doesn't mean it is pointless. What it does do is to help the human reading the code understand something. In this 事例/患者 the comment shows the human that 私的な 宣言s (whatever they may be!) should go at that 場所 in the 使用/適用's code. ("私的な 宣言s" are not something you need to worry about at this 行う/開催する/段階.)
The squiggly brackets that you see will make anything between them "invisible" to the compiler.
Another 指名する for "a comment" is "a 発言/述べる", which is the origin of the rather poor English programmers いつかs 沈む to, when they say, for instance, "That bit has been remmed out."
A comment may run across several lines....
TForm1 = class(TForm)
buQuit: TButton;
eAnswer: TEdit;
laQuestion: TLabel;
私的な
{ Comments are
put in the 使用/適用's
code with squiggle brackets
such as you see here.}
bNum0,bNum1:byte;
public
{ public 宣言s }
end;
A comment may also be created by surrounding the text with (* in 前線 of the comment, and *) at the end....
TForm1 = class(TForm)
buQuit: TButton;
eAnswer: TEdit;
laQuestion: TLabel;
私的な
(* Comments can also be
put in the 使用/適用's
code with bracket-and-asterisk
used as you see here.*)
bNum0,bNum1:byte;
public
{ public 宣言s }
end;
いつかs it is easier just to say "I want the 残り/休憩(する) of this line, just this line, to be a comment, to be ignored."
You do that with a 二塁打 今後 削除する: //
TForm1 = class(TForm)
buQuit: TButton;
eAnswer: TEdit;
laQuestion: TLabel;
私的な
// 私的な 宣言s
bNum0,bNum1:byte;
public
{ public 宣言s }
end;
You do いつかs get several rems in a 列/漕ぐ/騒動...
TForm1 = class(TForm)
buQuit: TButton;
eAnswer: TEdit;
laQuestion: TLabel;
私的な
// Comments are
// put in the 使用/適用's
// code several different
// ways.
bNum0,bNum1:byte;
//bNum0 and bNum1 will be used to 持つ/拘留する
// the numbers the 使用者 is to 追加する
// together.
public
{ public 宣言s }
end;
Probably the most important and valid use of rems is to 挿入する explanatory text like the lines after "bNum0..." above.
Notice the use of indenting to make things easier to read.
Another use is いっそう少なく wise, but we all do it...
Suppose you are working on a program which 選ぶs two numbers at 無作為の....
bNum0:=無作為の(10); bNum1:=無作為の(10);
... and now suppose that you 手配中の,お尋ね者, say, bNum1 always to be a 4, just while you did some 実験(する)s. Here's something you might do, now that you know about using rems...
bNum0:=無作為の(10);
bNum1:=4;//for debugging. 回復する next when this
//no longer needed.
//bNum1:=無作為の(10);
If you thought things were now okay, and you didn't need to 軍隊 bNum1 to be 4 every time... but you might want to go 支援する to doing it, you would just alter the "//"s...
bNum0:=無作為の(10);
//bNum1:=4;//for debugging. 回復する next when this
//no longer needed.
bNum1:=無作為の(10);
You will 遭遇(する) comments created with the squiggly brackets in both Lazarus and Delphi which are not (完全に) ignored by the compiler. All such comments have a dollar sigh as the first character in the comment. Don't put a $ there yourself, unless you want to make trouble for yourself, until you know how to make this sort of "comment", which is known as a compiler 指示的な. Here's an example....
{$mode objfpc}
Compiler 指示的なs 影響する/感情 how the compiler builds your 使用/適用. The good news is that you don't have to understant them at this 行う/開催する/段階, and that Lazarus (and Delphi) will put them in as needed. 結局, you may 井戸/弁護士席 want to fiddle with them, to change what is going on... but you don't need to yet!
Variables were explained in an earlier tutorial.
A constant is a little bit like a variable... but it doesn't 変化させる!
You (不足などを)補う your own 指名するs for constants, just as you do for variables. One constant I create and use in the code for every 使用/適用 I 令状 is one I call "skVer" (String "K"onstant), for "見解/翻訳/版 ID". I use it often enough that my spellchecker knows that this is "a word", and doesn't ask if I want to 訂正する it.
I put the "権利 stuff" into my code (I'll explain it in a moment), and once I've done that, I can "fetch" the 現在の 見解/翻訳/版 identifier 簡単に by referring to "skVer" where ever I need the 見解/翻訳/版 ID. If the 見解/翻訳/版 ID needs to be changed, I make one change in my code, at the point where "skVer" is defined, and everywhere in the code that the 見解/翻訳/版 ID is important, the 権利, new, 見解/翻訳/版 ID is 接近d.
I keep a date in "skVer". It tells me when the 使用/適用's code was last 修正するd. I don't have to change it every time I change a 選び出す/独身 line... I only have to change it as often is needed so that whenever I 遭遇(する) an instance of my 使用/適用, I can tell how old that 見解/翻訳/版 of it is. If I produce, and save (in backups, for instance) several 見解/翻訳/版s in a 選び出す/独身 day, say 29 July 11, then the second 見解/翻訳/版 is 29 July 11b, the third is 29 July 11c, etc.
To create the constant "skVer", you use the に引き続いて. You can of course 始める,決める it to other things! But you can't, どこかよそで in the code, change what's inside something defined with const. (I've created another constant ("TaxRate") in what follows, so you can see how it is done.)
For constants which will be needed throughout the 部隊, 宣言する them just after the uses 条項 近づく the 最高の,を越す of the code.
const skVer='28 July 11';
TaxRate=12;
Notice the わずかに strange thing: Here, not どこかよそで, you use the equals 調印する for assignment. (どこかよそで the equals 調印する on its own is a comparison 操作者. どこかよそで you have to pair the equals 調印する with a 結腸 to do assignments, e.g. bNum0:=5.
As I said, I always have a "skVer" constant in the code for my 使用/適用. And in the FormCreate handler I always have something like the に引き続いて. What you see here is the 明確な/細部 instance of the code for an 使用/適用 called "DE23"....
DE23f1.caption:='DE23, Barcode reader, 見解/翻訳/版 '+skVer;
I had, as usual, 指名するd the form "DE23f1" because the 使用/適用 was called "DE23"
The line of code above 原因(となる)s the 肩書を与える 妨げる/法廷,弁護士業 of the 使用/適用's window to say "DE23, 見解/翻訳/版 23 損なう 2010" because, in the 使用/適用's code, I have... for the moment...
const skVer='23 損なう 2010';
As soon as the 使用/適用 starts up, I can see which 見解/翻訳/版 I am running, just by looking at the 肩書を与える at the 最高の,を越す of the 使用/適用's window.
While we're at it, put the に引き続いて in your FormCreate handler, too. (Again, the example assumes that the program's short-form identifier is "DE23".)
使用/適用.肩書を与える:='DE23';
You want to keep this string short. It will adorn icons and such associated with the app.
許す an abrupt 停止(させる)? Or not... (^_^)
|
|
If you visit 1&1's 場所/位置 from here, it helps me. They host my website, and I wouldn't put this link up for them if I wasn't happy with their service. They 申し込む/申し出 things for the beginner and the 会社/団体.![]()
Page has been 実験(する)d for 同意/服従 with INDUSTRY (not MS-only) 基準s, using the 解放する/自由な, 公然と accessible validator at validator.w3.org. Mostly passes.
Page 実験(する)d for 同意/服従 with INDUSTRY (not MS-only) 基準s, using the 解放する/自由な, 公然と accessible validator at validator.w3.org
....... P a g e . . . E n d s .....