diff --git a/code/__defines/typeids.dm b/code/__defines/typeids.dm index 9af310012b..f11b3b6aec 100644 --- a/code/__defines/typeids.dm +++ b/code/__defines/typeids.dm @@ -2,5 +2,5 @@ #define TYPEID_NULL "0" #define TYPEID_NORMAL_LIST "f" //helper macros -#define GET_TYPEID(ref) ( ( (lentext(ref) <= 10) ? "TYPEID_NULL" : copytext(ref, 4, lentext(ref)-6) ) ) +#define GET_TYPEID(ref) ( ( (length(ref) <= 10) ? "TYPEID_NULL" : copytext(ref, 4, length(ref)-6) ) ) #define IS_NORMAL_LIST(L) (GET_TYPEID("\ref[L]") == TYPEID_NORMAL_LIST) \ No newline at end of file diff --git a/code/_compatibility/509/JSON Reader.dm b/code/_compatibility/509/JSON Reader.dm index 544d197ccd..18f739c5ef 100644 --- a/code/_compatibility/509/JSON Reader.dm +++ b/code/_compatibility/509/JSON Reader.dm @@ -28,7 +28,7 @@ json_reader src.json = json . = new/list() src.i = 1 - while(src.i <= lentext(json)) + while(src.i <= length(json)) var/char = get_char() if(is_whitespace(char)) i++ @@ -46,7 +46,7 @@ json_reader read_word() var/val = "" - while(i <= lentext(json)) + while(i <= length(json)) var/char = get_char() if(is_whitespace(char) || symbols.Find(char)) i-- // let scanner handle this character @@ -58,7 +58,7 @@ json_reader var escape = FALSE val = "" - while(++i <= lentext(json)) + while(++i <= length(json)) var/char = get_char() if(escape) switch(char) diff --git a/code/_compatibility/509/JSON Writer.dm b/code/_compatibility/509/JSON Writer.dm index de3bb54a3e..80e4976687 100644 --- a/code/_compatibility/509/JSON Writer.dm +++ b/code/_compatibility/509/JSON Writer.dm @@ -43,7 +43,7 @@ json_writer var/static/list/json_escape = list("\\" = "\\\\", "\"" = "\\\"", "\n" = "\\n") for(var/targ in json_escape) var/start = 1 - while(start <= lentext(txt)) + while(start <= length(txt)) var/i = findtext(txt, targ, start) if(!i) break diff --git a/code/_helpers/text.dm b/code/_helpers/text.dm index eb363c08cb..688e1c2a68 100644 --- a/code/_helpers/text.dm +++ b/code/_helpers/text.dm @@ -16,7 +16,7 @@ // Run all strings to be used in an SQL query through this proc first to properly escape out injection attempts. /proc/sanitizeSQL(var/t as text) var/sqltext = dbcon.Quote(t); - return copytext(sqltext, 2, lentext(sqltext));//Quote() adds quotes around input, we already do that + return copytext(sqltext, 2, length(sqltext));//Quote() adds quotes around input, we already do that /* * Text sanitization @@ -249,9 +249,9 @@ //This is used for fingerprints /proc/stringmerge(var/text,var/compare,replace = "*") var/newtext = text - if(lentext(text) != lentext(compare)) + if(length(text) != length(compare)) return 0 - for(var/i = 1, i < lentext(text), i++) + for(var/i = 1, i < length(text), i++) var/a = copytext(text,i,i+1) var/b = copytext(compare,i,i+1) //if it isn't both the same letter, or if they are both the replacement character @@ -271,7 +271,7 @@ if(!text || !character) return 0 var/count = 0 - for(var/i = 1, i <= lentext(text), i++) + for(var/i = 1, i <= length(text), i++) var/a = copytext(text,i,i+1) if(a == character) count++ @@ -286,8 +286,8 @@ //Used in preferences' SetFlavorText and human's set_flavor verb //Previews a string of len or less length proc/TextPreview(var/string,var/len=40) - if(lentext(string) <= len) - if(!lentext(string)) + if(length(string) <= len) + if(!length(string)) return "\[...\]" else return string diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 7e25bb2df9..a15887cc58 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -314,7 +314,7 @@ //Stolen from status_display /obj/machinery/door_timer/proc/texticon(var/tn, var/px = 0, var/py = 0) var/image/I = image('icons/obj/status_display.dmi', "blank") - var/len = lentext(tn) + var/len = length(tn) for(var/d = 1 to len) var/char = copytext(tn, len-d+1, len-d+2) diff --git a/code/game/machinery/supply_display.dm b/code/game/machinery/supply_display.dm index d1be70e754..211918c5e6 100644 --- a/code/game/machinery/supply_display.dm +++ b/code/game/machinery/supply_display.dm @@ -11,7 +11,7 @@ message2 = "Error" else if(shuttle.has_arrive_time()) message2 = get_supply_shuttle_timer() - if(lentext(message2) > CHARS_PER_LINE) + if(length(message2) > CHARS_PER_LINE) message2 = "Error" else if(shuttle.is_launching()) if(shuttle.at_station()) diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm index d3f269abaf..8e1699c800 100644 --- a/code/game/objects/items/weapons/paint.dm +++ b/code/game/objects/items/weapons/paint.dm @@ -27,7 +27,7 @@ var/global/list/cached_icons = list() return ..() New() - if(paint_type && lentext(paint_type) > 0) + if(paint_type && length(paint_type) > 0) name = paint_type + " " + name ..() reagents.add_reagent("water", volume*3/5) diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm index ff1826116a..39eea11236 100644 --- a/code/game/objects/structures/musician.dm +++ b/code/game/objects/structures/musician.dm @@ -103,12 +103,12 @@ if(!playing || shouldStopPlaying(user))//If the instrument is playing, or special case playing = 0 return - if(lentext(note) == 0) + if(length(note) == 0) continue var/cur_note = text2ascii(note) - 96 if(cur_note < 1 || cur_note > 7) continue - for(var/i=2 to lentext(note)) + for(var/i=2 to length(note)) var/ni = copytext(note,i,i+1) if(!text2num(ni)) if(ni == "#" || ni == "b" || ni == "n") @@ -196,11 +196,11 @@ t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message) if(!in_range(instrumentObj, usr)) return - if(lentext(t) >= INSTRUMENT_MAX_LINE_LENGTH*INSTRUMENT_MAX_LINE_NUMBER) + if(length(t) >= INSTRUMENT_MAX_LINE_LENGTH*INSTRUMENT_MAX_LINE_NUMBER) var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no") if(cont == "no") break - while(lentext(t) > INSTRUMENT_MAX_LINE_LENGTH*INSTRUMENT_MAX_LINE_NUMBER) + while(length(t) > INSTRUMENT_MAX_LINE_LENGTH*INSTRUMENT_MAX_LINE_NUMBER) //split into lines spawn() lines = splittext(t, "\n") @@ -214,7 +214,7 @@ lines.Cut(INSTRUMENT_MAX_LINE_NUMBER+1) var/linenum = 1 for(var/l in lines) - if(lentext(l) > INSTRUMENT_MAX_LINE_LENGTH) + if(length(l) > INSTRUMENT_MAX_LINE_LENGTH) to_chat(usr, "Line [linenum] too long!") lines.Remove(l) else @@ -244,7 +244,7 @@ return if(lines.len > INSTRUMENT_MAX_LINE_NUMBER) return - if(lentext(newline) > INSTRUMENT_MAX_LINE_LENGTH) + if(length(newline) > INSTRUMENT_MAX_LINE_LENGTH) newline = copytext(newline, 1, INSTRUMENT_MAX_LINE_LENGTH) lines.Add(newline) else if(href_list["deleteline"]) @@ -257,7 +257,7 @@ var/content = html_encode(input("Enter your line: ", instrumentObj.name, lines[num]) as text|null) if(!content || !in_range(instrumentObj, usr)) return - if(lentext(content) > INSTRUMENT_MAX_LINE_LENGTH) + if(length(content) > INSTRUMENT_MAX_LINE_LENGTH) content = copytext(content, 1, INSTRUMENT_MAX_LINE_LENGTH) if(num > lines.len || num < 1) return diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm index d9e1efc972..dd52884833 100644 --- a/code/modules/admin/DB ban/functions.dm +++ b/code/modules/admin/DB ban/functions.dm @@ -377,13 +377,13 @@ datum/admins/proc/DB_ban_unban_by_id(var/id) if(playercid) cidsearch = "AND computerid = '[playercid]' " else - if(adminckey && lentext(adminckey) >= 3) + if(adminckey && length(adminckey) >= 3) adminsearch = "AND a_ckey LIKE '[adminckey]%' " - if(playerckey && lentext(playerckey) >= 3) + if(playerckey && length(playerckey) >= 3) playersearch = "AND ckey LIKE '[playerckey]%' " - if(playerip && lentext(playerip) >= 3) + if(playerip && length(playerip) >= 3) ipsearch = "AND ip LIKE '[playerip]%' " - if(playercid && lentext(playercid) >= 7) + if(playercid && length(playercid) >= 7) cidsearch = "AND computerid LIKE '[playercid]%' " if(dbbantype) diff --git a/code/modules/admin/view_variables/modify_variables.dm b/code/modules/admin/view_variables/modify_variables.dm index b964339aa9..8878318fd6 100644 --- a/code/modules/admin/view_variables/modify_variables.dm +++ b/code/modules/admin/view_variables/modify_variables.dm @@ -55,11 +55,11 @@ GLOBAL_PROTECT(VVpixelmovement) // the type with the base type removed from the begaining var/fancytype = types[D.type] if (findtext(fancytype, types[type])) - fancytype = copytext(fancytype, lentext(types[type])+1) - var/shorttype = copytext("[D.type]", lentext("[type]")+1) - if (lentext(shorttype) > lentext(fancytype)) + fancytype = copytext(fancytype, length(types[type])+1) + var/shorttype = copytext("[D.type]", length("[type]")+1) + if (length(shorttype) > length(fancytype)) shorttype = fancytype - if (!lentext(shorttype)) + if (!length(shorttype)) shorttype = "/" .["[D]([shorttype])\ref[D]#[i]"] = D diff --git a/code/modules/flufftext/TextFilters.dm b/code/modules/flufftext/TextFilters.dm index 5a40ea1934..c7582fe952 100644 --- a/code/modules/flufftext/TextFilters.dm +++ b/code/modules/flufftext/TextFilters.dm @@ -2,8 +2,8 @@ proc/Intoxicated(phrase) phrase = html_decode(phrase) - var/leng=lentext(phrase) - var/counter=lentext(phrase) + var/leng=length(phrase) + var/counter=length(phrase) var/newphrase="" var/newletter="" while(counter>=1) diff --git a/code/modules/mob/hear_say.dm b/code/modules/mob/hear_say.dm index f316797dc2..1fd71995dc 100644 --- a/code/modules/mob/hear_say.dm +++ b/code/modules/mob/hear_say.dm @@ -317,7 +317,7 @@ if(copytext(heardword,1, 1) in punctuation) heardword = copytext(heardword,2) if(copytext(heardword,-1) in punctuation) - heardword = copytext(heardword,1,lentext(heardword)) + heardword = copytext(heardword,1,length(heardword)) heard = "...You hear something about...[heardword]" else diff --git a/code/modules/mob/living/silicon/pai/examine.dm b/code/modules/mob/living/silicon/pai/examine.dm index 876b9aacf1..11a970cfe8 100644 --- a/code/modules/mob/living/silicon/pai/examine.dm +++ b/code/modules/mob/living/silicon/pai/examine.dm @@ -19,7 +19,7 @@ if(print_flavor_text()) msg += "\n[print_flavor_text()]\n" if (pose) - if( findtext(pose,".",lentext(pose)) == 0 && findtext(pose,"!",lentext(pose)) == 0 && findtext(pose,"?",lentext(pose)) == 0 ) + if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 ) pose = addtext(pose,".") //Makes sure all emotes end with a period. msg += "\nIt is [pose]" diff --git a/code/modules/mob/living/silicon/robot/examine.dm b/code/modules/mob/living/silicon/robot/examine.dm index fa24e9ae91..33ec3183be 100644 --- a/code/modules/mob/living/silicon/robot/examine.dm +++ b/code/modules/mob/living/silicon/robot/examine.dm @@ -44,7 +44,7 @@ if(print_flavor_text()) msg += "\n[print_flavor_text()]\n" if (pose) - if( findtext(pose,".",lentext(pose)) == 0 && findtext(pose,"!",lentext(pose)) == 0 && findtext(pose,"?",lentext(pose)) == 0 ) + if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 ) pose = addtext(pose,".") //Makes sure all emotes end with a period. msg += "\nIt is [pose]" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 5ce336ba4f..271449a46d 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -330,7 +330,7 @@ /mob/proc/print_flavor_text() if (flavor_text && flavor_text != "") var/msg = replacetext(flavor_text, "\n", " ") - if(lentext(msg) <= 40) + if(length(msg) <= 40) return "[msg]" else return "[copytext_preserve_html(msg, 1, 37)]... More..." diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 4cb44c6e82..2b74151cdd 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -186,8 +186,8 @@ proc/getsensorlevel(A) proc/slur(phrase) phrase = html_decode(phrase) - var/leng=lentext(phrase) - var/counter=lentext(phrase) + var/leng=length(phrase) + var/counter=length(phrase) var/newphrase="" var/newletter="" while(counter>=1) diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index ccef2fb79c..0a3685d61e 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -303,8 +303,8 @@ proc/blood_incompatible(donor,receiver,donor_species,receiver_species) if(donor_species != receiver_species) return 1 - var/donor_antigen = copytext(donor,1,lentext(donor)) - var/receiver_antigen = copytext(receiver,1,lentext(receiver)) + var/donor_antigen = copytext(donor,1,length(donor)) + var/receiver_antigen = copytext(receiver,1,length(receiver)) var/donor_rh = (findtext(donor,"+")>0) var/receiver_rh = (findtext(receiver,"+")>0) diff --git a/code/modules/resleeving/infomorph.dm b/code/modules/resleeving/infomorph.dm index 099f3c0a95..9f5528d547 100644 --- a/code/modules/resleeving/infomorph.dm +++ b/code/modules/resleeving/infomorph.dm @@ -563,7 +563,7 @@ var/global/list/default_infomorph_software = list() if(print_flavor_text()) msg += "\n[print_flavor_text()]\n" if (pose) - if( findtext(pose,".",lentext(pose)) == 0 && findtext(pose,"!",lentext(pose)) == 0 && findtext(pose,"?",lentext(pose)) == 0 ) + if( findtext(pose,".",length(pose)) == 0 && findtext(pose,"!",length(pose)) == 0 && findtext(pose,"?",length(pose)) == 0 ) pose = addtext(pose,".") //Makes sure all emotes end with a period. msg += "\nIt is [pose]" diff --git a/code/modules/scripting/Implementations/_Logic.dm b/code/modules/scripting/Implementations/_Logic.dm index aa4080d440..5522d0e2aa 100644 --- a/code/modules/scripting/Implementations/_Logic.dm +++ b/code/modules/scripting/Implementations/_Logic.dm @@ -141,7 +141,7 @@ proc/string_tolist(var/string) var/list/L = new/list() var/i - for(i=1, i<=lentext(string), i++) + for(i=1, i<=length(string), i++) L.Add(copytext(string, i, i)) return L @@ -154,12 +154,12 @@ proc/string_explode(var/string, var/separator) var/lasti = 1 var/list/L = new/list() - for(i=1, i<=lentext(string)+1, i++) + for(i=1, i<=length(string)+1, i++) if(copytext(string, i, i+1) == separator) // We found a separator L.Add(copytext(string, lasti, i)) lasti = i+1 - L.Add(copytext(string, lasti, lentext(string)+1)) // Adds the last segment + L.Add(copytext(string, lasti, length(string)+1)) // Adds the last segment return L @@ -186,7 +186,7 @@ proc/n_reverse(var/string) if(istext(string)) var/newstring = "" var/i - for(i=lentext(string), i>0, i--) + for(i=length(string), i>0, i--) if(i>=1000) break newstring = newstring + copytext(string, i, i+1) @@ -250,9 +250,9 @@ proc/n_inrange(var/num, var/min=-1, var/max=1) /proc/string_replacetext(var/haystack,var/a,var/b) if(istext(haystack)&&istext(a)&&istext(b)) var/i = 1 - var/lenh=lentext(haystack) - var/lena=lentext(a) - //var/lenb=lentext(b) + var/lenh=length(haystack) + var/lena=length(a) + //var/lenb=length(b) var/count = 0 var/list/dat = list() while (i < lenh) diff --git a/code/modules/scripting/Options.dm b/code/modules/scripting/Options.dm index 22774455dc..c8ca1d5830 100644 --- a/code/modules/scripting/Options.dm +++ b/code/modules/scripting/Options.dm @@ -31,8 +31,8 @@ n_scriptOptions IsValidID(id) //returns true if all the characters in the string are okay to be in an identifier name if(!CanStartID(id)) //don't need to grab first char in id, since text2ascii does it automatically return 0 - if(lentext(id)==1) return 1 - for(var/i=2 to lentext(id)) + if(length(id)==1) return 1 + for(var/i=2 to length(id)) if(!IsValidIDChar(copytext(id, i, i+1))) return 0 return 1 diff --git a/code/modules/scripting/Scanner/Scanner.dm b/code/modules/scripting/Scanner/Scanner.dm index 35f21b39fd..0162119760 100644 --- a/code/modules/scripting/Scanner/Scanner.dm +++ b/code/modules/scripting/Scanner/Scanner.dm @@ -115,7 +115,7 @@ Scan() //Creates a list of tokens from source code var/list/tokens=new - for(, src.codepos<=lentext(code), src.codepos++) + for(, src.codepos<=length(code), src.codepos++) var/char=copytext(code, codepos, codepos+1) if(char=="\n") @@ -155,7 +155,7 @@ ReadString(start) var buf - for(, codepos <= lentext(code), codepos++)//codepos to lentext(code)) + for(, codepos <= length(code), codepos++)//codepos to length(code)) var/char=copytext(code, codepos, codepos+1) switch(char) if("\\") //Backslash (\) encountered in string @@ -192,7 +192,7 @@ var char=copytext(code, codepos, codepos+1) buf - while(!delim.Find(char) && codepos<=lentext(code)) + while(!delim.Find(char) && codepos<=length(code)) buf+=char char=copytext(code, ++codepos, codepos+1) codepos-- //allow main Scan() proc to read the delimiter @@ -212,7 +212,7 @@ while(options.symbols.Find(buf+char)) buf+=char - if(++codepos>lentext(code)) break + if(++codepos>length(code)) break char=copytext(code, codepos, codepos+1) codepos-- //allow main Scan() proc to read the next character @@ -260,7 +260,7 @@ comm = 2 // starts a multi-line comment while(comm) - if(++codepos>lentext(code)) break + if(++codepos>length(code)) break if(expectedend) // ending statement expected... char = copytext(code, codepos, codepos+1) diff --git a/code/modules/xenoarcheaology/artifacts/replicator.dm b/code/modules/xenoarcheaology/artifacts/replicator.dm index af78f320e5..3b65436177 100644 --- a/code/modules/xenoarcheaology/artifacts/replicator.dm +++ b/code/modules/xenoarcheaology/artifacts/replicator.dm @@ -92,9 +92,9 @@ var/spawn_type = pop(spawning_types) var/obj/spawned_obj = new spawn_type(src.loc) if(source_material) - if(lentext(source_material.name) < MAX_MESSAGE_LEN) + if(length(source_material.name) < MAX_MESSAGE_LEN) spawned_obj.name = "[source_material] " + spawned_obj.name - if(lentext(source_material.desc) < MAX_MESSAGE_LEN * 2) + if(length(source_material.desc) < MAX_MESSAGE_LEN * 2) if(spawned_obj.desc) spawned_obj.desc += " It is made of [source_material]." else diff --git a/code/modules/xenoarcheaology/finds/talking.dm b/code/modules/xenoarcheaology/finds/talking.dm index 01af7f7a0e..33206366f4 100644 --- a/code/modules/xenoarcheaology/finds/talking.dm +++ b/code/modules/xenoarcheaology/finds/talking.dm @@ -34,7 +34,7 @@ else if(findtext(msg," ")==0) return else - /*var/l = lentext(msg) + /*var/l = length(msg) if(findtext(msg," ",l,l+1)==0) msg+=" "*/ seperate = splittext(msg, " ") @@ -79,12 +79,12 @@ text = "[pick(heard_words)]" else text = pick(splittext(word, " ")) - if(lentext(text)==1) + if(length(text)==1) text=uppertext(text) else var/cap = copytext(text,1,2) cap = uppertext(cap) - cap += copytext(text,2,lentext(text)+1) + cap += copytext(text,2,length(text)+1) text=cap var/q = 0 msg+=text