このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。

翻訳前ページへ


Delphi: Introduction to programming from 明言する/公表する diagrams- DT2n HOME - - - - - - - TUTORIALS INDEX - - - - - - - - - - - - Other 構成要素 for programmers

Introduction to using 明言する/公表する diagrams

A 交替/補充 for flowcharts?

This is ーするつもりであるd to give you a quick introduction to 明言する/公表する driven, or event driven, programming. You may say "I can 令状 what you've 提案するd, but without all the "複雑化s" in your 解答." If you do, you're 行方不明の the point. Your simple answer to the simple problem will probably be 罰金... but will the techniques you've used 規模 to more コンビナート/複合体 状況/情勢s?

Long ago, programs ran like trains on rails. You started at A, went to B, then C, D, E, etc...

Yes... 支店s and 宙返り飛行s were permitted. Inside the machine, there were even some interrupt driven things going on. And then we moved 今後 into the 勇敢に立ち向かう new world of event driven, multi-仕事ing operating systems, like Windows and Linux...

This moving 今後 brought with it difficulties for people who were using flowcharts for keeping 跡をつける of what programs were doing... a pity. But it does make it easier to 令状 more 使用者-friendly 使用/適用s.

I will illustrate some of the ideas behind 明言する/公表する, or event driven programming with a simple 夜盗,押し込み強盗 alarm system.

金物類/武器類: Assume that you are working with a computer connected to a toggle switch, a bell, and an 侵入者 detector. The toggle switch is for setting the alarm system to "武装した" or "安全な", i.e. "ignore inputs from 侵入者 detector".

ソフトウェア: Assume that your ソフトウェア 申し込む/申し出s the に引き続いて...



(You will, of course, probably 供給する those 施設s with sub-決まりきった仕事s written by yourself for your 的 金物類/武器類.)

The first step for the designer of this 使用/適用 would be to 生成する the に引き続いて diagram of the 明言する/公表するs which might 存在する, and the 可能性のある の間の-明言する/公表する 移行 paths.... Figure 1 Each blue box 代表するs a 明言する/公表する that the system may be in at one time or another. For each 明言する/公表する, you should have a (疑いを)晴らす idea of what the 使用者 is going to be seeing on the 審査する, and what the 条件 (明言する/公表する) will be of the bell, the switch, etc. You also need to know if the program is doing anything while it is in each 明言する/公表する. For example, when in the "Waiting" 明言する/公表する, the program will be checking boIntruder. (That is, in the simple 実施 of this system the program will be checking boIntruder. Later in this essay, you will make その上の 発見s!)

The arrows show permitted 明言する/公表する 移行s. 公式文書,認める that you don't need to be able to get to any 明言する/公表する from any 明言する/公表する.

Programming the system can be broken 負かす/撃墜する into 手続きs with 指名するs like.... You'll need a 全世界の variable, which I'll call CurrentState.

Every so often, you'll need to make a number of 実験(する)s. There are different ways to 遂行する the "every so often". In Delphi, the timer 構成要素's event is a good way to do this.

Those 実験(する)s will be things like....
if (CurrentState=stateWaiting) and
   (boArmed) then ChangeStateFrmWaitingToWatching
Within ChangeStateFrmWaitingToWatching, you would have things like CurrentState:=stateWatching and something to put a message on the 審査する 発表するing that the alarm system is 武装した.

So far, so simple.... things are 存在 done in a pretty uncomplicated, unclever way. Enter the exciting world of "events". (Yes, I know, we used one earlier, if you look closely. I was hoping you wouldn't notice. We used it crudely, anyway.)

Events can arise from all sorts of sources. Many are built in, and you can 追加する others. The weird, wonderful thing about events is that they can be given "handlers", little bits of code that 遂行する/発効させるs when the event occurs. Anything else that was going on at the time is 一時停止するd for a moment. (Which is why you really, really don't want something like "repeat... until 4=5" anywhere in your event handler. You wouldn't 令状 what I've given as the example... but it is 平易な to 令状 an 同等(の)!)

Not only do Windows and Linux systems come with built in events, with built in event handlers, but you can 修正する those event handlers (やめる 平易な) or create 可能性のある new events (not so 平易な- and beyond the 範囲 of this essay.)

Whenever you move the mouse, an event "is 誘発する/引き起こすd" (i.e., everything else is momentarily interrupted, and Things Happen... the "things" 供給するd for in the MouseMoved event handler.)

If you'll 許す a わずかに 緊張するd example, I can show you something やめる easily. Let's pretend that instead of hooking up a PIR to your system, and making a boIntruder 機能(する)/行事 to tell you what the PIR "sees", you go a cruder 大勝する: When you are away from home, you somehow Rube Goldberg together some 装置 that arrange for any 侵入者 to accidentally move the computer's mouse. If you'll 許す me that strange シナリオ, the boIntruder 機能(する)/行事 can be dispensed with. その上に, (and this is where things become 冷静な/正味の), the 明言する/公表する change shown by the arrow on the 明言する/公表する diagram called "Begin (犯罪の)一味ing" will be 影響d just by 追加するing the に引き続いて to the system's MouseMoved event handler!....
if CurrentState=stateWatching then ChangeStateFromWatchingToRinging
I'm sorry if you don't feel a Eureka moment as you read that. It really is やめる 冷静な/正味の, but it いつかs takes a while to 吸収する the ideas and 関わりあい/含蓄s. For now: Do try to get the idea of 明言する/公表する diagram based programming into your 長,率いる....

Good Things will come of it!



In this essay, we have been looking at a system with 外部の elements, because I think it helps you しっかり掴む the ideas of different 明言する/公表するs, the 移行 誘発する/引き起こすs, etc, more easily. But even something like a 基準 word-加工業者 has "明言する/公表するs", e.g. the print preview 明言する/公表する, the Save-とじ込み/提出する-Dialog-Is-Open 明言する/公表する, etc, etc.

Once you start thinking of your 使用/適用s as 存在 "machines" with different 明言する/公表するs, and 支配するs about what each 明言する/公表する consists of, and when and how you change 明言する/公表するs, I think you'll find it begins to be easier to stay on 最高の,を越す of the 開発 過程.

I hope that leaves you feeling that 明言する/公表する diagrams are a 道具 that might be useful?



            力/強力にするd by FreeFind
  場所/位置 search Web search
場所/位置 地図/計画する    What's New    Search This search 単に looks for the words you enter. It won't answer "Where can I download InpOut32?"


Click here if you're feeling 肉親,親類d! (促進するs my 場所/位置 経由で "Top100Borland")
広告 from page's editor: Yes.. I do enjoy 収集するing these things for you. I hope they are helpful. However... this doesn't 支払う/賃金 my 法案s!!! Sheepdog ソフトウェア (tm) is supposed to help do that, so if you 設立する this stuff useful, (and you run a Windows or MS-DOS PC) please visit my freeware and shareware page, download something, and 循環させる it for me? Links on your page to this page would also be 高く評価する/(相場などが)上がるd!
Click here to visit editor's freeware, shareware page.

Link to Tutorials main page
How to email or 令状 this page's editor, Tom Boyd


Valid HTML 4.01 Transitional Page WILL BE 実験(する)d for 同意/服従 with INDUSTRY (not MS-only) 基準s, using the 解放する/自由な, 公然と accessible validator at validator.w3.org


If this page 原因(となる)s a script to run, why? Because of things like Google パネル盤s, and the code for the search button. Why do I について言及する scripts? Be sure you know all you need to about spyware.

....... P a g e . . . E n d s .....