Technical Support Contact Us   

PC Access for Windows Reference Guide

for PC Access Version 4.30


(Contents)(Previous)(Next)

Script Command: if/then

Format:

if condition then goto LABEL;

The if/then command lets you branch on a condition. Currently, PC Access evaluates conditions consisting of string comparisons. You can compare a variable against another variable or against a string constant. PC Access compares variables as strings, character by character, case-sensitively, using the ASCII collating sequence. The available conditional operators are:

Operator Meaning
== equality
!= inequality
>= greater than or equal to
<= less than or equal to
> greater than
<
less than
Note that in the ASCII collating sequence, uppercase characters precede (are less than) lowercase characters. Therefore while "dog" is greater than "cat", "Dog" is less than "cat". String comparisons can be misleading if both strings consist of digits but have different numbers of characters. For example, the string "10" is less than "9" even though the number 10 is greater than the number 9. This is because a string comparison works character-by-character. Comparing the first characters of the strings "10" and "9" shows that "1" is less than "9". Therefore the entire string beginning with "1" is less than the string beginning with "9" regardless of what digits follow.

Example:

label LOGIN;

if @CONNECT_TYPE == "RLOGIN" then goto MLS_LOGIN;

This topic has changed for PC Access 4.30.

Back to script command list.


(Contents)(Previous)(Next)

[Contents] [Search] [Glossary of Terms]


Tell me more about this site.
Can't find what you need? See: How to Find It.
Contact us
Report a problem with this page or suggest an improvement for this page.

Last modification date: Friday, January 17, 2003 00:58:47

 

Copyright © 2005 - MFM Software, Inc.
11988 Tramway Drive
Cincinnati, OH 45241
Phone: 513.733.9229
Fax: 513.733.8775
Send comments to webmaster@mfm.com