 |
THE HYPERCARD CENTER |
|
|
Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.
offsetoffset(text1, text2)
Value returned: the number 0 if text1 does not appear in text2 ; otherwise, a positive integer equal to the number of characters from the first character of text2 to the first character of text1 within text2 Examplesget offset("world", "Hello world") put offset(searchString,card field "Index") into theOffset put offset(line 1 of card field 1, collectedHits) into N if N is 0 then ... else ...
Demo Scripton answerDiskName answer "This stack resides on the disk named" && diskName() & "." end answerDiskName function diskName thelongName if thelongName is empty then put the long name of this stack into theLongName -- remove “stack "” from the beginning of theLongName delete char 1 to offset(quote,theLongName) of theLongName -- return word before the first “:” return char 1 to offset(":",theLongName) - 1 of theLongName end diskName
Related Topics Placeholders
HyperTalk Reference
|