Xbasic Guide - An introduction to Xbasic


A guide to Xbasic for web and mobile application developers.

Welcome to Xbasic in Alpha Anywhere

Alpha Anywhere is a powerful application development software package. Most of what you need to do can be built in Alpha Anywhere without writing any code. That being said, server-side scripts can extend the core functionality that comes with Alpha Anywhere to incorporate data validation, create workflows, or build complex server-side routines to automate reporting, business processes, and more. In Alpha Anywhere, Xbasic is used to create server-side scripts to perform various tasks.

The Xbasic programming language implements many of the same constructs (including variables, arrays, functions, conditionals, and loops) as other languages, such as C and JavaScript. Xbasic can also interact directly with Node.js modules and C# .NET libraries.

This guide assumes you are already familiar with Alpha Anywhere and understand how to create workspaces and connection strings.

The goal of this guide is to give you a solid grounding in basic programming concepts needed to use Xbasic to customize your Alpha Anywhere applications to your exact business requirements. You can refer to the Alpha Anywhere Documentation to explore everything Xbasic can do. The best way to learn different Xbasic commands and techniques is through experimentation.

Topics Overview

In this guide, we will cover the topics listed below. At the end of each section, you will find a "Next" button you can click to take you to the next section.

The Interactive Window
Variables and Data Types
Conditional Statements
Loop Statements
Arrays, Object Pointer Variables, and Collections
Capturing and Logging Errors
Working With SQL Data Using Xbasic
Calling Xbasic Scripts in Your Applications
The Xbasic Debugger

Setting Up Your Workspace

Before you begin, you need to create a new Alpha Anywhere workspace and a connection string named "AADemo-Northwind," which is used later in this guide to interface with the sample Northwind database included in the Alpha Anywhere installation.

  • Create the Workspace

    1. Launch Alpha Anywhere

    2. Create a new Workspace named "XbasicGuide."

  • Create the Northwind Demo Connection String

    1. Open the Web Projects Control Panel

    2. Select Tools > AlphaDAO Connection Strings

    3. Click the "Create AADemo-Northwind Connection String" link at the bottom of the window.

    4. Confirm creating the connection. Then, return to the Web Projects Control Panel.