Help Menu

KaioneSoft Home

Help Home

Index

Glossary

Conventions

Introduction

Installation

Expression »

SprintDB Pro 2

Desktop Companion

Using Tables

Creating SQL

Creating Forms

How to

Understanding Macros

Macro Actions

Advanced Techniques

Database Functions

Tutorial

UI Design Guide

New Features

Expressions in SprintDB Pro

Expressions

Any combination of variables, operators, constants, functions, and names of fields, controls, and properties that evaluates to a single value. You can use expressions as settings for a control's control source, and to set macros etc.

  • The Control name must be preceded by an '&'. For example, &age means the form field that has the name "age".
  • A variable must be proceded by an '@'. For example, @var1 refer to the variable named "var1".
  • If you want to refer to the value of the table field in another SubForm, Table field must be proceded by '!n!'. !n! means SubForm n. For example: !0!table1.field1 refer to the value of the table1.field1 in the MainForm, and !1!table1.field1 refer to the value of the table1.field1 in SubForm1.

Operators

Arithmetic Operators

  • '/' operator causes the first operand to be divided by the second. For example: table1.int_field / 34, table1.double_field / &form_field1, &form_field1 / &form_field2.
  • '*' operator causes its two operands to be multiplied. For example: 123.456 * 34, 123.456 * !0!table1.field1, &form_field1 * !1!table1.dbl_field1.
  • '+' operator causes its two operands to be added. If the two operands are strings, the '+' operator appends the second operand to the first. For example: 30+40, 'abc'+'def', 
  • '-' operator subtracts the second operand from the first. For example: 40-30. 
  • '%' is the modulus operator. The result of the operator is the remainder when the first operand is divided by the second. For example: 7%4 -> 3.

Comparison Operators

  • '='(Equals) operator: The result of the operator is 1(TRUE) if both operands are equal; otherwise, 0(FALSE).
  • '>'(Greater Than) operator: The result of the operator is 1(TRUE) if the first operand has a higher value than the second; otherwise, 0(FALSE).
  • '<'(Less Than) operator: The result is 1(TRUE) if the first operand has a lower value than the second; otherwise, 0(FALSE).
  • '>='(Greater Than or Equal To): The result is 1(TRUE) if the first operand has a higher or equal value than the second; otherwise, 0(FALSE).
  • '<='(Less Than or Equal To): The result is 1(TRUE) if the first operand has a lower or equal value than the  second; otherwise, 0(FALSE).
  • '<>','!='(Not Equal To): The result of the operator is 1(TRUE) if the first operand is not equal to the second; otherwise, 0(FALSE).

Logical Operators

  • 'AND' combines two boolean expressions and returns 1(TRUE) when both of the expressions are TRUE; otherwise, 0(FALSE).
  • 'OR' combines two boolean expressions and return 1(TRUE) when either of the expressions is TRUE; otherwise, 0(FALSE).
  • 'NOT' negates a boolean input.

« Back  |  Next »