Skip to content

Extra functions

Wang Renxin edited this page Jan 26, 2016 · 18 revisions

MY-BASIC contains severial utility functions which are not written inside the core/my_basic.c, but in the shell/main.c. This page describes all these functions.

beep

beep

Beeps once with the speaker. The simplest sample for writing a customized scripting interface function.

gc

gc()

Tries to trigger garbage collection, and returns how much bytes collected.

now

now()/now(FORMAT_STRING)

Gets a current time string.

Parameter format:

Specifier Replaced by Example
None Represent Www Mmm dd hh:mm:ss yyyy Tue Jan 26 08:00:00 2016
%D Short MM/DD/YY date 08/23/01
%F Short YYYY-MM-DD date 2001-08-23
%T ISO 8601 time format (HH:MM:SS) 14:55:02
%R 24-hour HH:MM time 14:55
More... Refer to strftime

set_importing_dirs

set_importing_dirs(DIRS)

Sets importing directories.

DIRS are directory pathes separated by semicolons, eg. "data;data/res;../data;../data/res".

ticks

ticks()

Gets the elapsed tick count since system bootup in millisecond.

Clone this wiki locally