Advertising banner:

History
 
 LAS25
Home • Help • A0 • Customization Tools • FCAS • LAS25
 
Creating projects



Creating a settings file
To create an FCAS project, you must connect using a settings file that contains all the resources (such as custom forms and icons) that your application will need.
When you create this settings file in FirstClass Designer, follow these rules:
•       All forms must be Database Query forms, with IDs in the 8000-9999 range, or Database Hit List forms, with IDs in the 10000-10999 range.
•       Form IDs must be unique and not conflict with any other forms used by your FirstClass system.
•       Field IDs must be unique and numbered 1000 or higher.



Creating a new project
To create a project:
1       Use the settings file you created for this application to connect, as an administrator, to the server where FCAS is installed.
2       Start FCAS.
3       Click New on the Project tab of the Project Manager.
4       Type the project name.
The project is saved on your server relative to the launch location of the executable (generally /FCServer/FCRAD/Source). This lets you access the development environment from any computer with a FirstClass client.



Opening an existing project
To open a project:
1       Click Open on the Project tab of the Project Manager.
2       Select the project.



Setting project attributes
Project attributes apply to the project as a whole. They include:
•       character mapping
•       how the application can be launched (for example, as a server application)
•       whether users can run multiple concurrent sessions of the application
•       the total number of concurrent sessions of the application that can be run on the server
•       branding information, such as an application icon and build number, that will be displayed when you get the application's info on the Application Monitor.
To set these attributes:
1       Click Options on the Project tab of the Project Manager.
2       Fill in the Project Attributes form.



