beautypg.com

Rpbasic-52 programming guide – Remote Processing BASIC 52 User Manual

Page 122

background image

RPBASIC-52 PROGRAMMING GUIDE

2-103

STR

Syntax:

A = S T R (f u nc t io n ,$ ( n) [ ,$ ( n) ] ))
Where: function = 0 to 1 4 , s p e ci f ie s st r in g fu n c ti o n t o pe r fo r m as d e sc r ib e d be l ow .

Function:

Performs string m anipulation, describ ed below, pe r function num ber.

Mode:

Comm and,Run

Use:

A = ST R(0,$(0))

Cards:

RPC-320, RPC-330

D E S C R IP T I ON

T h e re a re 1 1 st r in g m a ni p ul a ti o n f u nc t io n s u s in g S T R . E a c h f u nc t io n is d e sc r ib e d be l ow .

NOTE: Most of these functions require a string variable (such as $(0)) rather than a quoted string. Functions
which will allow quoted strings offer an alternate syntax immediately below the first one.

Syntax:

A = ST R(0,$(n))

Description:

Returns num ber of characters in a string. When string is not set equal to som ething, or the string num ber is
out of bounds, erroneous data is returned. Length limit is 254 characters.

Example:

10 STRING 100,20
20 $(0)=" 123456789"
30 PRINT STR(0,$(0))
run
10

Syntax:

A = ST R(1,$(n))

Description:

Convert letters A - Z to lower case. Variable A returns length of the string.

Example:

10 STRING 100,20
20 $(0)="Some UPPER case"
30 A = STR(1,$(0))
40 PRINT $(0)
run
some upper case

Syntax:

A = ST R(2,$(n))

Description:

Convert letters a - z to upper case. Variable A returns length of the string.

Example:

10 STRING 100,20
20 $(1) = "Some lower case."
30 A = STR(2,$(1))
40 PRINT $(1)
run
SOME LOWER CASE.