String Datum

by ExPixel
This is a useful little string datum I came up with. [More]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://ExPixel.StringDatum##version=1

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://ExPixel.StringDatum##version=1

18 downloads
Version Initial Release
Date added: Feb 11 2011
Last updated: Mar 11 2011
0 fans
Within the datum:

var/SaveStrings = TRUE

String
var
text = ""
max_length = null
list/filter
save_mode = TRUE
proc
New( new_text as text, new_max_length as num, list/new_filter, new_filter_mode as num )
Init( new_text as text, new_max_length as num, list/new_filter, new_filter_mode as num )
append(Append as text, Direction=BACK)
set_max_length(new_max_length)
insert(Insert as text, Place=text_length()+1)
set_filter_mode(NewMode = ILLEGAL)
filter()
replace(Replace as text, Replacement as text)
replaceEx(Replace as text, Replacement as text)
text_length()
get()
set_text(Newtext as text)
append_string(String/Append, Direction=BACK)
random_append(Characters=1, Direction=BACK, ascii_min=97, ascii_max=122)
String( new_text as text, new_max_length as num, list/new_filter, new_filter_mode as num )
from_file(var/f)
to_file(var/f, delete=FALSE)
disable_cache()
enable_cache()
terminate()
destroy()