Skip to contents

Coerce raw or character data to an AmigaBasic() S3 class object

Usage

as.AmigaBasic(x, ...)

Arguments

x

x should be a vector of raw data or character strings. When x is raw data, it is interpreted as if it where from an Amiga Basic binary encoded file.

When x is a vector of character strings, each element of the vector should represent one line of Basic code. Each line should not contain line break or other special characters, as this will result in errors. The text should represent valid Amiga Basic syntax. The syntax is only checked to a limited extent as this package does not implement an interpreter for the code.

...

Currently ignored.

Value

Returns an AmigaBasic() class object based on x.

Details

Convert text to an AmigaBasic() S3 class object. The text should consist of valid Amiga BASIC syntaxis. This function does not perform a full check of the syntaxis, but will break on some fundamental syntaxis malformations

Author

Pepijn de Vries

Examples

if (FALSE) {
## An AmigaBasic object can be created from text.
## Note that each line of code is a seperate element
## in the vector:
bas <- as.AmigaBasic(c(
  "CLS ' Clear the screen",
  "PRINT \"Hello world!\" ' Print a message on the screen"
))

## Let's make it raw data:
bas.raw <- as.raw(bas)

## We can also use the raw data to create an Amiga Basic object:
## Note that this effectively the same as calling 'rawToAmigaBasic'
bas <- as.AmigaBasic(bas.raw)
}