use-revolution Digest, Vol 4, Issue 211

Cubist at aol.com Cubist at aol.com
Sun Feb 1 05:49:21 EST 2004


In a message dated 1/31/04 11:16:03 PM, 
use-revolution-request at lists.runrev.com writes:

>
>Date: Sat, 31 Jan 2004 15:39:12 -0800
>From: Robert Presender <rpresender at earthlink.net>
>Subject: Re:List field behavior
>To: use-revolution at lists.runrev.com
>Message-ID: <AC7E0B51-5446-11D8-AB6E-000393A19046 at earthlink.net>
>Content-Type: text/plain; charset=US-ASCII; format=flowed
>
>Rob,
>
>On Saturday, January 31, 2004, at 03:04  PM, Rob Cozens wrote:
>
>> Bob,
>>
>> Is this the effect you are looking for:
>>
>>  delete line 2 of field [fieldName]
>>  wait 1 second -- to see deletion
>>  put "New line 2" & return before line 2 of field [fieldName]
>>
>No. This just adds a blank line in line 3 of 4. My problem is that I 
>want line 3 to take the place of line 2 and result in only two lines. 
>I don't want to add text to the deleted line.  I use a count syntax to
>add a new line after the existing lines in my SC version.
>In my SC app, when a line is deleted the lines below move up to the 
>deleted space.
   On my machine, the command "delete line Whatever" behaves the way you want 
it to; I have no idea why it's not working for you. But that isn't very 
helpful, so here's an alternative which should hopefully do the trick...

on NukeLine DerFld, LineNum
  if there is not a field DerFld then
    answer "There is no field named '" & DerFld & "'."
    exit NukeLine
  end if
  if LineNum is not a number then
    answer "A field cannot have a line number '" & LineNum & "'."
    exit NukeLine
  end if
  if LineNum is not an integer then put trunc (LineNum) into LineNum
  if LineNum < 1 then put 1 into LineNum
  put the number of lines in field DerFld into MaxLinez
  if LineNum => MaxLinez then
    put (MaxLinez - 1) into Begyn
    put MaxLinez into Ende
  else
    put LineNum into Begyn
    put (LineNum + 1) into Ende
  end if
    put line Ende of field DerFld into line Begyn to Ende of field DerFld
  end NukeLine

   The final line of the hander is the actual suggestion; everything that 
precedes it is just idiot-proofing.
   Hope this helps...


More information about the use-livecode mailing list