Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I know nothing of Delphi, but it looks to me like this might be a bug. At least, if array indexes start at zero by default 'according to the little lookups on the web I did, tht is the case), and you don't insist on keeping the first character no matter what.
    while (SPos > 0) and (Str[SPos] = ' ')
    I think the ">" must be ">=". Otherwise, you'd never test, or remove, the very first character.
    • Well actually, that snippet came from Bob Swart aka Dr. Bob. I eventually went for a routine that deleted everything after the first occurance of a space. Not really exactly what I needed but it'll do for the data I'm using it on.
    • Couldn't help replying this one.
      But whats wrong with the Delphi implemented TrimRight() function:

      > MyString TrimRight(MyString)

      Of course I admit that Perl is better at Text processing. But, opposed to Perl, Delphi intended as a Language to make the creation of Windows, event driven GUI's easy.
      Not to make it easy to transform one bunch of ASCII-characters into another bunch of ASCII-characters.
      • When using another programming language, I constantly get the "This is MUCH easier in perl" feeling. I'm not quite sure why but it even happens with languages I know... Delphi is one of them. I'm lucky I got out of the project alive :)