Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

filename

 [1/5] from: john:thousand-hills at: 19-Aug-2001 18:27


Simple -I'm sure? I am using this script to name a file with a modified epoch (shortened ) number, simply to make it unique. I would like that name to have a " .html " extension -can anyone help? Code: number: fn-epoch now name: number - 998100000 filename: to-file name name2 print filename End Code:

 [2/5] from: tim:johnsons-web at: 19-Aug-2001 16:57


On Sun, Aug 19, 2001 at 06:27:09PM -0500, john wrote:
> Simple -I'm sure? > > I am using this script to name a file with a modified epoch (shortened ) > number, simply to make it unique. > > I would like that name to have a " .html " extension -can anyone help?
Hi john
> Code: > > number: fn-epoch now > name: number - 998100000 > ;filename: to-file name name2
filename: to-file join name ".html" or file-name: to-file rejoin[name ".html"]
> print filename > > End Code:
Is this what you're looking for? hint: at rebol prompt help join help rejoin
> -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [3/5] from: ljurado:bariloche:ar at: 19-Aug-2001 21:52


number: 998100123 name: to-string number - 998100000 name2: ".html" filename: to-file join name name2 print filename ----- Mensaje original ----- De: john <[john--thousand-hills--net]> Para: <[rebol-list--rebol--com]> Enviado: Domingo 19 de Agosto de 2001 08:27 PM Asunto: [REBOL] filename

 [4/5] from: john:thousand-hills at: 19-Aug-2001 20:11


Tim, Luis: Thanks.. Here is the whole code that assigns a epoch date, shortens it and names a unique file on the fly. I can specify a file name with the word " filename " and a matching Purchase Order Number with the word " name "... Code: fn-epoch: func [ip-date [date!]] [ lv-days: ip-date/date - 01-Jan-1970 return (lv-days * 86400) + (ip-date/time/hour * 3600) + (ip-date/time/minute * 60) + ip- date/time/second ] number: fn-epoch now name: number - 998100000 filename: to-file rejoin[name ".html"] End code: Now, if I can only get Outlook to read it as an HTML file to the screen.. John At 09:52 PM 8/19/2001 -0300, you wrote:

 [5/5] from: tim::johnsons-web::com at: 19-Aug-2001 19:59


On Sun, Aug 19, 2001 at 08:11:00PM -0500, john wrote: <snip....>
> Now, if I can only get Outlook to read it as an HTML file to the screen..
Hey John: It sounds like the hurdle left is to format this so that Outlook "thinks" your target file is HTML. Well, then the trick should be to read the file as a block file-block: read/lines filename ; untested code, assuming that 'filename is of type file! ;insert the appropriate html header, will be something like: html-header: "<html><head><Title>John's message</title></head><body><pre>" insert head file-block html-header ;append the appropriate footer, again, untested code! html-footer: "</pre></body></html>" append file-block html-footer ; then write the file out as such and again untested code! write/lines filename file-block Let me know if that approach will work. My disclaimer is that I'm not as familiar with rebol as many who contribute to this list and I don't know "beans" about Outlook! -- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com