mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
replace obsolete proc
This commit is contained in:
@@ -152,7 +152,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
|
||||
@@ -165,12 +165,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
|
||||
|
||||
@@ -199,7 +199,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)
|
||||
@@ -264,9 +264,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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user