/* (gH) -- ts.sedit ; TimeStamp (unix) : 02 Février 2005 vers 10:49 */ /* ts.sedit : (TimeStamp) "timbre de temps " */ /* met le nom du fichier, la date et l'heure en haut de fichier */ /* récupération des marges */ 'extract/margins/' marg1 = margins.1 marg2 = margins.2 marg3 = margins.3 /* extraction de l'identificateur du fichier */ 'extract /fname/' 'extract/ftype/' nomfich = fname.1||ftype.1 /* on met la date... */ parse value date(E) with jr '/' mois '/' an listemois = 'Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre' mois = word(listemois,mois) txt1 = " (gH) " txt2 = " ; TimeStamp (unix) :" jr mois "20"||an /* l'heure... */ txt2 = txt2 "vers" left(time(),5) /* ... et le nom du fichier */ fext = translate(Ftype.1) if fext = '.HTM' then txt = txt1 " -_- " nomfich txt2 else txt = txt1 " -_- " nomfich txt2 if fext = '.HTML' then txt = txt1 " -_- " nomfich txt2 else txt = txt1 " -_- " nomfich txt2 /* il reste à mettre le(s) symbole(s) de commentaire, */ if fext = '.ABR' then txt = '# '||txt if fext = '.AWK' then txt = '# '||txt if fext = '.BAT' then txt = 'rem '||txt if fext = '.CMD' then txt = '/* '||txt||' */' if fext = '.CSS' then txt = '/* '||txt||' */' if fext = '.JS' then txt = '// ' txt if fext = '.JAVA' then txt = '// ' txt if fext = '.HTM' then txt = '' if fext = '.HTML' then txt = '' if fext = '.KEX' then txt = '* '||txt if fext = '.PAS' then txt = '# '||txt if fext = '.PHP' then txt = '# ' txt if fext = '.PHP3' then txt = '' if fext = '.PL' then txt = '# '||txt if fext = '.PM' then txt = '# '||txt if fext = '.PRL' then txt = '# '||txt if fext = '.PRM' then txt = '# '||txt if fext = '.PY ' then txt = '# '||txt if fext = '.R' then txt = '# '||txt if fext = '.REX' then txt = '/* '||txt||' */' if fext = '.STY' then txt = '% '||txt if fext = '.MYSQL' then txt = '# '||txt if fext = '.SQL' then txt = '# '||txt if fext = '.TCL' then txt = '# '||txt if fext = '.TEX' then txt = '% '||txt if fext = '.TEY' then txt = '% '||txt if fext = '.TK' then txt = '# '||txt if fext = '.SEQ' then txt = '# '||txt if fext = '.DPD' then txt = '# '||txt if fext = '.SEDIT' then txt = '/* '||txt||' */' if fext = '.XML' then txt = '' /* à sauvegarder l'ancienne position courante */ 'extract/line/' oline = line.1 /* à recherche une éventuelle ancienne ligne de TimeStamp */ ':0' '/ TimeStamp ' 'extract/line/' nline = line.1 /* à insérer le texte au bon endroit, */ 'set margins 1 150 1' if nline=0 then oline = oline+1 if nline>0 then do ; 'delete' ; '-1' ; end 'I' txt /* à sauvegarder le fichier... */ 'ssave' /* à remettre les anciennes marges */ 'set marg ' marg1 marg2 marg3 /* et à se repositionner au bon endroit */ ':'oline /* et voilà ! */ 'msg'