kirill.emko Posted November 2, 2008 Author Share Posted November 2, 2008 Hello. I'm just a begginer in scripting and i have 1 question. Could somebody explain what this two subjects mean. Not they all, but operators Lcase and mid in thise line:If LCase(Mid(textsay, 1, 3)) = "/g " Thenand operator trim and Mid here:TextSay = trim(Mid(TextSay, 3, Len(TextSay) - 2))thise code fragments are from here: http://www.touchofdeathforums.com/smf/index.php?topic=27767.0I searched all forum but couldn't find any information on this.thanks before. Link to comment Share on other sites More sharing options...
shadowwulf Posted November 3, 2008 Share Posted November 3, 2008 Lcase will force the string to be lowercase…so if you types /G or /g it will still work and you dont have to code the whole thing twice.Trim I beleive will create something if it doesnt already exist... i think, may be wrong there.Mid, no clue. Link to comment Share on other sites More sharing options...
Skieth Posted November 3, 2008 Share Posted November 3, 2008 @FS:CG :> link=topic=33355.msg305913#msg305913 date=1225675201]> Lcase will force the string to be lowercase…> so if you types /G or /g it will still work and you dont have to code the whole thing twice.> > Trim I beleive will create something if it doesnt already exist... i think, may be wrong there.> > Mid, no clue.lcase, righttrim wrong.trim makes this: hi guys how are youinto this: higuyshowareyoudon't remember mid Link to comment Share on other sites More sharing options...
shadowwulf Posted November 3, 2008 Share Posted November 3, 2008 yeah, i said i might be wrong… i have only really noticed lcase and trim and have only used lcase. Link to comment Share on other sites More sharing options...
DarkMazer Posted November 3, 2008 Share Posted November 3, 2008 I see LCase and Trim have already been covered, so I'll finish up with Mid.Mid returns a substring of, or part of the string, you put into it (presumably the middle [hence the name], but it's whatever you tell it to), and works like this:Mid(text, start, length)Text is the text you want to parse (basically, modify), start is the character that you want to start returning the substring from, and length is the length of the substring it returns. Examples:Mid("I want an apple", 11, 5) will return "apple". Mid("Example", 3, 2) will return "am". Mid(TextSay, 7, Len(TextSay) - 6) will return everything from the 9th character of TextSay to the end. If TextSay was "/jail randomnoob", it'll return "randomnoob". Anyways, if it interests you, the reason you couldn't find the answer to these questions in other places on the forum is because these are functions that exist in VBScript and not just in SadScript. Link to comment Share on other sites More sharing options...
kirill.emko Posted November 3, 2008 Author Share Posted November 3, 2008 thank you boys. It's realy clear Link to comment Share on other sites More sharing options...
DrNova Posted November 5, 2008 Share Posted November 5, 2008 Trim doesnt remove spaces, it just allows spaces, doesnt it?Like I use trim to put var's of text, Trim("This Data")And it puts it in the .ini asThis DataWith the space Link to comment Share on other sites More sharing options...
Anonymous Posted November 6, 2008 Share Posted November 6, 2008 Trim() removes spaces from the beginning and end.Trim(" this text ") becomes simply "this text"As a side note, the third parameter of Mid() is optional. Mid(TextSay, 7) returns the rest of the text after the 7th character. Link to comment Share on other sites More sharing options...
kirill.emko Posted November 6, 2008 Author Share Posted November 6, 2008 thanks. now it's too clear lol)) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now