Advertising banner:
 
 
 AS30
Home • Images • jp • OnlineHelp Repository • OnlineHelp • A0 • カスタマイズツール • FCAS • AS30
 



Programming projects
Programming 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, FCAS does not support variables that can contain ambiguous data types).
Data types and databases
Both FCAS and databases require that all data contained in their data structures have explicit data types.
If your 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 FCAS 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 project involves:
       adding code that is used throughout the project
 adding code for forms
 adding code for fields.
Adding code for projects
A 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.
        81203_42521_14.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.
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.
        81203_42521_14.png 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 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 FCAS 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 Online Applications folder located in the FCAS Config folder on the administrator's Desktop. 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.


hirosue Shino Web Site