User Tools


reference:source_code_operation

Source Code Operation

PRGEDIT ProgramSlot[,LineNumber]

Start source code operation on the editor

・When the PRGEDIT command is executed, the editor wrapping mode is forcibly turned off.
・In the following cases, the PRGEDIT state is canceled and PRGEDIT must be executed again.
・When the contents of the target slot are changed by LOAD command or NEW command, etc.
・When the program is run
・When the wrapping mode is turned on in the editor

Arguments

ProgramSlot

・Program slot to operate: 0-5
・An error will occur if the currently executing slot is specified.

LineNumber

・The operation target line (the current line)
・If not specified, the first line becomes the current line.
・If -1 is specified for the line number, the last line becomes the current line.

Example

PRGEDIT 0

PRGEDIT()
PRGEDIT OUT [ProgramSlot,]LineNumber

Get source code information in operation

・When used in function format, it returns the line number.
・An error occurs if source code operation is not started with PRGEDIT first.

Return Value

ProgramSlot

・Program slot in operation

LineNumber

・Source code line number in operation

Example

PRGEDIT OUT SLOT,LINE
LINE=PRGEDIT()

PRGGET$([AutoSeekFlag])

Get one line of string for the current line

Argument

AutoSeekFlag

・When it's 1, PRGGET is called and the current line is acquired and automatically moved down one line. As a result, the source code can be acquired line by line by simply calling PRGGET.
・When it's 0, the current line is not moved automatically. The current line must be moved with PRGSEEK.
・If not specified, 1 is specified.

Return Value

・The source string of the current line (empty string if out of range)

Example

A$=PRGGET$()

PRGSEEK [MovementDirection]
PRGSEEK([MovementDirection])

Move the current line back and forth one line

Arguments

MovementDirection

1 Move Down One Line
-1 Move Up One Line

・If not specified, it's 1.

Return Value

・When used in the function format, 1 is returned if it can be moved, and 0 is returned if it is not possible to move forward from the first or last line.

Example

R=PRGSEEK(1)

PRGSET String

Replace the contents of the current line with the specified string

・If PRGGET$ returns an empty string, add a line.

Argument

String

The string that replaces the current line

Example

PRGSET "'Comment" 

PRGINS String [,Flag]

Insert a one line string into the current line

・Insert multiple lines of string including line feed code CHR$(10).

Arguments

String

・The source string to insert

Flag

1 Insert After Current Line
0 Insert Before Current Line

・If not specified, it's 0.

Example

PRGINS "PRINT "+CHR$(34)+"HELLO"+CHR$(34)

PRGDEL [NumberOfDeletedLines]

Delete the current line

Argument

NumberOfDeletedLines

Number of lines to delete

・When a negative value is entered, all of them are deleted.
・If not specified, it's 1.

Example

PRGDEL

PRGSIZE([ProgramSlot[,ValueTypeToGet]])

Get the number of lines of source code

Arguments

ProgramSlot

Program slot for acquiring the number of rows: 0-5

・If not specified, the currently executing program slot is specified.

ValueTypeToGet

0 Number of Lines (default)
1 Number of Characters
2 Number of Empty Characters

Return Value

Value according to type

Example

A=PRGSIZE(0)

PRGNAME$([ProgramSlot])

Get program file name

・The specified file name by the LOAD/SAVE command is returned.

Argument

ProgramSlot

Program slot for acquiring file name: 0-5

・If not specified, the currently executing program slot is specified.

Return Value

File name of the program loaded in the specified program slot

Example

PRINT PRGNAME$(0)

reference/source_code_operation.txt · Last modified: 2020/08/24 12:17 (external edit)

Page Tools