fpgroups.com: A correction/revision to mkcsv and mkhtml

fp at casabellagallery.com fp at casabellagallery.com
Mon Sep 3 15:54:49 PDT 2007


Well, I found myself needing to export a number of fields from filePro to MySQL.  To do this, I normally create a CSV file and use MyPHPAdmin utilities to import the CSV file directly into the table where data is needed.

I smiled when I thought to myself, I already have the program to pick the fields I need and in the order I need them ... That was nice!

Less than a minute later I realized I had a glitch.  The created file had wrong content.  I was able to quickly and easily identified the root cause.  My initial tests have worked because I picked fields in straight sequence, but today, I picked fields in random sequence and the resulting file was not as expected.

Additionally, I wanted to have a visual of what fields I had picked out of the list box.  I tried removing the field but I did not like that ... so, I opted for adding a prefix to the list box denoting the numerical order in which the field was chosen.

Here are the changes to mkcsv (try figuring the same changes for mkhtml):

1) Lines 18 through 20 should now look like this (notice that I inserted a line):
 18  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ? If:                                                                   ?
       Then: yy(1,*)="X" ; fnames(ya)=fldx(ye); fnumber(ya)=ye                 ?
 19  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ? If:                                                                   ?
       Then:  fldx(ye)="("{ya{")"<fldx(ye)                                     ?
 20  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ? If:                                                                   ?
       Then: ya=ya+"1"; goto BOXLIST             

2) Lines 26 through 29 should now look like this (notice that I inserted a line):
 26  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ? If:                                                                   ?
       Then: yh(3,.0)=fnumber(yf)                                              ?
 27  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ? If: yf eq "1"                                                         ?
       Then: yg=""{yc{ts{yc{yb{yc{self(yh){yc{""                               ?
 28  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ? If: yf gt "1"                                                         ?
       Then: yg=yg{yb{yc{self(yh){yc{""                                        ?
 29  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ? If:                                                                   ?
       Then: yf=yf+"1"; goto LOOP001                                           ?

I apologize for whatever inconvenience this may have caused.  I hope you have not
deployed the programs into your operational system and still on time to make corrections
timely prior to your FedEx scheduled pickup  :) 

Should you have any question, feel free to drop me a note or to call me at your convenience!


---
Jose Lerebours
954  559  7186
http://www.fpgroups.com




More information about the Filepro-list mailing list