TempleOSTS_130315.ISO
This commit is contained in:
1 parent
e57428affb
commit
17b71f1a2d
958 files changed
+26043
-15907
No files matched your search
@@ -0,0 +1,64 @@
|
||||
U8 char_map[26]="22233344455566677778889999";
|
||||
|
||||
|
||||
/*
|
||||
Fmt of word lst entry:
|
||||
U8 WSD_WORD_CHAR
|
||||
U8 word[] with terminating zero
|
||||
I16 block; //definition offset in ::/TempleOS/Adam/WordStat/WSDefs.DAT
|
||||
*/
|
||||
U0 PhoneNumWords(U8 *num)
|
||||
{
|
||||
U8 ch,*_num=StrNew(num),*dst=_num,
|
||||
*dict=ws_dict_word_lst,*st,*src;
|
||||
while (*num) {
|
||||
if ('0'<=*num<='9')
|
||||
*dst++=*num;
|
||||
num++;
|
||||
}
|
||||
*dst=0;
|
||||
|
||||
while (*dict++) {
|
||||
if (StrLen(dict)>2) {
|
||||
dst=st=StrNew(dict);
|
||||
while (ch=ToUpper(*dst)) {
|
||||
if ('A'<=ch<='Z')
|
||||
*dst=char_map[ch-'A'];
|
||||
else
|
||||
*dst=CH_SPACE;
|
||||
dst++;
|
||||
}
|
||||
*dst=0;
|
||||
|
||||
src=_num;
|
||||
while (*src) {
|
||||
if (!StrNCmp(st,src,StrLen(st))) {
|
||||
ch=*src;
|
||||
*src=0;
|
||||
"" _num;
|
||||
*src=ch;
|
||||
"$$FG,GREEN$$%s$$FG$$",dict;
|
||||
"" src+StrLen(st);
|
||||
NewLine;
|
||||
}
|
||||
src++;
|
||||
}
|
||||
Free(st);
|
||||
}
|
||||
dict+=StrLen(dict)+3;
|
||||
}
|
||||
Free(_num);
|
||||
NewLine;
|
||||
}
|
||||
|
||||
U0 PNWDemo()
|
||||
{
|
||||
U8 *st;
|
||||
while ((st=PmtStr("Phone Num:")) && *st) {
|
||||
PhoneNumWords(st);
|
||||
Free(st);
|
||||
}
|
||||
Free(st);
|
||||
}
|
||||
|
||||
PNWDemo;
|
||||
Reference in new issue
Block a user