Is there a way to convert the Business Card Repeat example to not write a
temp file (...\\tempout.txt) and not be linked to an external data file
(...\\Test.txt) ? This is an ongoing job & I am trying to get away from
changing the rule every time. I would like it just to be linked to a
field. (official = Int(sf.GetFieldValue(i, "official"));) Any help would
be greatly appreciated.
Jim
newfilename = FusionPro.Composition.inputFileName;
orginputfilename = newfilename;
var i;
if(newfilename == "")
{
newfilename = "C:\\Documents and Settings\\PC #4\\Desktop\\Jim
Test\\output test\\pennington\\temp_data_file.txt";
}
partial = newfilename.lastIndexOf("\\");
newfilename = newfilename.substring(0, partial+1) + "tempout.txt";
if (orginputfilename=="")
{
orginputfilename = "C:\\Documents and Settings\\PC #4\\Desktop\\Jim
Test\\output test ballots\\pennington\\Test.txt";
}
sf = new ExternalDataFile(orginputfilename, "\t");
var of = new File(newfilename);
if (of.open("create") == false)
{
print("Could not write output file.");
}
of.close();
if (of.open("write") == false)
{
print("Could not write output file.");
}
for (i=0;i<sf.records[0].length;i++)
{
if (i>0)
of.write("\t");
of.write(sf.records[0][i]);
}
of.write("\r\n");
for (i=0;i<sf.records.length;i++)
{
startval = 1;
official = Int(sf.GetFieldValue(i, "official"));
for(j=0;j<official;j++)
{
for(k=0;k<sf.records[0].length;k++)
{
if (sf.records[i][sf.records[0].length-1] != "undefined")
{
if (k>0)
of.write("\t");
switch(sf.records[0][k])
{
case "official":
of.write("1");
break;
default:
of.write(sf.records[i][k]);
}
}
}
of.write("\r\n");
}
}
of.close();
FusionPro.Composition.inputFileName = newfilename;
return sf.records.length;
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Calling all FP Web Users!
Do you have a question or lots of knowledge to share about FusionPro Web?
If so, join our Printable Web to Print Users' Forum today!
Send email to [EMAIL PROTECTED] to find out how!
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
--
Users of FusionPro Desktop have unlimited free email support. Contact Printable
Support at [EMAIL PROTECTED]
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm
--
You are currently subscribed to fusionpro as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--
--
Note: All e-mail sent to or from this address will be received or otherwise
recorded by the e-mail recipients of this forum. It is subject to archival,
monitoring or review by, and/or disclosure to someone other than the recipient.
Our privacy policy is posted on www.printplanet.com
--