"""""""""""""""""""""""
How do i change a variable/item of a list to add punctuation, in my project Chatroom X 1.0
"""""""""""""""""""""""
eg.something like this
"""""""""""""""""""""""
//punctuation is (.) , (?) And (!) in this case when gf clicked set [word v] to [] forever ask [Type a sentence in here.] and wait set [word v] to (answer) if<<not<[punctuation v] contains (letter (length of (word)) of (word))>>>//if punctuation doesn't contain letter <length of word> of word .This checks if the last letter is a . , ? Or ! set [word v] to (join (word) [.])//can be any other end punctuation mark end //note! I've tried this and it doesn't work please help me.
Last edited by Ideas (2012-11-20 08:36:57)
Offline
I would try:
if <not <(letter (length of (word)) of (word)) = [.]>> set [word v] to (join (word) [.])And put an 'or' block after it to check for [!] and [?] too.
Last edited by Prestige (2012-11-19 13:30:26)
Offline
Ideas wrote:
"""""""""""""""""""""""
How do i change a variable/item of a list to add punctuation, in my project Chatroom X 1.0
"""""""""""""""""""""""
eg.something like this
"""""""""""""""""""""""//punctuation is (.) , (?) And (!) in this case when gf clicked set [word v] to [] forever ask [Type a sentence in here.] and wait set [word v] to (answer) if<<not<[punctuation v] contains (letter (length of (word)) of (word))>>> set [word v] to (join (word) [.])//can be any other end punctuation mark end do something with the word
Fixed. It should work, as long as the list "punctuation" actually DOES have all the punctuation you need to check.
if you gave us a project link it might help.
Offline
Well, for the "i" turns into "I" example, or anything else involving a letter being edited, you could scan the sentence. For instance, with the "I" example:
set [words1 v] to [] set [on v] to (1) repeat (length of (word)) if <<(letter (on) of (word)) = (i)> and <(letter ((on) + (1)) of (word)) = [ ]>> //a space set [on1 v] to (0) repeat (on) change [on1 v] by (1) set [words1 v] to (join (words1) (letter (on1) of (words))) end set [words1 v] to (join (words1) [i]) end end set [words v] to (words1)This should work. It looks at each letter of the sentence to see if it's "i". Hope it helps!
Offline