Help with Conversion Function (Using Recursion)
- Posted by "C. K. Lester" <cklester at yahoo.com> Jan 29, 2002
- 436 views
Help! I'm trying to make a DIK2ASCII function so I can display keystrokes entered by the user when the program uses ExoticaX. (Why there isn't a function like this already is puzzling...) Anyway, here's the code. I need help with the function, although I really don't expect to feed anything too complicated into it... mainly atoms and strings. Thanks!!! P.S. I've not included the constants data because there's so much of it... the general need is to look for a matching atom in element one of the sequence and return element three of that sequence. I'm thinking it needs to be recursive in case of imbedded sequences...? --------------------------------------- --------------------CODE STARTS HERE--- --------------------------------------- global constant DIK_MODS = { { {} , {} , {} }, { {} , {} , {} } }, DIK_ASCII = { { { {} , {} , {} }, { {} , {} , {} } } global function DIK2ASCII(object x) object retSet if atom(x) then for t=1 to length(DIK_ASCII) do if DIK_ASCII[t][1] = x then retSet = DIK_ASCII[t][3] exit end if next else -- I DON'T KNOW! :) end if return retSet end function