[fpc-pascal] Record helpers on built in types?
sysrpl at gmail.com
Thu Feb 19 20:45:57 CET 2015
Okay, no problems Sven. Thanks again for doing what you've done. I feel
like the class helpers on built ins is so great already. By the way, after
adding in some I decided to write an FTP client implementation using
StringHelper to great effect. Here's how it worked out (and fully tested):
When you remove the comments it's probably around only 500 lines and was
easy to implement thanks to helper methods like Contains, Between, Split,
Example from PASV command:
'227 Entering Passive Mode (157,28,148,37,129,44)'
Becomes (at line 430):
Values := S.Between('(', ')').SplitInt(','); // Values now is array of 6
Example from LIST command:
'lrwxrwxrwx 1 0 0 3 Jul 02 2013 public -> pub'
Becomes (at line 637):
Columns := S.Words(9); // Columns is now an array of 9 trimmed strings
It's so easy now!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal