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!

Few Questions

Status
Not open for further replies.

alisaif

ISP
Apr 6, 2013
418
AE
Hi,

I have some questions which are as follows:

1. In multi user environment and in dos program (FPD26a), I was using rlock() and unlock for replacing the records in tables. Should I use the same in VFP9 while saving the records in tables or, should I tableupdate, tablerevert functions instead. And, if so, how can?

2. Where to use lockscreen = .T. and lockscreen = .F.

3. How can I generate my own buttons in messagebox.

4. Should I keep the .exe (compiled files) on each user pc (in order to run the program faster) and if so, how can I define the path of tables only in server.

5. What should be the necessary contents of main.prg (define path of tables. reports etc).

6. Can I blink a label without using timer?

Thanks

Saif
 
First point - since you appear to be using FPD26a

While a number of us work in both 'worlds' (FP & VFP), you should probably post your question to:
Microsoft: FoxPro (old versions 1 to 2.6) Forum
forum182


It has been a LONG time since some of us did much work in OLD FP.

Good Luck,
JRB-Bldr
 
1) In VFP, you don't need to worry about locking. Use table buffering and TableUpdate()/TableRevert().

2) You only need to set LockScreen to .T. when you need to make a lot of visual changes to a form that you want to appear at once. I find it use it very rarely, so don't worry about it while you're getting started.

3) You can't generate your own buttons in MessageBox(). You can simply choose among those sets that are available. If that won't work for you, build your own form that looks similar, but has what you need.

4) On the whole, I recommend keeping the EXE on the individual user machines. Use a table or INI file on each machine to point to the data location.

5) Most basic start program has this structure:

* Look up the data location
* Then, CD to it.
* Show the main form, if you're using one.
* Otherwise, change the icon and title of the main VFP window.
* DO your main menu program.
READ EVENTS
* Clean up

6) No, you can't make a label blink without a timer, and in the Windows world, it's generally considered bad form to blink things.

This article might help you get started:
You'll find lots more on my site at: and
Tamar
 
jrbbldr, he's coming from FPD26a, now asking how to go about stuff in VFP9.

I'll give my answers, short as Tamar

1) Commands writing to tables make automatic locks, but if you want no user than the one having the lock can change the record, you can recycle that logic and also use tableupdate() at the same time. Tableupdate() depends on buffering changes, independant on locking.

2) Forget about them in the first place

3) Craig Boyd has written an article for changing the messagebox font, buttons etc., but indeed go with your own form, if you need specialties.

4) Even in a corporate LAN we use a cmd script the user starts instead of the exe, it has a robocopy command to copy the latest version, if there is any newer, to the client, including a config dbf, that could also be an ini. So you still have a central update folder under your control, including file locations stored in a config file you read at start, not necessarily in main.prg, but in your application object, so for example paths become available application wide as goApp properties or via a goApp.getconfigvalue(cConfigValueName) method.

5) Ask 5 VFP developers and you get 8 answers. You know best, what you want your app to do at start, what should be persistently available (a menu ?) and of course you have to know how READ EVENTS and CLEAR EVENTS work.

6) No, instead I'd recommend using colors, also the background color of text boxes, to highlight important fields. For important attention I sometimes use a larger red label, but no blinking.

Also, there are a lot of VFP tutorial videos out there, google vfp video tutorial and you'll find them.

Bye, Olaf.
 
Thanks Tamar for the feedback and useful links.

I have one more question, in data entry form, is it the good practice not to use any table in data environment but using Sql-select instead. And at the time of saving records I open the table in 0, replace record and close it.

So the question is what should I select for Data Session, 1-Default Data Session, or 2-Private Data Session for a multiuser environment.

Thanks

Saif
 
Saif,

I'm pleased to see you're getting good answers to your questions.

However, for the benefit of other forum members, it would really be much better if you could post just one question in each thread - and also to give the thread a title that reflects the nature of the question.

This makes it easier for us to keep track of the questions and the answers that have been posted for it. When a single thread contains six or more unrelated questions, it can be quite difficult for anyone reading the thread to see at a glance what information has been posted and whether he or she can add anything to the discussion.

Also, by giving your question a relevant title, it helps us to decide which questions to read, based on whether or not we think we can answer it. It's also helpful for other people who might have similar problems, as it enables them to persuse the list of threads without necessarily opening each one individually to see if it's relevant for them. For that reason, titles like "Basic question" or "Few questions" or "Just a request" are not very helpful.

I know you've been making good use of the forum since you joined earlier this month. If you will keep in mind the points I've mentioned here, I'm sure you will continue to get good benefit from it.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Mike makes a good point, at least you should do that for your final question. I see the main nature of all your questions are, how to do things in the visual foxpro world new to you. I have an answer to say for the data entry strategy and use of the datasession and data environment, but it's really worth a seperate thread, and I'd wait for my answer, until you post that.

Bye, Olaf.
 
Just to add: I'm not suggesting that you re-post all the existing questions in this thread. Now that the answers are coming in, you might as well leave things as they stand.

It's more a question of something to keep in mind for the future.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks Mike, Olaf for showing me appropriate way to post the Questions.
I will definitely taking care of these.

Sorry for the inconvenience caused.

Thanks

Saif
 
It's not inconvenience, it's just there is a lot more to say about data environment and datasession than just yes or no, so it's better suited for a seperate thread. Like Mike suggests, keep the other five questions together, they all are can be answered in short and I think that's why you put them together in one thread and that's also OK.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top