1. Please supply subjects !!!

On Tue, 15 Apr 1997 04:20:46 GMT Mike Fowler <stoner at NELSUN.GEN.NZ>
writes:

SORRY no time to CUT
>
>hi all
>
>im having a bit of trouble...
>
>i am writing a programme that has mouse buttons in it, and the x and y
>co-ord's of the buttons are stored in the sequence mb like:
>
>mb = append(mb, {x1, y1, x2, y2, "button_name", button_signature}
>
>so when the user clicks the mouse, it quickly searches to see if that
>mouse click was in the area specified in mb[1] (or mb[whatever])
>
>that's all okay, BUT... if I try:
>
>mb = {}
>
>i get an error and it wont do it. Any ideas??
>
>Thanks :)
>
>Mike Fowler - mike.fowler at nelsun.gen.nz


Suggestion.  {} is a zero length sequence.
if
mb = {}
then
? mb[1]
will give an error of subscript out of bounds in sequence

Your check routine should be built similiar to the following.

if length(mb) > 0 then
  If mb[1] then
    do something using mb[1]
    and so on....
  end if
end if

ENJOY !!!

--Lucius Lamar Hilley III
--  E-mail at luciuslhilleyiii at juno.com
--  I support transferring of files less than 60K.
--  I can Decode both UU and Base64 format.

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu