delete last card problems

Robert Brenstein rjb at robelko.com
Sun May 22 15:19:06 EDT 2005


>Hi All
>
>I haev a database with a group of fields on it. I have a  delete 
>card button with the script
>on mouseup
>delete card
>end mouseup
>
>This works perfectly with one exception. If I delete all cards down 
>to the last card I still see my database template. If however, I 
>delete the last card I dont see my group of fields.
>
>So I'd like to do something like this
>Have a delete card button that will delete a card unless it is the 
>last one, and if it is the last card only clear the fields
>
>I thought of
>on mouseup
>if this card is not cd 1
>then delete this card
>end if
>if this cd is cd 1
>then clear all fields
>end if
>end mouseup
>
>I get an error with this.....
>
>Any ideas along this line?
>
>cheers
>bob
>

if the number of cds > 1 then
   delete this cd
else
   repeat with i=1 to the number of flds
     put empty into fld i
   end repeat
end if

Robert


More information about the use-livecode mailing list