Standard library

Official web site : http://www.scolring.org/.

Plateform : Windows XP or +, GNU / Linux with glib > 2.x

Scol : 4.0 or +

Features

Some new functions to add to the current standard library

Compilation

No specific way.

Scol api

List of functions

strextrS

strextrS is a similar function at strextr. Instead of " " as separator, you can take any string at your convenience.

Prototype

Prototype : strextrS
ReturnTypeNameDescription
fun [S S] [[S r1] r1]
-Sstringany string to cut
-Spatternany string
[[S r1] r1]--list of lines, each line is a list of customized words or nil if error or nil if error

Example

typeof listStrextrS = [[S r1] r1];;

fun main ()=
	_showconsole;

	set listStrextrS = strextrS "The SO3Engine is the new 3d engine of Scol.\nIt is better than the old." "e";
	...


listextr

listextr extract a sublist from a list, between two indices

Prototype

Prototype : listextr
ReturnTypeNameDescription
fun [[u0 r1] I I] [u0 r1]
-[u0 r1]listany list to extract
-Ifirstthe first indice (if the value is negative, the position is since the end)
-Ilastthe last indice (if the value is negative, the position is since the end)
[u0 r1]--a new list or nil if error

Example

fun main ()=
	_showconsole;

	_fooIList listextr 0::1::2::3::4::5::6::7::nil (-5) 4;
	_fooSList listextr "0"::"1"::"2"::"3"::"4"::"5"::"6"::"7"::nil 2 4;

	...

strfind2List

strfind2List is a similar function at strfind. But return the positions of all substring found

Prototype

Prototype : strfind2List
ReturnTypeNameDescription
fun [S S I] [I r1]
-Sstringany string
-Ssubstringany substring
-Iinit_positionposition to start
[I r1]--list of the all positions or nil if error

Example

fun main ()=
	_showconsole;

	_fooIList strfind2List "Scol is a good language." "a" 0;
	_fooIList strfind2List "Scol is a good language." "good" 12;
	...