Charm RISC OS Library (riscos) 

The RISC OS library contains procedures related to RISC OS operations which are described further below and contains the following record:

.Var

 variable functions


Get mouse data

export proc mouse (ref MouseData zm) ref Rtl.ErrMsg

  • passed zm  - mouse data record
  • returns nil if successful
  1. The mouse data contains the x and y position of the mouse, which buttons were being pressed and the time at which these values were acquired.

Check if key is available

export proc key_available () boolean

  • returns true if at least one key is available to be read

Check for key

export proc key_check (int keycode) boolean

  • passed keycode - key code to check
  • returns true if specified key is pressed

Wait for keypress

export proc key_wait ()


Get key

export proc key_get () char

  • returns a key

Read current time

export proc read_time () int

  • returns the time in one hundredths of a second since the system was started.

Sound beep

export proc () beep

Start task

export proc start_task (ref array char zt);

  • passed zt - task to start
  1. This command is equivalent to a programmatic issuing of the WimpTask command.

Convert SWI name to number

export proc convert_swi_to_number (ref array char zs) int

  • passed zs - SWI name
  • returns SWI number or -1 if not found
  1. This command is equivalent to a programmatic issuing of the WimpTask command.

Get environment

export proc get_env () ref array char

  • returns program environment string
  1. You can use this to find the command line that started the application and it may prove possible to locate the folder from which the application was launched.

Set colour

export proc set_colour (int colour)

  • passed colour -  colour (overwrite foreground)

Translate colour

export proc translate_colour (int colour) int

  • passed colour -  colour
  • returns translated colour

.Var

Set string variable

ref proc (ref array char |name|, ref array char |value|) ref Rtl.ErrMsg set_str;

  • passed name - variable name
  •             value - string value
  • returns nil if successful

Set integer variable

ref proc (ref array char |name|, int |value|) ref Rtl.ErrMsg set_int

  • passed name - variable name
  •             value - integer value
  • returns nil if successful
Get string variable

ref proc (ref array char |name|) ref array char get_str

  • passed name - variable name
  • returns variable value as a string or nil if unsuccessful
Get integer variable

ref proc (ref array char |name|, ref int |value|) ref Rtl.ErrMsg get_int

  • passed name - variable name
  •             value - pointer to value integer
  • returns nil if successful

Unset variable

ref proc (ref array char |name|) unset

  • passed name - variable name

      Make a Free Website with Yola.