Path: utzoo!mnetor!tmsoft!dptcdc!jarvis.csri.toronto.edu!rutgers!njin!princeton!phoenix!englandr From: englandr@phoenix.Princeton.EDU (Scott Englander) Newsgroups: comp.databases Subject: Invalid Subscript Reference in Fox: Bug or Feature? Keywords: FoxBASE UDF macro Message-ID: <9563@phoenix.Princeton.EDU> Date: 23 Jul 89 09:36:41 GMT Organization: Princeton University, NJ Lines: 27 I'm trying to include references to functions in statements in a FoxBASE /Mac program, and i think Fox is seeing them as arrays, for some reason. Case 1: replace next (r2-r1) tr2comb with tr2fit() for tr2 <> -99 .and. correlates() Here, tr2fit() and correlates() are UDF's in the same file as the program. This line gives the error message "Invalid Subscript Reference" when used in a program or on the command line. I tried macro substitutions like fit="tr2fit()" and then using &fit in the above line, but to no avail. This is a pain, because without the function calls, i must do "repeat next 1" repeatedly, which is much slower. Case 2: procedure correlates return round(tr2fit(),0) = tr2t This does not work either, and gives the same error message. I had to evaluate the result first, and then return it, in order for it to work. (I fixed it before trying the reference to it in Case 1.) It seems to me that replace has no problem with functions that are separate .prg files (with no procedure statement), but i haven't tried that here. Any clues? -- - Scott