×
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

Jobs

Form problem with Set Talk
2

Form problem with Set Talk

Form problem with Set Talk

(OP)
I've just encountered a really unsual behavior, and I can not figure out what is causing it...

I've been working with a form for quite a while, and I have started to experience an odd behaviour.  The form suddenly has started setting "TALK" to ON.  I ran a trace on the code, and it is really odd.  As soon as the "LOAD" event code starts, the state of SET TALK gets set to ON.  There is NO code line that does that.  I watch in the "WATCH" window, as the value of SET('TALK') starts as OFF, as soon as the first line of code in the LOAD event fires (which is a really typical piece of code... that reads:  

M.WORNARMOR = LEFT('NONE'+ SPACE(50),50)

As soon as this line exicutes, the value of of SET TALK switches to "ON".  What on earth could cause this???   Is there something implicit that I am not aware of?  Is there some property on a form that could be causing this that I can't see???  Any ideas at all!??!!  It's just plain odd...

          Thanks,
           -Scott

Please let me know if this has helped!

RE: Form problem with Set Talk

HI,
In all probability, you have some code in the Data Environment methods. I have noticed, that the DE has its own SET commands obedience, irrelevant to the global SET command you could have.

What I used to do is.... have the SET commands.. as a procedure in my Main.Prg.. example..

PROCEDURE MySets

SET TALK OFF
SET SAFETY OFF
etc.. whatever
RETURN

Then, where ever I use some code in the DE methods, I put the code...in the 'BeforeOpenTables' method of the Data Environment
DO MySets && TO AVOID DISPLAY OF MESSAGES

Probably, you can have this in the Load Event of the form, if you want to set specific to one form as well.

Hope this helps

ramani
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK

RE: Form problem with Set Talk

(OP)
Ramani,
    I'll take a look at the data environment.  I haven't created any code there that I recall, but I'll take a look.  I have a routine allready called SETSET, which set's the state of the SET commands that I want, and is called during my STARTUP.PRG.  (In fact, it's the second call right after a call to another procedure I have called CLEANSTART, which clears most common things like values of Arrays, Library and Procedure sets.)
     But, I get you point.  Also, I set explicitly "SET TALK OFF" in the LOAD event, and it works fine.  I just don't like the notion that it was all running without a hitch, and just suddenly started this problem.  I find the explicit set of talk to OFF, when I have set it previously, to be a kludge, in this case...  the perfectionist in me just can't let it go!
     As always, you've been very helpful.

          Thanks,
           -Scott

Please let me know if this has helped!

RE: Form problem with Set Talk

(OP)
Well, thought that anyone reading this thread might like to know I'v figured this out.  Thanks to Ramani's helpful tip... it seems that I had set the form properties Data Session to "Private Data Session", which apparently, carries with it an implicit "SET TALK ON".  Don't know if anyone else has experienced this.  It is very unusual.  Setting the item back to Default resolved the issue, though, it is still a problem if you truely want a Private Data Session.  At least, I know what caused it...

          Thanks,
           -Scott

Please let me know if this has helped!

RE: Form problem with Set Talk

Many of the SET commands are scoped to the DataSession, and each datasession is created with these commands at their default values. These aren't global at all; if you have two forms with private datasessions open, and one contains an explicit SET TALK OFF, open the debugger and enter SET("TALK") in the watch window. Now switch between the forms, and you'll see the TALK setting change as each form gets focus.

Look in the Help topic under SET DATASESSION to see a list of settings that are scoped to the datasession.

Many frameworks, such as Codebook, contain classes that handle these session-specific settings for you automatically. This way you don't have to do the same setting and re-setting on every form you create.

-- Ed

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!

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