Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code text appears on a Form

Status
Not open for further replies.

k2a

Programmer
Jun 26, 2012
133
DE
Hi all,
I start a script from a command button which contains a statement within a loop such as:
"SUM lv_revisor.stunden TO lnGesStd". The result is correct but each time it is executed
the code text "lv_revisor.stunden" is placed all over on the form.
How can something like that happen?

Klaus
 
Mike you are a genius! That was the problem.
Thank you!
Klaus
 
In a more complex environment where you might like to have SET TALK ON in other places, I usually do something like this:
Code:
PRIVATE set_talk
set_talk=SET("TALK")
SET TALK OFF
* Do your summing or other calculations
SET TALK &set_talk
 
I'm not sure I agree with you, Dan. I can't think of any circumstances where you would want TALK to be on. There might be times when you want to display information in the main Fxopro window, perhaps using the ? command, but that's not the same as TALK.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
TALK is mainly writing some "garbage" on the status bar. At least from the perspective of end users. But also developers can't read the messages faster, you just might have an idea where you are in code when a record counter is going up. IIRC it's also bound to the automatic progress bar and you can't just turn on that and not all the other messages. You have SET NOTIFY CURSOR ON/OFF, but the combination of SET TALK ON And SET NOTIFY CURSOR OFF also isn't better, is it?

Aside of that, every form has the AllowOutput property, which is about text output as it's coming from ? or several aggregation commands like SUM and some more like LIST commands. It redirects output to _screen (the help topic says "desktop", but of course that's not talking of the Windows desktop). You can SET CONSOLE OFF and SET NOTIFY OFF and still get that SUM output, also when SUM-ming TO a variable.

I still also used SET TALK ON and users got used to it so they could see when something wasn't healthy as the status bar froze and stopped showing progress. A bit like a heuristic for the normal processing some button triggers.

But overall, I agree, SET TALK OFF is best and if there is something needing a bit time and it's helpful you can see at least a hint of the progress from screenshots users can make when errors happen, you can SET MESSAGE or use Wait Windows. Of course, logging also helps, not just errors, also logging some milestones in what a routine does. The lineno() an error handler might log tells you very precisely where you are, but sometimes you have to see why there is a sluggish behavior or endless loop only resolved by timeout, if you thought about that, that shouldn't hit the timeout, though. I always wanted to establish a more verbose error reporting function to users including a log and screenshot done automatically, but such features were always downvoted. It touches legal stuff a bit about monitoring employees too tightly, even though it wouldn't be persisted forever and only be used if a user actively decides to report with detail information. Even Windows itself has such a feature, makes you wonder how that gets through.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Mike Lewis said:
I can't think of any circumstances where you would want TALK to be on.

Code:
REINDEX

But that's pretty much the only time I've used it in the last 25 years. [pipe]
 
On some of my forms SET TALK OFF still does not hide some junk characters appearing.
In this instance I set "Thisform.AllowOutput" to FALSE during the specific code run that causes the issue then set it to TRUE immediately afterwards.

Alastair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top