Advertising banner:
 
 
 A303
 
81203_43854_21.png81203_43840_19.png



About FirstClass RAD
FirstClass Rapid Application Developer (FirstClass RAD) lets you enhance FirstClass client functionality with intranet applications, including interfaces to databases.
Although FirstClass RAD must be installed on a Windows machine, you can use any FirstClass client (Windows or Mac OS) to run it, and your users can also use any FirstClass client to run your FirstClass RAD applications.
To create FirstClass RAD applications, you create the required forms using FirstClass Designer, then (using the BASIC language) program the event procedures for the objects on the forms in FirstClass RAD.
FirstClass RAD naming conventions
When you name FirstClass objects such as forms and fields, and code elements such as variables, constants, and subroutines, these names must:
•       begin with a letter
•       contain only letters, numbers, and the underscore character (_)
•       be no longer than 255 characters
•       differ from the names of BASIC operators and logical operators such as OR, AND, MOD, and NOT.
Examples
•       Form
•       frm
•       FileOpen
•       frmFileOpen
•       Checkbox
•       chk
•       ReadOnly
•       chkReadOnly



Creating FirstClass RAD applications
With minor variations, you follow the same basic steps to create all FirstClass RAD applications.
About FirstClass RAD projects
A FirstClass RAD application is created as a project which consists of:
•       forms
•       code modules
•       database objects (if the application is connecting to a database).
To work with a FirstClass RAD project, use the FirstClass RAD Project Manager, which provides access to:
•       information about the project as a whole
•       information about the forms in the project
•       database connection information, for applications that connect to databases
•       information about the database tables to use, for applications that connect to databases.
The FirstClass RAD Project Manager also lets you run your application for testing purposes, without having to rebuild and reinstall every time you want to test.
Creating projects
To create a FirstClass RAD project:
1       Connect, as an administrator, to the server where FirstClass RAD is installed.
        Use the settings file that contains the resources needed for this project.
2       Start FirstClass RAD.
3       Click New on the Project tab in the FirstClass RAD Project Manager.
4       Type the project name (maximum 23 characters, no spaces).
Opening projects
To open a project:
1       Click Open on the Project tab in the FirstClass RAD Project Manager.
2       Select the project.
Setting project attributes
Project attributes apply to the project as a whole. To set these attributes:
1       Click Options on the Project tab in the FirstClass RAD Project Manager.
2       Fill in the fields for each tab on the Project Attributes form.
Adding forms to projects
To add a form to a project:
1       Click New on the Form tab in the FirstClass RAD 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 in the FirstClass RAD Project Manager.
2       Click Modify.
3       Fill in the fields on the Form tab on the Attributes form.
4       Bind the form to database tables, if required.
Click Add, choose a table at "Select a table".
5       Press Tab to save your changes before closing the Attributes form.
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 in the FirstClass RAD 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".
Removing forms from projects
When you remove a form from a FirstClass RAD 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 theForm tab in the FirstClass RAD Project Manager.
2       Click Remove.



Using FirstClass RAD with databases
FirstClass RAD applications can connect to any ODBC-compliant database (ODBC is the industry standard for relational database access). A FirstClass RAD form can tie into multiple database tables and multiple databases and the databases can be on different servers. For fields that will always contain data from the same source (the same column in a database table), you can create bound columns database access.
For more flexibility, when you do not have fields that are bound to a particular column, you can create nonbound database access.
Creating ODBC data sources
Before a FirstClass RAD application can connect to an ODBC-compliant database, you must use Windows to create an ODBC data source.
To do this:
1       Open ODBC in the Windows Control Panel.
2       Click Add on the ODBC Data Source Administrator's System DSN tab.
3       Select the ODBC driver for your database.
4       Click Finish.
5       Fill in the fields to set up the driver.
For help, use Windows' online help or see the driver manufacturer's documentation.
Note
You need only connect to your ODBC database source once for all applications.
If you want to test the data source, you can connect to it with an ODBC client such as Microsoft Query, Microsoft Access, or Microsoft Excel.
Adding database connections
To add a database connection:
2       Fill in the connection information on the New Connection form.
Updating database connections
To update a database connection:
1       Select the connection on the Connection tab in the FirstClass RAD Project Manager.
2       Click Modify.
3       Change information as required on the Connection form.
Removing database connections
When you remove a database connection from a FirstClass RAD project, all tables associated with it are also removed. You cannot undo this operation.
To remove a database connection:
1       Select the connection on theConnection tab in the FirstClass RAD Project Manager.
2       Click Remove.
Adding database table connections
Before you can add a connection to a table in a database, you must add a connection to the database as a whole.
To add a connection to a table in a database:
1       Click New on the Table tab in the FirstClass RAD Project Manager.
2       Fill in the table information on the New Table form.
Updating database table connections
To update database table connections:
1       Select the table on theTable tab in the FirstClass RAD Project Manager.
2       Click Modify.
3       Change information as required on the Table form.
Removing database table connections
When you remove a database table connection from a FirstClass RAD project, all associations to that table in the project's forms are also removed. You cannot undo this operation.
To remove a connection to a table in a database:
1       Select the table on theTable tab in the FirstClass RAD Project Manager.
2       Click Remove.



