FoxPro Application Workspace

smithmrk
smithmrk used Ask the Experts™
on
Hello Experts!

OK so I have a FoxPro program that uses a Function:
SUM (Extract.amount) TO TotalAmount
Works great...but after running the program I'm left with SUM($7569.69) on the screen...which I can clear using the "Window/Clear"...but how can I do this within my program so I can keep my workspace clean?

Thanks,
Mark
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
from my experience, you have to type  "clear"  every time

i suppose add that keyword to your function
Olaf DoschkeSoftware Developer
Commented:
Foxpro is less talkative, if you set talk off:
SET TALK OFF

Open in new window


As extra tipps, while you're at it, SET CONSOLE OFF, SET NOTIFY OFF, SET NOTIFY CURSOR OFF, _SCREEN.AllowOutput = .F. are further settings in that direction, though none of them helps with the SUM output suppression.

It's good to know them for other unwanted messages, though.

Another solution is to use SQL:
Select Sum(Amount) From Extract Into Array TotalAmount
* ? TotalAmount[1]
* ? TotalAmount && (same as TotalAmount[1])

Open in new window


Creating an array via SQL is a good replacement, especially with more complex queries, as you can simply address the first array element with the array name only.

Bye, Olaf.

Author

Commented:
Thanks Guys!
Olaf DoschkeSoftware Developer

Commented:
Actually SET CONSOLE OFF dows also help suppressing SUM output, but not when you issue it from the command window, see help on that setting.

Bye, Olaf.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial