Re: Packet definition variable length list on output
"Joe Pham" <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <[email protected]> |
>The Samsung N200 phonebook read and write commands (AT#PBOKR/W) are
>variable length, depending on the number of phone number types that
>are in use. Is there a way for for the class (CSVSTRING) to know
>that it is the last item in a packet definition so that it can not
>write a "," terminator?
Assuming you know that it's the last one (while building the object), one approach could be:
* LIST {'createdefault': True} +numbers:
P BOOL { 'default': false } last_number
* CSVINT +numbertype
if self.last_number:
* CSVSTRING {'quotechar': None, 'default': "", 'terminator': None } +number
if not self.last_number:
* CSVSTRING {'quotechar': None, 'default': ""} +number
-Joe Pham
______________________________________________________________________
NetZero Is Giving Away $3,000 A Day!
Sign up for NetZero HiSpeed 3G with Instant On!
Visit http://www.netzero.com/3Gsweeps TODAY for your chance to win!
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php