Console - MrKaszeba19/PapajLang GitHub Wiki
Console is a package of functions for PapajScript. This package contains functions that manipulate the console output and use the system features. It was released on May 31, 2020.
The earliest known stable RPN Calculator version to work with Console – 0.5.0.
List of Console functions for all systems
Note:
- If you do not want to type
Console.
every time, just type@use(Console)
before. However, if you want to stop using the package, type@unuse(Console)
. - The version 0.5.1.1 is the last version where you can use
Console.
functions without running@use(Console)
. Starting from April 16, 2021, allConsole
functions require to be activated by@use(Console)
Package Function | Syntax | Output type | Purpose | Since |
---|---|---|---|---|
Console.clrscr | (no args) function | none | Clear the console screen | 0.5.0 |
Console.clearScreen | (no args) function | none | Clear the console screen | 0.5.0 |
Console.delay | NUM1 function | none | Delay the program for NUM1 milliseconds | 0.5.0 |
Console.gotoXY | NUM1 NUM2 function | none | Move the cursor to the coords of NUM1,NUM2 | 0.5.0 |
Console.textBackground | NUM1 function | none | Set the background color (using Pascal Crt color order) | 0.5.0 |
Console.textColor | NUM1 function | none | Set the foreground color (using Pascal Crt color order) | 0.5.0 |
Console.textColour | NUM1 function | none | British alias for textColor |
0.5.1 |
Console.runCommand | STR1 function | String | Run a console command provided in STR1 | 0.5.0 |
Console.system | STR1 function | String | Execute a command being included in S1 | 0.5.2 |
Console.UserName | (no args) function | String | Return a string containing the user name | 0.5.2 |
Console.UserHome | (no args) function | String | Return a string containing the user's home directory | 0.5.2 |
Console.HostName | (no args) function | String | Return a string containing the computer name | 0.5.2 |
Console.OSName | (no args) function | String | Return a string containing the name of the operating system (OS) | 0.5.2 |
Console.OSDistribution | (no args) function | String | Return a string containing the nickname (distribution) of OS | 0.5.2 |
Console.OSDist | (no args) function | String | Alias for Console.OSDistribution |
0.5.2 |
Console.OSVersion | (no args) function | String | Return a string containing the OS version | 0.5.2 |
Console.CPUArchitecture | (no args) function | String | Return a string containing the CPU architecture name | 0.5.2 |
Console.CPUArch | (no args) function | String | Alias for Console.CPUArchitecture |
0.5.2 |
Console.CPUBits | (no args) function | Number | Return the amount of bits of CPU architecture | 0.5.2 |
Console.OSDistFull | (no args) function | String | Return a string containing the full name of OS | 0.5.3 |
Console.OSDistributionFull | (no args) function | String | Return a string containing the full name of OS | 0.5.3 |
Console.getShell | (no args) function | String | Return a string containing the PS interpreter shell | 0.5.3 |
Console.setShell | STR1 function | none | Set the PS interpreter shell | 0.5.3 |
Console.CPUNames | (no args) function | set of String | Return the names of each CPU core | 0.5.3 |
Console.CPUBaseFreqs | (no args) function | set of String | Return the base frequencies (kHz) of each CPU core | 0.5.3 |
Console.CPUThreads | (no args) function | Number | Return the count of CPU cores | 0.5.3 |
Console.isUnix | (no args) function | Boolean | Check whether the OS is Unix | 0.5.3 |
Console.isLinux | (no args) function | Boolean | Check whether the OS is Linux | 0.5.3 |
Console.isWindows | (no args) function | Boolean | Check whether the OS is Windows | 0.5.3 |
List of Console functions for Windows users
Package Function | Syntax | Output type | Purpose | Since |
---|---|---|---|---|
Console.whereX | (no args) function | Number | Get the X coords of the console cursor | 0.5.0 |
Console.whereY | (no args) function | Number | Get the Y coords of the console cursor | 0.5.0 |
Console.startSound | NUM1 function | none | Start playing a sound at the frequency of NUM1 Hz | 0.5.0 |
Console.stopSound | (no args) function | none | Stop playing a sound | 0.5.0 |
List of Console functions for non-Windows users
Package Function | Syntax | Output type | Purpose | Since |
---|---|---|---|---|
Console.textBackgroundANSI | NUM1 function | none | Set the background color (using ANSI color order) | 0.5.0 |
Console.textColorANSI | NUM1 function | none | Set the foreground color (using ANSI color order) | 0.5.0 |
Console.textBackgroundRGB | NUM1 NUM2 NUM3 function | none | Set the background color (using RGB palette) | 0.5.0 |
Console.textColorRGB | NUM1 NUM2 NUM3 function | none | Set the foreground color (using RGB palette) | 0.5.0 |
Console.textReset | (no args) function | none | Reset all parameters of the text | 0.5.0 |
Console.textBold | (no args) function | none | Turn text bold mode on | 0.5.0 |
Console.textItalic | (no args) function | none | Turn text italic mode on | 0.5.0 |
Console.textUnderline | (no args) function | none | Turn text underline mode on | 0.5.0 |
Console.textBlink | (no args) function | none | Turn blinking text mode on | 0.5.0 |
Console.textFastBlink | (no args) function | none | Turn quick blinking text mode on | 0.5.0 |
Console.textInverse | (no args) function | none | Inverse colors foreground-background | 0.5.0 |
Console.textBoldOff | (no args) function | none | Turn bold text mode off | 0.5.0 |
Console.textItalicOff | (no args) function | none | Turn italic text mode off | 0.5.0 |
Console.textUnderlineOff | (no args) function | none | Turn underline text mode off | 0.5.0 |
Console.textBlinkOff | (no args) function | none | Turn blinking text mode off | 0.5.0 |
Console.textFastBlinkOff | (no args) function | none | Turn fast blinking text mode off | 0.5.0 |
Console.textInverseOff | (no args) function | none | Turn inverse text mode off | 0.5.0 |
Console.UserShell | (no args) function | String | Return a string containing the user's Unix shell path | 0.5.2 |
List of Console functions for Linux users
Package Function | Syntax | Output type | Purpose | Since |
---|---|---|---|---|
Console.CPUUptime | (no args) function | Number | Return the CPU uptime in seconds | 0.5.3 |
Console.CPUMaxFreqs | (no args) function | set of Number | Return the max frequencies (kHz) of each CPU core | 0.5.3 |
Console.CPUMinFreqs | (no args) function | set of Number | Return the min frequencies (kHz) of each CPU core | 0.5.3 |
Console.CPUCurrentFreqs | (no args) function | set of Number | Return the current frequencies (kHz) of each CPU core | 0.5.3 |
Console.CPUUsages | (no args) function | set of Number | Return the relative usage of each CPU core (value is between 0 and 1, where 0 is 0% and 1 is 100%) | 0.5.3 |
Console.CPUAllUsage | (no args) function | Number | Return the overall relative usage of CPU (value is between 0 and 1, where 0 is 0% and 1 is 100%) | 0.5.3 |
Console.RAMTotal | (no args) function | Number | Return the total RAM amount in kilobytes | 0.5.3 |
Console.RAMUsage | (no args) function | Number | Return the used RAM amount in kilobytes | 0.5.3 |
Console.RAMFree | (no args) function | Number | Return the free RAM amount in kilobytes | 0.5.3 |
Console.RAMAvailable | (no args) function | Number | Return the available RAM amount in kilobytes | 0.5.3 |
Console.SwapTotal | (no args) function | Number | Return the total swap memory amount in kilobytes | 0.5.3 |
Console.SwapUsage | (no args) function | Number | Return the used swap memory amount in kilobytes | 0.5.3 |
Console.SwapFree | (no args) function | Number | Return the free swap memory amount in kilobytes | 0.5.3 |
Console.ScreenResolution | (no args) function | String | Return the screen width and height as a string, e.g. 1920x1080 |
0.5.3 |
Console.ScreenWidth | (no args) function | Number | Return the screen width | 0.5.3 |
Console.ScreenHeight | (no args) function | Number | Return the screen height | 0.5.3 |