[.AmigaBasic | R Documentation |
Extract or replace lines of Amiga Basic code
## S3 method for class 'AmigaBasic'
x[i]
## S3 replacement method for class 'AmigaBasic'
x[i] <- value
## S3 method for class 'AmigaBasic'
x[[i]]
## S3 replacement method for class 'AmigaBasic'
x[[i]] <- value
x |
An |
i |
In case of |
value |
A |
Extract or replace specific lines in an AmigaBasic()
-class object.
The extraction method returns an AmigaBasic()
object based in the lines selected with i
.
The replacement method returns an AmigaBasic()
object with the selected lines replaced with value
.
Pepijn de Vries
Other AmigaBasic.operations:
AmigaBasic.reserved()
,
AmigaBasicBMAP
,
AmigaBasic
,
as.AmigaBasicBMAP()
,
as.AmigaBasic()
,
as.character()
,
check.names.AmigaBasic()
,
names.AmigaBasic()
,
rawToAmigaBasicBMAP()
,
rawToAmigaBasic()
,
read.AmigaBasicBMAP()
,
read.AmigaBasic()
,
write.AmigaBasic()
## Not run:
## First generate a few lines of Basic code:
bas <- as.AmigaBasic(c(
"LET a = 1",
"a = a + 1",
"PRINT \"a now equals\";a",
"INPUT \"clear screen (y/n)? \", b$",
"IF UCASE$(b$) = \"Y\" THEN CLS"
))
## Select only lines 4 and 5:
bas[4:5]
## use negative indices to deselect specific lines.
## deselect line 2:
bas[-2]
## replace line 2
bas[2] <- "a = a + 2"
## You can also use AmigaBasic class object as replacement
bas[2] <- as.AmigaBasic("a = a + 3")
## single lines can also be selected with '[['
bas[[2]]
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.