Progress
Language Reference


RAW Statement
(ORACLE only)

Interfaces
OS
SpeedScript
All
All
Yes

Writes bytes to a field.

SYNTAX

RAW ( field [ , position [ , length ] ] ) = expression 

field

The field in which you want to store expression.

position

An integer expression that indicates the position in field where you want to store expression. The default for position is 1.

length

An integer expression that indicates the number of positions you want to replace in field. If you do not use the length argument, RAW puts expression into field from position to end. Progress treats variable-length fields and fixed-length fields differently. See the “NOTES” section for more information.

expression

A function or variable name that returns data and results in the bytes that you want to store in field.

EXAMPLE

This procedure writes the name of the first customer in the database, Second Skin Scuba, to the variable r1. It puts two additional bytes, an ASCII s and a null terminator, on the end of the name, and writes the name back to the database with the RAW statement. The procedure then displays the new name, Lift Line Skiing.

r-rawdm4.p
/* You must connect to a non-PROGRESS demo database to run
   this procedure */

DEFINE VARIABLE r1 AS RAW.

FIND FIRST customer.
DISPLAY name.

r1 = RAW(name).
PUT-BYTE (r1,17) = 115.
PUT-BYTE (r1,18) = 0.
RAW(name) = r1.

DISPLAY name. 

NOTES

SEE ALSO

GET-BYTE Function, LENGTH Function, LENGTH Statement (ORACLE only), PUT-BYTE Statement, RAW Function (ORACLE only)


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095