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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using @say/get command in VFP6 form 4

Status
Not open for further replies.

Phil Thoms

Programmer
Oct 31, 2005
245
GB
I am migrating to VFP6 from FoxPro 2.6. I want to use @say/@get commands in a form, what is the correct way to do this. Thanks.
 
You use a Textbox control in a visual form.

As you come from fp2.6 you have to take migration steps, eg convert your screens to forms. @say/@get only works for backward compatiblity in screens, not in forms.

Have a read of this article for the major choices you have:

You can make screens run in VFP9 unchanged. But you can't evolve from there to forms without redoing a whole screen as a form. Make yourself comfortable with the form designer by entering CREATE FORM in the command window. Open the Form controls toolbar side by side to drag&drop controls on to the empty form.

This is windows forms, not dos screens anymore.

Bye, Olaf.
 
Philtoms,

Olaf has given you good advice.

The short answer to your question is: Yes, you can use @/SAY and @/GET with forms, but there is really no point in doing so.

You can also use @/SAY and @/GET directly to the screen, just as you always have. In that case, they will work as before. If you use them within a form, you have to keep in mind that the screen co-ordinates are relative to the form, not the screen.

But these commands really don't have any place in a VFP application. In VFP, you create your user interface by placing controls on a form. The controls include a label, which is roughly equivalant to @/SAY, and a textbox, which serves roughly the same job as @/GET.

If you really want to stay with @/SAY and @/GET, you might as well stay with FoxPro 2.6.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike,

Just a point of clarification.

You can also use @/SAY and @/GET directly to the screen, just as you always have. In that case, they will work as before. If you use them within a form, you have to keep in mind that the screen co-ordinates are relative to the form, not the screen.

Your dBase-ness is showing. <g> Very few of us used say/get directly to the screen in FPW2.x (or even as far back as FPD2.0). Coordinates have been relative to the defined window (or form) as far back as FPD1, actually.

But, yes, there is no good reason to use @ SAY/GET in VFP and several good reasons not to!

Dan
 
philthoms - I can understand why you might think that by preserving the OLD @Say/Get method for Screens as you move into VFP, might mean that you will have less conversion to do.

And I can understand that you might want to do the same for Reports for the same reason.

BUT, as the others have suggested above, DON'T.

Take the extra time to re-develop your FP2.6 Screens and Reports into VFP Forms and Report Forms. It will make moving forward a WHOLE LOT EASIER in the long run.

Good Luck,
JRB-Bldr


 
Your dBase-ness is showing ... Very few of us used say/get directly to the screen in FPW2.x

Ah, you youngsters are all the same. You've had it too easy. We never had any of those fancy windows in my young day, but we still managed to feed the family. I don't know ....

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike:
Once long ago in a distant time I had a client who ‘knew’ FoxBase tell me that I had to code on screen boxes via single ASCII character @Says. Told me that it was the fastest way to draw on the screen. Even after showing him the @Box command and showed him that the time was ~1000% better using the BOX command, he ‘informed’ me that he paid my fees and I was to program it the way he directed.

Then again I have been programming xbase since the days when we had to go out into the snow without shoes to dig out the bits we needed from the hard frozen ground, leaving bloody foot prints in the snow, to pour a bucket full of bits into the computer before we could program for the day. <wink>

BTW I also highly recommend dropping the use of the @SAY/@Gets from any visual FoxPro development


Lion Crest Software Services
Anthony L. Testi
President
 
Ah, you youngsters are all the same. You've had it too easy.

Not really. Even with FPD1 I kept a copy of dBase around for its Format Painter. Once I had the FMT file, I'd copy/paste the @SAY/GET commands into my FoxBase/FoxPro prg files.

I *do* remember those days! Not all that fondly, but I do remember. <g>

Give me a form with textboxes instead *any* day!
 
Thanks for all your advice. One more question before I become a convert. The DEFINE WINDOW command has a new attribute called NAME, Help says it creates an object reference for the defined window allowing manipulation of certain properties as in a form. Can someone explain this further ? Thanks.
 
DEFINE WINDOW command has a new attribute called NAME" All I can say is that I very rarely use the Define Window Command in VFP, changed everything to forms. (In fact I may not have used it in 3,4,5+ years.)

That is the main UI elements are now forms. Some forms may be dialogs (e.g. user must close the form before doing anything else) and some are not dialogs.

Lion Crest Software Services
Anthony L. Testi
President
 
In VFP you typically no longer DEFINE WINDOW.
Instead you create a Form and if you want to display a Browse screen, you put a Grid on your Form and have your data cursor/table appear in it.

One place you might get some general tutorial info on VFP is:

You can watch the tutorial videos on-line or download them for viewing off-line.

Good Luck,
JRB-Bldr
 
Mr Data Guy said:
Then again I have been programming xbase since the days when we had to go out into the snow without shoes to dig out the bits we needed from the hard frozen ground

Where I live, we still have to do that.

Dan said:
Even with FPD1 I kept a copy of dBase around for its Format Painter.

Yes, I did as well. I had forgotten that.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike & Dan
how about this trick. I use to do 95% of my development on FoxMac, because it allowed for multiple editing windows at a time and other such improved development UI tools, then transfer it via SCII ( or how ever that interface is spelled ) to the IBM PC FD for final adjustments. Ahhh those where the days. <wink>


Lion Crest Software Services
Anthony L. Testi
President
 
Why use VFP 6? While VFP 6 Sp5 was the first stable/popular version Visual FoxPro, that was about, oh, a decade or more ago. If you can, make a clean start with VFP 9.0, upgrade to Sp2 and then you're prepared for nearly anything and everything in the 32-bit xBase world.
 
You didn't have Sidekick?

That was my favorite editor all the way up to FPD 2.0, when we first got "power tools" and code was stored in memo fields instead of individual text files all of a sudden.

DEFINE WINDOW ... NAME

Just say no.
 
Thanks again for all your advice, I'll stick with VFP 6 for now until I'm up and running and then try version 9 at a later date. What is the best place to buy VFP 9 ?
Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top