> --for adding more word to the database -- THIS IS THE
> PROBLEM
> global database, definision
> on AddWords newword
> newword = symbol(member("entry").text
> definision = string(member("meaning").text
> Append (database,newword,definision)
> end

Hi, 
2 Problems here -- 

> Append (database,newword,definision)
'Append' is used to add entries to the end of a linear list. You should
change this to 
  addProp(database,newword,definision)

> newword = symbol(member("entry").text
if the user has entered 2 words or a word starting with a 'breaking'
character (such as a hyphen), then the symbol will be quite different. So
you have 3 choices

 1. Still use symbols (which are faster than using strings as properties in
a property list), but check the text before converting it to a symbol
(removing any quote characters, replacing spaces with underscore etc)

 2. Use strings as properties. Note however that strings are case sensitive
when used as properties in property lists (so searching for "cat" will not
find "Cat"). If you don't want the searches to be case sensitive, then you
could convert the strings to uppercase when you add them, then change the
user's input to uppercase to do the search. You can force characters to
uppercase like this

on forceUppercase pStr
  returnStr = ""
  n = length(pStr)
  repeat with i = 1 to n
    thisCharNum = charToNum(pStr.char[i])
    if thisCharNum = min(max(97, thisCharNum), 122) then
      thisCharNum = thisCharNum - 32
    end if
    returnStr = returnStr & numTOChar (thisCharNum)
  end repeat
  return returnStr
end 

3. User two linear lists of strings - one list for terms, the other for
definition. If you find a match in position 3 of the term list, the return
the definition found in position 3 of the definition list.




Luke Wigley
Multimedia Director/Producer
Mecca Medialight Pty Ltd

Mecca Medialight:                       Medialight Sound Studio:
111 Moor Street                         1 Bakehouse Lane
Fitzroy, Vic. 3065                      North Fitzroy, Vic. 3068
Tel +613 9416 2033                      Tel +613 9416 2033
Fax +613 9416 2055                      Fax +613 9416 2055

www.medialight.com.au
__________________________________________________________________________



[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to