Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
local testofinale
local ntotale
on mouseUp
delOneWord
end mouseUp
on delOneWord
put the num of chars of field "result" into ntotale
FIND "NEXT"
put THE FOUNDTEXT INTO testoinizio
put wordoffset(testoinizio,fld"result") into testoinizio
delete word 1 to testoinizio of fld "RESULT"
find"Results"
put THE FOUNDTEXT INTO testofinale
put wordoffset(testofinale,fld"result") into testofinale
delete word testofinale to ntotale of fld "RESULT"
put fld"result" into fld "giocare"
end delOneWord
...
on delOneWord
## See below!
## put the num of chars of field "result" into ntotale
put the num of WORDS of field "result" into ntotale
## FIND "NEXT"
## put THE FOUNDTEXT INTO testoinizio
## THE FOUNDTEXT/testoinizio will contain... TADA -> NEXT
## So this does not make any sense! :-D
## So we just do:
put wordoffset("NEXT",fld "result") into testoinizio
delete word 1 to testoinizio of fld "RESULT"
## SAME HERE!
## find"Results"
## put THE FOUNDTEXT INTO testofinale
put wordoffset("Results",fld "result") into testofinale
## ntotale will hold the number of CHARACTERS in that field
## But we need the number of WORDS in that field for the next line!
delete word testofinale to ntotale of fld "RESULT"
put fld "result" into fld "giocare"
end delOneWord
dunbarx wrote: Fri May 28, 2021 2:42 pm
Is "cut" in your working dictionary? If so, just a simple omission. But either one of "cut" or "delete" ought to me a synonym of the other. "Delete" was a Hypercard native word, so I think "cut" should not have its own place, unless it does other things that delete does not.
"Cut" is in my copy of the 9.6.2 dictionary, it's the first hit when searching for "cut".
Cut and delete are different things. Cut not only removes the text or object, it also places it into the clipboard. Delete does not affect the clipboard. Cut is frequently used in an Edit menu switch statement.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com