Programming projects
Programming FirstClass RAD projects includes adding code, subroutines, and database connections (if applicable).
Data types in code
Each variable in your code has a data type that determines what kind of data that variable can store. For example, string variables store text strings, and Integer variables store whole numbers.
Before you can use a variable in your code, you must declare it and its data type. This ensures that a variable only contains a value of the expected data type (for efficiency, FirstClass RAD does not support variables that can contain ambiguous data types).
Data types and databases
Both FirstClass RAD and databases require that all data contained in their data structures have explicit data types.
If your FirstClass RAD application will be connecting to a database, you must be sure to use data types that are compatible with the corresponding database data types. These are the FirstClass RAD counterparts for common ODBC database data types:
•       Integer
        integer, int, smallint, tinyint, boolean, bit, yes/no
•       Long
        integer, int, smallint, tinyint, boolean, bit, yes/no
•       Single
        float, double, single, double precision, decimal, numeric
•       Double
        float, double, single, double precision, decimal, numeric
•       Currency
        monetary, money, currency, smallmoney
•       String
        char, character, varchar, variable character, text, memo
•       Date.
        date, time, date/time, datetime, smalldatetime
Adding code
Programming a FirstClass RAD project involves:
•       adding code that is used throughout the project
•  adding code for forms
•  adding code for fields.
Adding code for projects
A FirstClass RAD project often contains code that is global (that is, it is called from multiple forms, multiple fields on a form, or anywhere in the project). This code can take the form of:
•       subroutines
        Code that performs particular steps. Instead of repeating the code for a step wherever it is needed, you can call the subroutine.
•       declarations
        A variable, constant, or user-defined type used when programming applications.
•       variables
        A placeholder in your code for particular values, such as values that users have entered. You must declare a variable before you can use it.
•       constants
        Similar to variables, except the value of a constant cannot be changed.
•       user-defined data types.
        Combinations of related variables into single data structures.
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 for forms
To add code that applies to a specific form:
1       Select the form on the Form tab on the Attributes form.
2       Click Modify to open the form and its Attributes form.
3       Click the form body, then click Edit Code on the Form tab on the Attributes form.
        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.
Adding code for fields
To add code that applies to a specific field on a form:
1       Select the form on the FirstClass Form tab on the Attributes form.
2       Click Modify to open the form and its Attributes form.
3       Click the field, then click Edit Code on the Field tab on the Attributes form.
        Shortcut
        Double-click the field.
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.
81203_42521_14.png        Note
You can program additional event procedures for this field and program additional fields at "Object".
Adding code modules
To add a code module:
1       Click New on the Module tab in the FirstClass RAD Project Manager.
2       Type the module name (maximum 23 characters, no spaces).
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 in the FirstClass RAD 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 in the FirstClass RAD Project Manager.
2       Click Rename.
3       Type the new module name.
Removing code modules
When you remove a code module from a FirstClass RAD project, all of the subroutines and declarations within it are also removed. You cannot undo this operation.
To remove a code module from a project:
1       Select the module on the Module tab in the FirstClass RAD Project Manager.
2       Click Remove.
Updating declarations
To add, update, or remove declarations in a code module:
1       Open the window for this 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.
Adding subroutines
To add a subroutine to a code module:
1       Open the window for this 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 cannot undo this operation.
To remove a subroutine from a code module:
1       Open the window for this code module.
2       Choose the subroutine at "Subroutine".
3       Click Delete Subroutine (icon with an "X" on it, in the right-hand corner).



Testing applications
You can run your application within FirstClass RAD before it is built, to check for errors. This avoids the need to continually rebuild and reinstall applications in order to test them. You can run the application at various stages of development (for example, after you have added all your forms), and it will respond based on the amount of code you have written for it at that time.
To test your project:
1       Click Run on the Project tab in the FirstClass RAD Project Manager.
        If an error message appears, click OK and check the code in your code module.
2       Click Stop to stop testing your application.



Building applications
After your project has been fully developed and tested, you can build the application from it. To do this:
1       Click Build on the FirstClass Project tab in the FirstClass RAD Project Manager.
        The compiled application file (FCX) is added to the \FCPO\RAD folder. This file contains everything needed to run the application after it has been installed in FirstClass.
        81203_42521_14.png        Note
If you built this application previously, the new FCX file will overwrite the old one.
2       Restart the server to load the FCX file.



Installing applications in FirstClass
After you have built your FirstClass RAD application, you need to install it in FirstClass so others can use it. To install your application:
1       Create stationery for the application.
This is only required for applications that will be launched from an icon.
2       Distribute the resources (forms, icons, and so on) used by your application.
        For details on how to distribute resources, see FirstClass Designer.
Creating application stationery
To create stationery so that users can launch your application from an icon:
1       Log in as an administrator, using your FirstClass RAD project's settings file.
2       Open the conference where you want the application icon.
3       Choose Admin > New Stationery > RAD Install Form.
4       Fill in the RAD Install Form fields.
5       Choose File > Properties (Windows) or Get Info (Mac OS) with the stationery selected.
6       Clear "Protected".
7       Name the stationery and choose the icon you want.
8       Click OK.
9       Open the Properties window again, and select "Protected".
81203_42521_14.png        Note
You can install multiple instances of this application by opening other conferences and following the steps above.



hirosue Shino Web Site