filepro INDIRECT function
Lerebours, Jose
Jose.Lerebours at EagleGL.com
Tue May 23 06:40:59 PDT 2006
Enrique wondered:
> Is there a function in filepro that will do the same thing as Excel's
> INDIRECT function ?
>
> Here's what I'm planning to do:
>
> On a html page Have a couple of Radio buttons with Field
> names and field
> numbers onthem. So when a user checks some of these radio button and
> Sumbits them. My Unix system will run a cgi script that will
> DEURL that
> string of information and it will parse it within filepro and
> will export
> a Comma delimited Report back to the webpage Requestor based
> on the fields
> he wanted.
> So if the Radio button value is 1, then my export command
> will take that
> number and make it field 1 so the export writes the value of
> field one on
> the CSV file. and so on.... So the user using the web application can
> decide by cecking some preshown fields which ones he wants on
> the report.
>
> So can I do this :
>
> export ascii out=("inv.csv") r=\n
>
>
> import ascii imp=(file_name) f=~ r=\n
>
> aa=imp(1){","{imp(2)
>
> write out
>
Enrique,
First, you are not assigning anything to exported file by simply
assigning a value to a dummy variable. Your sample is simply
populating aa with content of imp(1), a string plus imp(2).
I believe imp(1) is a number 1 through 999 or a variable a through
zz ... So, aa will end-up with something that looks like "23,24"
and not with content in fields 23 and 24 from SOURCE file.
Second, where is the data coming from? I understand your 'imp'
alias to be the source from submitted form which will provide
the mapping to which fields to use, but where is the data to
be extracted from?
Now, lets say that data is to be extracted from a file name
SOURCE. As usual, there are many ways to skin a cat and this
one is no exception.
Sample 1:
Run program from point of reference which will in turn do
a) Load targeted fields from submitted form
b) Open SOURCE file and write out needed records to file
Sample 2:
a) Run a report from SOURCE. The processing will load
targeted fields to variables and print records out
to file
Of course, the method of coding varies based on your
preferred technique and/or approach.
Perhaps, if you were to provide a bid more detail of your
code or overall needs, we can assist with more specific
solution.
Good luck!
Jose Lerebours
More information about the Filepro-list
mailing list