For Programmers: Free Programming Magazines  


Home > Archive > Clarion > July 2007 > ASCII File - Creating with new name at opening









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ASCII File - Creating with new name at opening
jim.herring@verizon.net

2007-06-24, 9:55 pm

We have to create unique ASCII files to send via e-mail to various
customers.

I have declared an ascii file in my database with a string of 200 and
a defined data group for the particular file. How can I assign a
variable name at open time and close it in such a way as to remove the
old and create the new??????

I want to create the new file with the customer ID and delete the old
file. How ?? How??

Steffen

2007-06-25, 7:55 am

Jim,

You can use the command "Rename" to change the file name you have
created. See help for details

Suggested reading from ClarionMag is Konrad Byers two articles:

1. A Class for ASCIIng http://www.clarionmag.com/cmag/v4/v4n11anyascii.html
2. ASCIIing for Moore http://www.clarionmag.com/cmag/v5/v5n04ascii2.html

They are well worth reading.

Steffen

On 25 Jun., 00:25, "jim.herr...@verizon.net" <jim.herr...@verizon.net>
wrote:
> We have to create unique ASCII files to send via e-mail to various
> customers.
>
> I have declared an ascii file in my database with a string of 200 and
> a defined data group for the particular file. How can I assign a
> variable name at open time and close it in such a way as to remove the
> old and create the new??????
>
> I want to create the new file with the customer ID and delete the old
> file. How ?? How??



wolfgang

2007-07-04, 9:55 pm

On Jun 25, 12:25 am, "jim.herr...@verizon.net"
<jim.herr...@verizon.net> wrote:
> We have to create unique ASCII files to send via e-mail to various
> customers.
>
> I have declared an ascii file in my database with a string of 200 and
> a defined data group for the particular file. How can I assign a
> variable name at open time and close it in such a way as to remove the
> old and create the new??????
>
> I want to create the new file with the customer ID and delete the old
> file. How ?? How??



Jim,

I hope I did not mis-understand.

Your ASCII-file is defined in the Dictionary?

CustomerFile PRE(CUS) DRIVER(ASCII)

If so, you can put a variable-name with a leading exclamation mark in
the entry filed "Full Pathname".

!GLO:VariableFilename


In your program you assign Before Open Files

GLO:VariableFilename = '2007-07-04_Smith.TXT'

Now you can make all file access as usual

CUS:Textline = 'yadda yadda'
ADD(CustomerFile)

Now you have added one line to a textfile 2007-07-04_Smith.TXT

.... if I did not get you wrong

hth
Wolfgang

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com