November 23, 200619 yr Newbies I have a list of words that I need to manipulate in two different ways. In order to do what I need, it seems that I need wildcards, but i can't use them inside formulae, because FM just reads the wildcard characters as what they are, not as wildcards, in this instance. What I am trying to do is the following (where "?" is wildcard) IF (word ends with "e?") THEN (add "i" to end of word) IF (word ends with "o?") THEN (add "u" to end of word) IF (word ends with "a?") THEN (add "ı" end of word) etc For example: I want to change input "bet" to "beti" , but "bot" to "botu" , etc. Without wildcards, this is impossibly tedious. Any suggestions? -Zyakobu
November 23, 200619 yr As far as I can remember the ? as a wildcard represents one character. In that case does this work: If [ Right ( yourFile::theWord; 2) = "e" ] Set Field [ yourFile::theWord; yourFile::theWord & "i" ] Else If [ Right ( yourFile::theWord; 2) = "o" ] Set Field [ yourFile::theWord; yourFile::theWord & "u" ] Else If [ Right ( yourFile::theWord; 2) = "a" ] Sorry, can't get the post to retain the indentation, Norman Set Field [ yourFile::theWord; yourFile::theWord & "i" ] End If
November 23, 200619 yr If [ Right ( yourFile::theWord; 2) = "e" ] I am afraid the only time that condition is going to return true is when theWord itself is "e". Zyakobu: There are no wildcards in a calculation, but they are not needed. Since you only care about the character before last, you can address it directly, ignoring everything else: Let ( [ pos = Length ( word ) - 1 ; char = Middle ( word ; pos ; 1 ) ; add = Case ( char = "e" ; "i" ; char = "o" ; "u" ; char = "a" ; "ı" ) ] ; word & add )
Create an account or sign in to comment