4D v16プロセス |
||
|
4D v16
プロセス
プロセス
ビデオ中で説明されている操作に加え、以下の点にも留意してください。 プロセスは処理が実行される環境であり、各プロセスごとに以下の要素があります:
プロセスとプロセスは複数の方法で通信できます:
プロセスでは以下のことを行うこともできます:
プロセスは、プロセス内で実行されているメソッドが終了したときに消去されます。 プロセスは主に以下の目的で使用します:
4Dは内部的な処理のために自動でいくつかのプロセスを起動します。 プロセスはNew processコマンドで起動します: vProcessNumber:=New process(Method;Stack;Processname;Settings;...) プロセスを起動するこのコードはメソッドに記述します。以下のようなスケルトンを使用できます: C_TEXT($1)
プロセスの実行をトレースするためには、別プロセスもトレースボタンをクリックします。すると別のデバッガーウィンドウが開いて、それぞれのプロセスごとにデバッグが可能となります。 In this video, we're going to learn about the life cycle of a process: birth, life and death. Processes are often assimilated into multi-tasking jobs. They allow you to create several jobs simultaneously, without having to complete the first process before starting the second. Let’s say that you want to access the statistic module that we set up in the previous videos. You want it to remain active while you do something else. First, we're going to create the call to the Statistics dialog in the navigation form. We will:
and in its method, just like we did for the 1st dialog, we will:
Let's test this. We have a Stats button that displays information that interests us and we obtain the statistics. However, we can no longer work on our navigation form since it is placed in the foreground. There is a way to work with several windows; in this case, it is preferable to work with several different processes, which is what we're going to do now. You create a process using the New process command, which must be called from a method.
In the present case, we're going to create a method for displaying Stats (note that the name is placed in quotes) and this method will contain the creation of the form.
In 4D, there is a star parameter that you can pass as the last parameter and which can be used with many commands. This lets you avoid creating the same process multiple times. We're not going to use it for now, but you can refer to the documentation for more details about its use. Now let's see how this works. If we click on the Stats button:
It would even be possible, assuming that we configured the year in the form, to have the stats from one year and the stats from another year, on two different screens. It is important to understand that when we use processes, each one has its own environment; in other words, if we perform a calculation here, we obtain certain items of information regardless of how many records there are. It is therefore necessary to understand that a process will have:
If we have 2 processes executing the same method, each one can have different information. When several processes are created and we ask for a trace, 4D shows all the processes that were created:
So it is possible to trace it and when we are going to "calculate", it's the method of the button that we clicked on that is traced. If we trace another process, we can see the trace mode of this process appear here. At the beginning of this video, we mentioned the creation, life and death of a process. Let's look at these 3 stages: To trace what is running in a New process, you must use this button: a 2nd trace window appears for tracing the "Statistics" method that is being executed. Next a method runs and during this period, the process is alive.
This process is killed when the method that was executed when it was created is finished:
If we do a trace, we no longer see the "Statistics" process.
|
プロパティ
プロダクト: 4D
履歴
ARTICLE USAGE
セルフトレーニング ( 4D v16) |