as.AmigaBasic: Coerce raw or character data to an AmigaBasic class object

View source: R/basic.r

as.AmigaBasicR Documentation

Coerce raw or character data to an AmigaBasic class object

Description

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.

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

Value

Returns an AmigaBasic() class object based on x.

Author(s)

Pepijn de Vries

References

https://en.wikipedia.org/wiki/AmigaBASIC

See Also

Other AmigaBasic.operations: AmigaBasic.reserved(), AmigaBasicBMAP, AmigaBasic, [.AmigaBasic(), as.AmigaBasicBMAP(), as.character(), check.names.AmigaBasic(), names.AmigaBasic(), rawToAmigaBasicBMAP(), rawToAmigaBasic(), read.AmigaBasicBMAP(), read.AmigaBasic(), write.AmigaBasic()

Other raw.operations: as.raw.AmigaBasic(), colourToAmigaRaw(), packBitmap(), rawToAmigaBasicBMAP(), rawToAmigaBasicShape(), rawToAmigaBasic(), rawToAmigaBitmapFontSet(), rawToAmigaBitmapFont(), rawToAmigaIcon(), rawToHWSprite(), rawToIFFChunk(), rawToSysConfig(), simpleAmigaIcon()

Examples

## Not run: 
## 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)

## End(Not run)

AmigaFFH documentation built on June 22, 2024, 11:03 a.m.