home *** CD-ROM | disk | FTP | other *** search
- * Function name : SUBSET() && for Clipper only
- *
- * Author : Dirk Lesko
- *
- * Syntax : if subset(<expC>,<expC>)
- *
- * Parameters : <expC> character string or memory variable
- * : <expC> character string or memory variable
- *
- * Purpose : To find out if all characters in the first string
- * : are present in the second string in any order.
- *
- * Returns : logical .T. if all characters in first string
- * : are found in second string in any order. Otherwise
- * : returns .F.
- *
- * Notes : Does not convert parameters to uppercase, and does
- * : not trim() parameters. Use trim if you do not want
- * : trailing blanks included in the check.
- *
- * Example : m_var1 = " "
- * : m_var2 = "AaBbCcEeHhJjKkXxZz"
- * : @ 10,0 say "Enter three letters:" get m_var1
- * : read
- * :
- * : if .not. subset(m_var1,m_var2)
- * : @ 12,0 say "Invalid letter entered...."
- * : else
- * : @ 12,0 say "All letters are OK!....."
- * : endif
-
- func subset
- para dl_var,dl_str
- priv dl_cnt,dl_len
-
- dl_cnt = 1
- dl_len = len(dl_var)
-
- do whil dl_cnt <= dl_len
-
- if subs("&dl_var",dl_cnt,1) $"&dl_str"
- retu(.T.)
- endi
-
- dl_cnt = dl_cnt+1
-
- endd
-
- retu(.F.)