10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ExpressionsOperatorlikenot likeOperatorValue is an instance of pattern-matching stringValue is not an instance of pattern-matching stringWith null, the result of a comparison will be true, false, or null. The result of acomparison (except for a comparison of reference variables) is null when oneor both operands of the expression are null.In 4GL, the if and while statements and the where clause of query statementstest the results of boolean expressions. For example, assume that status is acharacter field on a form. Whenever the boolean expression “status = 'n' ” isTRUE, the following statement calls the NewProject frame:if status = 'n' thencallframe NewProject;endif;In if and while statements, if the result of an expression is null, the flow ofcontrol occurs exactly as if the boolean expression evaluates to FALSE. Forexamples, see Nulls in Expressions (see page 49).Like Operator and Pattern MatchingReference variables may be compared, but only for equality, inequality, is null,or is not null. When comparing two reference variables that both contain nullfor equality (or inequality), the result is TRUE or FALSE, not null. Similarly,when comparing two reference variables only one of which contains null forequality, the result is FALSE.The like operator lets you compare two strings to see whether they resembleeach other in specific ways. To use this operator, specify a pattern (a string ofcharacters with special formatting characters) that specifies what thecompared string must look like. If the string being compared is an instance ofthe pattern described by the pattern string, the expression evaluates to TRUE.The syntax for the like operation is:charvar [not] like pattern [escape escapechar]44 <strong>Programming</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!