Paul Archer said:
> (As I noted in an earlier post) I'm writing a handler for an LCD display
> (a
> BPP-440 from Scott Edwards (www.seetron.com)). The display is 4 lines x 40
> characters, and has direct cursor positioning.
> I'm going to store the data for several virtual screens, but I don't know
> whether it would be better (in terms of speed and writing/maintaining the
> code) to use an array with 160 elements (one for each character), or a
> single scalar with 160 characters.
> It seems to me that if I use a scalar I can use perl's string manipulation
> tools, and if I use arrays I can use slices--but I have no idea if one is
> going to have any significant advantages/disadvantages over the other.
> Any suggestions?

You can use substr on strings in a similar fashion to splice on arrays.

You might also want to consider using an array of four 40 character
strings, especially if you can position the cursor using (x, y)
coordinates.  I have written Perl code to simulate a display using just
this technique.  (A translator from LifeLines report language into Perl,
available as Gedcom.pm on CPAN, but I wouldn't think it will give you any
useful help.)

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to