Skip to content

Commit

Permalink
Add TAB and POS global callables.
Browse files Browse the repository at this point in the history
Fixes #101
  • Loading branch information
TwitchBronBron committed Jun 5, 2020
1 parent 19a3d3c commit 664e2af
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/globalCallables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,31 @@ By using Chr, you can create strings containing characters which cannot be conta
}]
}
] as Callable[];
export let globalCallables = [...mathFunctions, ...runtimeFunctions, ...globalUtilityFunctions, ...globalStringFunctions];


let programStatementFunctions = [
{
name: 'Tab',
shortDescription: 'Moves the cursor to the specified position on the current line (modulo the width of your console if you specify TAB positions greater than the console width). TAB may be used several times in a PRINT list. No punctuation is required after a TAB modifier. Numerical expressions may be used to specify a TAB position. TAB cannot be used to move the cursor to the left. If the cursor is beyond the specified position, the TAB is ignored.',
type: new FunctionType(new VoidType()),
file: globalFile,
params: [{
name: 'expression',
type: new IntegerType()
}]
}, {
name: 'Pos',
shortDescription: 'Returns a number from 0 to window width, indicating the current cursor position on the cursor. Requires a "dummy argument" (any numeric expression).',
type: new FunctionType(new VoidType()),
file: globalFile,
params: [{
name: 'x',
type: new IntegerType()
}]
}
] as Callable[];

export let globalCallables = [...mathFunctions, ...runtimeFunctions, ...globalUtilityFunctions, ...globalStringFunctions, ...programStatementFunctions];
for (let callable of globalCallables) {
//give each callable a dummy location
callable.nameRange = Range.create(0, 0, 0, callable.name.length);
Expand Down

0 comments on commit 664e2af

Please sign in to comment.