PWCT 1.9 Art Documentation ( http://doublesvsoop.sourceforge.net ) 2006-2019, Mahmoud Fayed ( msfclipper@users.sourceforge.net ) _____________________________________________________________________________________ Table of contents 1 - Introduction 2 - Implementation steps 3 - Final Steps Tree 4 - Application during the runtime 1 - Introduction In this lesson we are going to create a library contains one function The library file is a source file (*.SSF) but marked as (Server Extension) To mark a source file as a server extension
1 - open server units window 2 - select the (Compile) tab 3 - set checkbox (Server Extension) On
When you run the library file, instead of getting the executable application, you will get only the generated source code file (*.PRG)
For example
MyLib.SSF (Server Extension=Library) -----(RUN=CTRL+R)---> MyLib.PRG The Library/Server extension file contains functions shared by one or more of source files (*.SSF)
You can call this source code file (MyLib.PRG) from other source files (*.SSF) To call source code file generated from Library/Server extension file you will need to use the component (Set Procedure to) which will get as parameter (the source code file name) .
In our example
[Part (1)]
we will create a library/Server extension file called (MyLib.SSF) Where the file (MyLib.SSF) comes with goal (Main) which contains the function (MyFunc) When we run MyLib.SSF we will get MyLib.PRG
[Part (2)]
We will create a console application called (LibCall.SSF) which will load (MyLib.PRG) using the component (Set Procedure To) then the function (MyFunc) will be invoked using the component (Call Function). 2 - Implementation Steps Fig. (1) Goal Desginer - Steps Tree Select the step (The First Step) We will start now new interaction process to generate new steps to our steps tree. The slow way (Using Mouse): 1 - Click Interact to open the components browser 2 - Select the domain (Structure Programming) 3 - Select the component (Set Procedure To) The fast way (Using Keyboard shortcuts): 1 - Get the component using its name by typing (Set Procedure To) Note : Stop typing when you see the required component is selected Fig. (2) Component Browser – Select the component (Set Procedure To) After selecting the component click Ok or press ENTER Fig. (3) Interaction page - Set the properties and enter the required data as in the image above Fig. (4) Goal Desginer - Steps Tree Select the step (The First Step) We will start now new interaction process to generate new steps to our steps tree. The slow way (Using Mouse): 1 - Click Interact to open the components browser 2 - Select the domain (Structure Programming) 3 - Select the component (Call Function) The fast way (Using Keyboard shortcuts): 1 - Get the component using its name by typing (Call Function) Note : Stop typing when you see the required component is selected Fig. (5) Component Browser – Select the component (Call Function) After selecting the component click Ok or press ENTER Fig. (6) Interaction page - Set the properties and enter the required data as in the image above Fig. (7) Goal Desginer - Final Steps Tree 3 - Final Steps Tree ----------------------------- File LibCall.SSF ----------------------------- The First Step Set Procedure to "mylib.PRG" Call Function myfunc 4 - Application during the runtime Fig. (8) Application during the runtime
|