From a1bb80722ba108a6266eb1b66ed5502d8ec69d87 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Mon, 30 Dec 2024 17:53:54 -0800 Subject: [PATCH] Update builtin_functions_reference.html --- docs/builtin_functions_reference.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/builtin_functions_reference.html b/docs/builtin_functions_reference.html index ac5b6e1c..8a1715e3 100644 --- a/docs/builtin_functions_reference.html +++ b/docs/builtin_functions_reference.html @@ -72,6 +72,9 @@ remove_obj(xs: [any], obj: any) -> anyremove all elements equal to obj (==), returns obj. + +truncate(xs: [any], i: int)removes all elements starting from index i, does nothing if i >= len + binary_search(xs: [int], key: int) -> int, intdoes a binary search for key in a sorted vector, returns as first return value how many matches were found, and as second the index in the array where the matches start (so you can read them, overwrite them, or remove them), or if none found, where the key could be inserted such that the vector stays sorted. This overload is for int vectors and keys. @@ -575,7 +578,10 @@

file

- +
scan_folder(folder: string, rel: bool = false) -> [string]?, [int]?returns two vectors representing all elements in a folder, the first vector containing all names, the second vector containing sizes in bytes (or -1 if a directory). set rel use a relative path, default is absolute. Returns nil if folder couldn't be scanned.
+ + +
format_time(format: string, time: int, localtime: bool) -> stringconvert a time in seconds since 00:00:00 UTC, Thursday, 1 January 1970 into a string, using the same format string syntax as POSIX strftime. If localtime is true, then the time will be displayed using the local timezone, otherwise it will use UTC. Returns an empty string on error.
scan_folder(folder: string, rel: bool = false) -> [string]?, [int]?, [int]?returns three vectors representing all elements in a folder, the first vector containing all names, the second vector containing sizes in bytes (or -1 if a directory), and the third as the number of seconds since 00:00:00 UTC, Thursday, 1 January 1970, not including leap seconds. set rel use a relative path, default is absolute. Returns nil if folder couldn't be scanned.
read_file(file: string, textmode: int = 0) -> string?returns the contents of a file as a string, or nil if the file can't be found. you may use either \ or / as path separators