HP Prime for All

English  Русский 

Syntax

FOR var FROM start TO (or DOWNTO) finish [STEP increment] DO command(s) END;

Description

Sets variable var to start; then, for as long as this variable’s value is less than or equal to (or more than for a DOWNTO) finish, executes command(s) and adds (or substract for DOWNTO) 1 (or increment) to var.

Example

FOR A FROM 1 TO 10 STEP 2 DO PRINT(A); END; will print 1 3 5 7 9

DO — Discussion