I am trying to get this to grab data from 1 column & when that is done
grab data from another column, then 1 more column.

I do not want to have the data file called out in the rule, I would like
it to grab the data from the Data Def Wiz.

I am not sure how to change the rule to grab from the fields "FIELD_o",
"FIELD_s", "FIELD_a" instead of "newfilename =
FusionPro.Composition.inputFileName;"

I have tried many different configurations and have not been able to come
up with a solution.  "The Powers That Be" are pushing pretty hard for
this.  I know I am in WAY over my head.

Jim

//newfilename = FusionPro.Composition.inputFileName;
newfilename = Field("b_style");

//Field("b_style")

orginputfilename = newfilename;
var i;

// The following line is only needed during validation & preview
        if(newfilename == "") 
        {
           newfilename = "C:\\Documents and Settings\\PC #4\\Desktop\\Jim
Test\\output

test\\pennington\\temp_data_file.txt";
        }

// Find last backslash in file name & replace with other.
        partial = newfilename.lastIndexOf("\\");
        newfilename = newfilename.substring(0, partial+1) + "tempout.txt";

// The following line is only needed during validation & preview
        if (orginputfilename=="")
        {
           orginputfilename = "C:\\Documents and Settings\\PC #4\\Desktop\\Jim 

Test\\output test\\pennington\\Test.txt";
        }

sf = new ExternalDataFile(orginputfilename, "\t");
var of = new File(newfilename);

//of.remove();

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");

//of.write("Service Advisor,Start Tag Number,Number of Tags,Service
Advisor

Picture,Service Advisor Oval Graphic\r\n");
for (i=0;i<sf.records.length;i++)
{
  //startval = Int(sf.GetFieldValue(i, "NUMBERING FROM"));
  startval = 1;

   FIELD_o = Int(sf.GetFieldValue(i, "FIELD_o"));

////////////////////////////    Added following 2 lines   
///////////////////////////

   FIELD_s = Int(sf.GetFieldValue(i, "FIELD_s"));
   FIELD_a = Int(sf.GetFieldValue(i, "FIELD_a"));

////////////////////////////    FIELD_o   
//////////////////////////////////////////

  for(j=0;j<FIELD_o;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 "NUMBERING FROM":
            //of.write((startval+j));
             //break;

          case "FIELD_o":
             of.write("1");
             break;

          default:
             of.write(sf.records[i][k]);
        }
      }
    }
    of.write("\r\n");
  }

////////////////////////////    FIELD_s   
///////////////////////////////////////////

  for(j=0;j<FIELD_s;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 "NUMBERING FROM":
            //of.write((startval+j));
             //break;

          case "FIELD_s":
             of.write("1");
             break;

          default:
             of.write(sf.records[i][k]);
        }
      }
    }
    of.write("\r\n");
  }

////////////////////////////    FIELD_a   
//////////////////////////////////////////

  for(j=0;j<FIELD_a;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 "NUMBERING FROM":
            //of.write((startval+j));
             //break;

          case "FIELD_a":
             of.write("1");
             break;

          default:
             of.write(sf.records[i][k]);
        }
      }
    }
    of.write("\r\n");
  }

////////////////////////////    End of changes   
////////////////////////////////////

}
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
--

Reply via email to