Foundation Read -- Why? What am I missing?

Foundation Read -- Why? What am I missing?

Post by Lawrence Lusti » Tue, 21 Jun 1994 01:13:24



I have a good sized FoxPro application which runs fine with FPDos 2.5.
The startup module of the project is a menu program which replaces the
system menu and then just sits there (no read active) waiting for the
user to choose a menu option, which in turn bring up windows, etc.
Browsing the manual yesterday I came across a section on Foundation
Reads which seems to indicate to me that my application really should
have a read active at all times, rather then sitting there with the
menu visible, waiting for a menu choice from the user.  Do I need
to use a foundation read?  Will I need one if I port the project to
other platforms (MAC, Windows).  How about for distribution with the
distribution kit (a possiblity in the future).

Larry.

 
 
 

Foundation Read -- Why? What am I missing?

Post by Allen J. Friedm » Tue, 21 Jun 1994 04:00:00


: I have a good sized FoxPro application which runs fine with FPDos 2.5.
: The startup module of the project is a menu program which replaces the
: system menu and then just sits there (no read active) waiting for the
: user to choose a menu option, which in turn bring up windows, etc.
: Browsing the manual yesterday I came across a section on Foundation
: Reads which seems to indicate to me that my application really should
: have a read active at all times, rather then sitting there with the
: menu visible, waiting for a menu choice from the user.  Do I need
: to use a foundation read?  Will I need one if I port the project to
: other platforms (MAC, Windows).  How about for distribution with the
: distribution kit (a possiblity in the future).

The Foundation read provides an implicit loop, often called an 'event
loop'that allows you to handle all menu hits as 'side effects'.  

If your application has its own loop that waits for a menu hit, takes some
action depending on the menu choice and then returns control to the loop,
you have coded an effect similar to that achieved by the Foundation Read.

The question of which method is better under what conditions is a matter
of some controversy in the FoxPro world, and I would rather let others
comment.

Suffice it to say, if your application works and pleases you, don't fix it.

 
 
 

Foundation Read -- Why? What am I missing?

Post by Marcus Reynol » Tue, 21 Jun 1994 06:13:30



> I have a good sized FoxPro application which runs fine with FPDos 2.5.
> The startup module of the project is a menu program which replaces the
> system menu and then just sits there (no read active) waiting for the
> user to choose a menu option, which in turn bring up windows, etc.
> Browsing the manual yesterday I came across a section on Foundation
> Reads which seems to indicate to me that my application really should
> have a read active at all times, rather then sitting there with the
> menu visible, waiting for a menu choice from the user.  Do I need
> to use a foundation read?  Will I need one if I port the project to
> other platforms (MAC, Windows).  How about for distribution with the
> distribution kit (a possiblity in the future).

If you want your stuff to look like the Foxpro demos, then you will need to
use Foundation READ. For those kind of applications where the user jumps
around from window to window, watching all the little nested READ activating
& deactivating themselves it's beautiful. I have the greatest respect for
the people who write such programs, but personally I don't need that stuff.

My initialisation module kills off SYSMENU & sets up it's own menu structure,
which in turn is used to call each task. I sometimes use nested READs to
provided a gateway to a lookup table entry screen from my main entry screen,
but I never base a whole application on them. In general I prefer each task
to launch, do it's stuff & drop back to the main menu. I provide my users
with strictly defined routes through my systems & make sure all the facilities
they need to do their jobs are available at the appropriate point.

It all really depends on what you see as your main function as a programmer.
You will be able to write large applications without foundation READ. You will
be able to port them to other platforms. You will be able to distribute them.
Some of my apps run to over 60000 lines of source code & all my stuff is
compiled with the distribution kit. It doesn't look like the pretty demos you
see in the marketing literature, but that doesn't bother me or my users. They
want the tools to do their jobs quickly, efficiently & accurately & pay me to
provide them. If your code does the business without any fancy Foundation
READs then stick with it.

Regards

Marcus Reynolds

P.S. Sorry if I sound a bit militant, but I too have been browsing the manuals
recently & the way this stuff is treated as the only true path is getting me
down. It simply doesn't suit all applications.

 
 
 

1. Why am I missing data? (SS 7.0 + ASP)

Hello,

Please point me to the correct newsgroup or other resources if this
isn't the right one.

Using SQL Server 7.0 on our ISP's shared server environment using NT
4.0. Using ASP to create SQL statements to insert data into a table for
a web-based data collection application. Have error trapping enabled so
that if an error occurs it tries to rerun the query. It also writes the
error number, sql statement and other info to an error table. If I get
more than a handful of simultaneous users then I start getting
deadlocks, which is the most typical error.

A typical table has an id column and then anywhere from 5 to 500 data
columns. Each column is typically defined as a 3 nvarchar. Users go
through a bunch of pages selecting radio buttons and it writes the 3
alphadigit of the selected button to the database. One update per page.
On a few records (maybe 1/2 to 1 percent) I noticed that a bunch of data
is missing. One time out of 1000 records 10 of them were all missing
data in the first half of of the columns. Other records were complete.
No errors were recorded in the error table. Behaviour happens for both
small and large tables.

Typical update goes like this. err_check is a sub that

conn_str="driver={SQL
Server};server=xxx.xxx.xxx.xxx;database=db_name;uid=login;pwd=password"
sql="UPDATE data_table SET q1='ab1' WHERE id=1234"
set conn = server.createobject("ADODB.Connection")
call err_check(login_id,q_num,conn,sql,"store_data_1")
conn.open conn_str
call err_check(login_id,q_num,conn,sql,"store_data_2")
conn.execute sql , , &H00000080
call err_check(login_id,q_num,conn,sql,"store_data_3")
conn.close
set conn=nothing

Any clues as to why I'm mysteriously missing data would be greatly
appreciated.
Thanks.

2. ? How can I remove records from multi-record reports?

3. Reading in numbers - am I missing the boat?

4. V.Urgent Is there anything to help me find who connected and changed a table....?

5. Foundation Read and re-cycle reads...

6. report print problems using HP II

7. I am looking for the microsoft foundation classes!!

8. foundation reads AND VFP

9. foundation read question

10. Foundation Read Question

11. Codebook 2.6 - the foundation read and event handler