Special codes of sron_cmd()

Special codes help you to perform operations on internal components of SRON's interpreter and also get internal information about interpreter when used with sron_cmd() function.

These are the following codes which SRON provides:

  1. SRON_CMD_OBUFFER_CLEAR:

It clears all the content in OBUFFER without flushing them on the terminal/command line.

{
    name : Main 

    OBUFFER += "Hello there! Sron"

    sron_cmd(SRON_CMD_OBUFFER_CLEAR)

    console : ( '>' , OBUFFER , '<')  @ Output:  ><
}

  1. SRON_CMD_IS_OBUFFER_EMPTY:

It clears all the content in OBUFFER without flushing them on the terminal/command line.

{
    name : Main

    Bool is_obuffer_empty = sron_cmd( SRON_CMD_IS_OBUFFER_EMPTY )

    println( is_obuffer_empty )  @ Output: true

    OBUFFER += 27062003

    is_obuffer_empty = sron_cmd( SRON_CMD_IS_OBUFFER_EMPTY )

    println( is_obuffer_empty )   @ Output: false
}

  1. SRON_CMD_SIZEOF_OBUFFER:

It returns the number of characters OBUFFER contains. In other words, it returns the length of content of OBUFFER.


  1. SRON_CMD_IS_FILE_AVAILABLE:

It searches for the file in the current directory and if the file is found, returns true otherwise false.


  1. SRON_CMD_GC_STACK_LEN:

It returns the length of stack of Garbage Collector.


  1. SRON_CMD_IS_BYTECODE_CACHED:

It returns true if the bytecode is cached otherwise returns false. If a function is called before, then it automatically cached by the SRON's interpreter.


  1. SRON_CMD_NO_OF_BYTECODE_CACHED:

It returns the number of all the cached bytecode files.


Last updated