×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Code text appears on a Form

Code text appears on a Form

Code text appears on a Form

(OP)
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

RE: Code text appears on a Form

It sound you like you need to execute SET TALK OFF (in the form's Load event).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Code text appears on a Form

(OP)
Mike you are a genius! That was the problem.
Thank you!
Klaus

RE: Code text appears on a Form

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 

RE: Code text appears on a Form

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

RE: Code text appears on a Form

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
https://www.doschke.name

RE: Code text appears on a Form

Quote (Mike Lewis)

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

RE: Code text appears on a Form

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

RE: Code text appears on a Form

Alastair, setting AllowOutput to .F. doesn't prevent the TALK output from appearing. It merely forces it to appear on the background screen.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close