Mirror Function

Purpose

Generates a value which is a mirror image of the given character expression.

Syntax

% = Mirror[%](x%)

% = Mirror&(x&)

% = Mirror|(x|)

% = Mirror3(x%)

l = Mirror8(xlarge)

$ = Mirror$(x$)

Description

Mirror[%] reverses the specified 32-bit integer value and returns a 32-bit value.

Mirror& reverses the specified 16-bit integer value and returns a 16-bit value.

Mirror| reverses the specified 8-bit integer value and returns a 8-bit value.

Mirror3 reverses the lower 24-bits of an integer value and returns a 32-bit value.

Mirror8 reverses the specified 64-bit integer value and returns a 64-bit value.

Mirror$ reverses the specified string value and returns it as a string

The arguments are converted to the expected type before the mirror operation is performed.

Example

Print Bin(Mirror (%11111111000000001111111100000011), 32)

Print Bin(Mirror%(%11111111000000001111111100000011), 32)

Print Bin(Mirror&(%11111111000000001111111100000011), 32)

Print Bin(Mirror|(%11111111000000001111111100000011), 32)

Print Bin(Mirror3(%11111111000000001111111100000011), 32)

Print Bin(Mirror8(%11111111000000001111111100000011), 64)

Print Mirror$("GFABasic32")

Prints

11000000111111110000000011111111
11000000111111110000000011111111
11111111111111111100000011111111
00000000000000000000000011000000
00000000110000001111111100000000
1100000011111111000000001111111111111111111111111111111111111111
23cisaBAFG

Remarks

Use _Swab to swap bytes.

See Also

_Swab, _Swab8, _SwabL

{Created by Sjouke Hamstra; Last updated: 18/10/2014 by James Gaite}