Adding forms to projects
To add a form to a project:
1       Click New on the Form tab of the Project Manager.
2       Choose the form.
The form opens and the attributes are displayed.
Setting form attributes
Form attributes (the form's name, title, and tables for bound columns databases) apply to the form as a whole, rather than to individual fields on the form.
To set form attributes:
1       Select the form on the Form tab of the Project Manager.
2       Click Modify.
3       Fill in the fields on the Form tab of the Attributes form.
4       Bind the form to database tables, if required.
Click Add, then choose a table at "Select a table".
5       Press Tab to save your changes before closing the Attributes form.
Removing forms from projects
When you remove a form from a project, all of the configuration and code that was assigned to the form is also removed. You cannot undo this operation.
To remove a form from a project:
1       Select the form on the Form tab of the Project Manager.
2       Click Remove.



Setting field attributes
Field attributes apply to the individual fields on a form.
To set the attributes (name and table/column for bound columns databases) for a field:
1       Select the form on the Form tab of the Project Manager.
2       Click Modify.
3       Click the field.
4       Fill in the fields on the Field tab on the Attributes form.
5       Bind the field to a database table, if required.
Choose the appropriate table at "Table", then choose the appropriate column from this table at "Column".



Code modules
Store global code in a code module form. This lets you write the code once, instead of multiple times. Any changes to this code are automatically reflected from everywhere the code is called.
By default, a project has one code module, called Module1. This module contains a Declarations section and a Main subroutine which is the entry point for your application. The application begins execution with the first line of code you add to the Main subroutine. You can add more code modules as needed for organizational purposes.
Adding code modules
To add a code module:
1       Click New on the Module tab of the Project Manager.
2       Type the module name.
The Module window opens.
Updating code modules
To add, edit, or delete code in a code module:
1       Select the module on the Module tab of the Project Manager.
2       Click Modify.
3       Update the code as required.
4       Press Tab to save your changes before closing the code window.
Renaming code modules
To rename a code module:
1       Select the module on the Module tab of the Project Manager.
2       Click Rename.
3       Type the new module name.
Removing code modules
When you remove a code module from a project, all of the subroutines and declarations within it are also removed. You can't undo this operation.
To remove a code module from a project:
1       Select the module on the Module tab of the Project Manager.
2       Click Remove.



Declarations
To add, update, or remove declarations in a code module:
1       Open the window for the code module.
2       Choose Declarations at "Subroutine".
3       Update the code as required.
4       Press Tab to save your changes before closing the code window.



Subroutines
Adding subroutines
To add a subroutine to a code module:
1       Open the window for the code module.
2       Click New Subroutine (blank icon in upper right-hand corner).
3       Name your subroutine.
Updating subroutines
To add, edit, or delete code in a subroutine:
1       Open the window for the appropriate code module.
2       Choose the subroutine at "Subroutine".
3       Update the code as required.
4       Press Tab to save your changes before closing the code window.
Removing subroutines
When you remove a subroutine from a code module, all of the code within it is also removed. You can't undo this operation.
To remove a subroutine from a code module:
1       Open the window for the code module.
2       Choose the subroutine at "Subroutine".
3       Click Delete Subroutine (icon with an "X" on it, in the right-hand corner).



Code for specific forms
To add code that applies to a specific form:
1       Select the form on the Form tab of the Project Manager.
2       Click Modify to open the form and its Attributes form.
7202010_20004_0.png        Shortcut
Double-click the form.
3       Click the form body, then click Edit Code on the Form tab of the Attributes form.
        7202010_20004_0.png Shortcut
        Double-click the form body.
4       Choose the event procedure that you want to program at "Event".
5       Update the code as required.
6       Press Tab to save your changes before closing the code window.



Code for specific fields
To add code that applies to a specific field on a form:
1       Select the form on the Form tab of the Project Manager.
2       Click Modify to open the form and its Attributes form.
3       Select the field on the form, then click Edit Code on the Field tab of the Attributes form.
        7202010_20004_0.png Note
        Double-clicking the field displays the default action with a dropdown list of the other code segments.
4       Choose the event procedure that you want to program at "Event".
5       Update the code as required.
6       Press Tab to save your changes before closing the code window.
7202010_20004_0.png        Note
You can program additional event procedures for this field and program additional fields at "Object".



Programming statistics events
You can program FCAS applications to respond to server events as they are generated. Applications respond to a server event by calling a method. You can program methods to perform certain operations (statistics events) when events occur.
To make your application work with statistics events, you:
•       normally make the application launch as a server application
Set this on the Project Attribute form's General tab.
•       select "Relay statistics packets" on the FCAS Configuration form's Configuration tab.
Event types
FCAS can only trigger statistics events for events that have been selected on the Statistics Control form in the administrator's Reports folder.
The following events can trigger statistics events:


AddUser
ApplyModel
Approve
ASApp
Attach
AutoReg
ChangeUser
Close
CommLinkFail
ConfDelivery
ConfItemDel
ConfPermissions
ConfSubscribe
Control
Create
DeleteUser
Directory
Download
FoldCrt
FoldDel
Format
GetInfo
History
Login
Logout
MsgDelete
MsgDelivery
MsgForward
MsgReply
Open
OpenDeskTop
Password
Performance
Resume
SaveAttach
Search
Spam
Upload
Web

Programming methods
To program methods for events, select "Server Statistics Events" on the General tab of the Project Attributes form. This adds a StatsEvent module to the project.
The StatsEvent module contains the methods that you can program. There is also a subroutine named EventMain. EventMain is called each time an event occurs, followed by the event-specific subroutine.
As an example, to display a message on the console each time a new user is added, you would program the appropriate method:
Sub StatsEvent_AddUser (theStatsEvent as StatsEvent)
        Console ("Added new user")
End Sub
Each method receives as a parameter theStatsEvent of object type StatEvent. The StatEvent object type contains data and methods that detail the particular event that has occurred, and has the following methods and attributes:


Timestamp
A date data type that contains the date and time of the statistics event.
StatsEvent
The FirstClass statistics event code.
Delimiter
The parsing delimiter attribute for the event text.
Text
The text of the event as it would be written to the server log file.
Text(n)
The text of the "n" column automatically parsed with the delimiter specified by the delimiter attribute.
NumCols
The number of columns in the delimited text of the event string (using the delimiter attribute).