- Writing Expressions
- /documentation/pages/Guides/Xbasic/Xbasic in Desktop Applications/Writing Expressions.xmlWhen you pass an expression to a function or method, you are passing a line of Xbasic code as a character string. as result, whether the expression is used to filter or order records, whether it evaluates to a character or a logical value, the argument is type C (character). There are several principles that you should understand when writing an expression argument.
- Overview: Functions and Expressions
- /documentation/pages/Ref/Xbasic/Reference/Overview__COLON__ Functions and Expressions.xmlExpressions are used throughout Alpha Anywhere for a variety of purposes. They are used to order and select records, display calculations on layouts, link two tables together, and to specify conditions under which events occur. For example, you can create an expression for a calculated field to show sales totals at the bottom of a Report, or you can create a duplicate key expression so that Alpha Anywhere knows which records in your table are duplicates.
- Writing Your Own Function
- /documentation/pages/Guides/Desktop/Design/View/A5W/Writing Your Own Function.xmlThe following user defined function is a simple example to demonstrate a point. You can create a function that accepts parameters, processes these inputs according to your specifications, and returns a value that you can use in your page. It is good programming practice to separate user defined functions from the HTML contents of the page. In this case we place the function before the opening tag.
- Writing Dialog Event Scripts
- /documentation/pages/Guides/Xbasic/Xbasic in Desktop Applications/Writing Dialog Event Scripts.xmlWeb publishing applications only. Form event scripts provide an opportunity to respond to or process the input from a dialog (form) web component. You can run scripts when the following events occur.
- Writing Server Event Scripts
- /documentation/pages/Server/Guide/Design/View/Grid/Writing Server Event Scripts.xmlWeb publishing applications only. Server event scripts provide an opportunity to respond to or process the input from a dialog (form) web component. You can run scripts when the following events occur.
- Calculated Field Expressions
- Functions and Expressions
- /documentation/pages/Guides/Xbasic/Other Xbasic Topics/Functions and Expressions.xmlFunctions are pre-defined operators which can be used in an expression to perform an operation. Expressions, which are similar to mathematical equations, are used throughout Alpha Anywhere to specify search criteria, put records in a particular order, link tables in a set, and more.
- Server-side Enable/Disable Expressions
- /documentation/pages/Guides/Mobile and Web Components/UX/Controls/Props/container/Server-side Enable-Disable Expressions/index.xmlhere
- Client Side Expressions, Validation, and Calculated Fields
- Writing Xbasic wrapper classes for .NET classes
- /documentation/pages/Guides/Dotnet Integration/Writing Xbasic Wrapper Classes for .NET classes.xml
Xbasic has a simple method for defining native wrapper classes for .NET classes that can help you avoid writing registration code every time you use a class. Simply create a class in your project and make the body of your class the desired registration code. Then save the class file as <Namespace>.<Class> and reference it in your code as <Namespace>::<Class>. Note that the class filename includes a dot, while the class reference includes two colons.
While you can use your own namespace and class names, it makes life a whole lot simpler for you and anyone else who uses your class definition if you match the .NET class hierarchy. Also, do not bother to create a class file for a preloaded class.
The following example should make the methodology clear.