ILERPG.com — IBM i · ILE RPG · AS400 Mastery

This lesson is locked

A short preview is available. Purchase once for lifetime access.

Beginner · 9:00

Expressions, Operators, and Assignment

Declared storage does no work until an expression acts on it. This lesson covers assignment and its relationship to EVAL, the arithmetic operators, whole-number division with %DIV and %REM, string concatenation with %TRIM, the compound assignment operators, and the relational and logical…

What you'll be able to do

  1. 1Use the equal-sign assignment operator to evaluate an expression and store its result, and explain its relationship to the underlying EVAL operation.
  2. 2Apply the arithmetic operators +, -, *, /, and **, and select the %DIV and %REM built-in functions over standard division when whole-number semantics are required.
  3. 3Concatenate character values using the + operator, and apply %TRIM to eliminate the padding artifacts that fixed-length character fields introduce.
  4. 4Use the compound assignment operators +=, -=, *=, /=, and **= to write concise, self-updating expressions, and identify when they aid readability versus when they obscure it.
  5. 5Combine relational operators with logical operators (AND, OR, NOT) into a correctly parenthesized conditional expression, and explain how operator precedence governs evaluation order.

Create your account

Takes a few seconds — you'll be right back here after.

Sign in

Welcome back — you'll be right back here after.

Forgot your password?