home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 April / PCWorld_2005-04_cd.bin / software / temacd / godfather / TGF_069.exe / $INSTDIR / Scripts / Simple.scu < prev    next >
Encoding:
Text File  |  2005-02-06  |  1.1 KB  |  43 lines

  1. {!%A:1|%A|(%Y) %L}
  2.  
  3. // the first line contains the folder structure and is dynamically used upon script execution
  4. // it is optional, if not defined the standard 'sub folder details' will be used
  5.  
  6. {
  7.  the system functions can be used here as well
  8.  
  9.  //inits things and optionally calculates the count of files per created folder ( a bit slower )
  10.  procedure re_Init( const bGetCount: boolean );
  11.  
  12.  function re_Skip: boolean; // moves to the next file if any
  13.  function re_getLevel( const iLevel: integer ): string; //get the level value
  14.  procedure re_setLevel( const iLevel: integer; const sValue: string ); //set the level value
  15.  
  16.  procedure re_removeLevel( const iLevel: integer ); // removes a level
  17.  procedure re_addLevel( const sValue: string ); // adds a level dynamically
  18.  
  19. }
  20.  
  21. program Simple_the_removal;
  22.  
  23.  
  24. var
  25.   sTmp: string;
  26.  
  27. begin
  28.  
  29.   re_Init( false );
  30.  
  31.   repeat
  32.  
  33.      sTmp := re_getLevel( 2 );
  34.      if UpperCase( Copy( sTmp, 1, 4 ) ) = 'THE ' then begin // remove 'the'
  35.         re_setLevel( 1, Copy( sTmp, 5, 1 ) );
  36.         re_setLevel( 2, Copy( sTmp, 5, 9999 ) );
  37.      end;
  38.  
  39.   until not re_Skip;
  40.  
  41.  
  42. end.
  43.