use-revolution Digest, Vol 16, Issue 1

James Hurley jhurley at infostations.com
Sat Jan 1 10:43:52 EST 2005


>
>Message: 15
>Date: Sat, 1 Jan 2005 10:23:47 +1000
>From: "D.Rothe" <drothe at optusnet.com.au>
>Subject: Line Numbers
>To: <use-revolution at lists.runrev.com>
>Message-ID: <003901c4ef98$29bcc100$97f6a4cb at p4c2ghz>
>Content-Type: text/plain;	charset="iso-8859-1"
>
>G'Day and Happy New Year to all!!!!!!!!
>
>I am hoping someone could guide me with the following prob.
>I have two fields (field 1 & field 2), field 2 is for loading and 
>displaying a txt file and field 1
>is for displaying each corresponding line number of field 2.
>The line numbers must be in a seperate field otherwise they will 
>show when printing field 2.
>
>Obviously field 2 is a scrolling field so the problem is getting 
>field 1 to scroll in unison with field 2 so the line numbers match 
>the correct line.
>
>Any ideas on the code or maybe a different solution!!!!
>
>Thanx to all.....
>
>Cheers Dwayne...


Hi Dwayne,

If all you need to do is eliminate the line numbering in the printed 
text, you might just do this via script and then print the results. 
Put something like the following handler in a print button:

on mouseUP
   put field 1 into tData
   repeat for each line tLine in tData
     --Assuming the lines are numbered as follows:
     --1 This is the first line, including its number.
     --Or whatever you might choose.
     repeat
       put char 1 of tLine into tChar
       if tChar is a number or tChar is space then --or whatever
         delete char 1 of tLine
       else
         put tLine & return after results
         exit repeat
       end if
     end repeat
   end repeat
   revprinttext results
end mouseUP


Jim


More information about the use-livecode mailing list