|
| Re: passing a field as a parameter |
 |
Fri, 28 Mar 2008 08:13:16 -040 |
In article <seih9PLkIHA.960@news-server>, fred@polyflexseals.co.za
says...
>
> ??? set filter to csrchfld=0
>
try:
set filter to &csrchrfld. = 0
--
Marilyn Price
|
| Post Reply
|
| passing a field as a parameter |
 |
Fri, 28 Mar 2008 10:55:37 +020 |
Hello all- question on dbase 4.2 for dos
Maybe someone out there remembers dbsae 4 ver 2
well I still use if extensively and am trying to teach myself dbase plus
but just havent got the time ( or maybe the time left-- I am 65)
In my .dbf I have a numeric field called height and another called length
My program requires that sometimes I use the contents of "height"
and sometimes I use "Length"
I am doing this
(Example uses the contents of height)
srchparm="HEIGHT"
do filtflds with "Di",srchparm,"isblank",program(),lineno()
(PROC filtflds contains the following lines)
proc filtflds && allows operator to filter on a field
and
parameters whichdbf,whichfield,dowhat,progrm,lineno
select (alias(UPPER(LEFT(whichdbf,2)))) && OPENS THE WORK
AREA
csrchfld=alias()+"->"+ whichfield &&
CSRCHFLD IS NOW
DI->HEIGHT
whichfield=alias()+"->"+ whichfield &&
WHICHFIELD IS NOW
DI->HEIGHT
if type(whichfield)="N"
&& if
whichfield is a numeric field
AT THIS POINT I WANT TO SET A FILTER TO THE FIELD "HEIGHT" MUST BE
EQUAL TO
ZERO
??? set filter to csrchfld=0
&&
set filter to field =nil
??? set filter to val(csrchfld)=0 &&
set
filter to field =nil
else
&& if not a numeric field
set filter to isblank(&csrchfld) &&
set
filter to empty field
endif
Regards fred evans
|
| Post Reply
|
| Re: passing a field as a parameter |
 |
Fri, 28 Mar 2008 14:32:49 +020 |
Thanks marilyn-- Thought you would answer you seem to be the dBase 4 ver 2
person!!
I put that in ( the &) and it seems to work on the code when it runs- so
that is surely the answer.
However what threw me off the scent was that when I
display "&csrchfld" in the display window of the debugger I get
an error "
memory variable not defined"?
Is this something i should worry about??
regards from south africa
fred
"Marilyn Price" <mprice@tri_con.net> wrote in message
news:MPG.2256aae78801671b98975a@news.dbase.com...
> In article <seih9PLkIHA.960@news-server>, fred@polyflexseals.co.za
> says...
> >
> > ??? set filter to csrchfld=0
> >
>
> try:
>
> set filter to &csrchrfld. = 0
>
> --
> Marilyn Price
> M. P. Data
|
| Post Reply
|
| Re: passing a field as a parameter |
 |
Fri, 28 Mar 2008 14:43:55 +020 |
Oh I see you have a dot behind the &csrchfld.
Is the dot part of the solution and what does it do??
regards fred
"Marilyn Price" <mprice@tri_con.net> wrote in message
news:MPG.2256aae78801671b98975a@news.dbase.com...
> In article <seih9PLkIHA.960@news-server>, fred@polyflexseals.co.za
> says...
> >
> > ??? set filter to csrchfld=0
> >
>
> try:
>
> set filter to &csrchrfld. = 0
>
> --
> Marilyn Price
> M. P. Data
|
| Post Reply
|
| Re: passing a field as a parameter |
 |
Sat, 29 Mar 2008 03:14:35 -040 |
In article <WqkLJPNkIHA.1096@news-server>, fred@polyflexseals.co.za
says...
> Oh I see you have a dot behind the &csrchfld.
>
> Is the dot part of the solution and what does it do??
>
> regards fred
Fred,
The dot is the macro terminator. It is optional until you are using the
macro with something contains a dot. It is a good practice to use the
macro terminator.
--
Geoff Wass [dBVIPS]
Montréal, Québec, Canada
.|.|.| dBASE info at http://geocities.com/geoff_wass |.|.|.
.|.|.| ---------------------------------------------------------- |.|.|.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|