Home > Archive > Programming with dBASE > November 2005 > Re: Filling a datafile with the same record a required number of









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Filling a datafile with the same record a required number of
Bruce Beacham

2005-11-10, 11:23 am

Dieter Schoenefeld wrote:

> my program is not executing the command 'APPEND BLANK' ie no records

are added.



> DELETE FOR RECNO() > 1
> PACK



You could replace those with ZAP.


> DO WHILE RECNO() < mCREQUIRED



Use this line instead:
DO WHILE RECCOUNT() < mCREQUIRED


Bruce Beacham
Dieter Schoenefeld

2005-11-11, 11:23 am

Thank you Bruce
I tried your suggestion but my CFiller.prg still does not execute the APPEND BLANK command in the loop when the variable is defined in the dialog form.
When defined from the Command Window, APPEND BLANK executes ok the required number of times.
How would OO code replace what I am trying to do?
I appreciate your help
Dieter Schoenefeld

Bruce Beacham Wrote:

> Dieter Schoenefeld wrote:
>
> are added.
>
>
>
>
>
> You could replace those with ZAP.
>
>
>
>
> Use this line instead:
> DO WHILE RECCOUNT() < mCREQUIRED
>
>
> Bruce Beacham



Ivar B. Jessen

2005-11-11, 11:23 am

On Fri, 11 Nov 2005 09:38:05 -0500, Dieter Schoenefeld
<dschoene@cyberbeach.net> wrote:

>Thank you Bruce
>I tried your suggestion but my CFiller.prg still does not execute the APPEND BLANK command in the loop when the variable is defined in the dialog form.
>When defined from the Command Window, APPEND BLANK executes ok the required number of times.
>How would OO code replace what I am trying to do?
>I appreciate your help
>Dieter Schoenefeld


Dieter,

Could you do something like this to get 20 identical records in a temporary
table to be used for printing labels,

select * from cretaddr save to tempaddr

use tempaddr
for i = 1 to 19
append from tempaddr
next i
use

Please avoid replying to a message with RE: in front of the subject. In
this way you start a new thread and it is not obvious which message you
refer to.


Ivar B. Jessen
Mervyn Bick

2005-11-11, 1:23 pm

On Fri, 11 Nov 2005 19:22:54 +0200, Ivar B. Jessen
<bergishagen@it.notthis.dk> wrote:


> Please avoid replying to a message with RE: in front of the subject. In
> this way you start a new thread and it is not obvious which message you
> refer to.


I think this depends on the software you are using.
Bruce Beacham

2005-11-11, 8:23 pm

Dieter Schoenefeld wrote:
> Thank you Bruce
> I tried your suggestion but my CFiller.prg still does not execute the APPEND BLANK command in the loop when the variable is defined in the dialog form.
> When defined from the Command Window, APPEND BLANK executes ok the required number of times.
> How would OO code replace what I am trying to do?


I don't think it would answer this problem. I think the problem is
that mCREQUIRED is not a number, so is read as 0 and the loop is never
executed. I know you see it, and I know automatic type conversion
should deal with it, but still...

Do this and set up the variable mCREQUIRED to be seen in in the Watch
window (type Ctrl-A to add a variable), then follow the program steps to
see whether the loop is entered:

/* Program: CFiller.prg
<snip>
*/

SET STEP ON // <<< new line, to start up the debugger.

USE C:\Scholastic\Tables
\cretaddr.dbf EXCLUSIVE
? mCREQUIRED //for diagnosis only. variable defined in a
//dialog form or on the command line

etc.


Bruce
Dieter Schoenefeld

2005-11-12, 7:23 am

Thanks again Bruce,
I have run the program through the Debugger and it executes the DO WHILE loop but not the APPEND BLANK command in the loop,when mCREQUIRED is defined in a form, However, it is executed when mCREQUIRED is defined from the command line.I obviously have to t
ry something else. Maybe do the whole thing in Object Language. But that is where I need help.

Bruce Beacham Wrote:

> Dieter Schoenefeld wrote:
>
> I don't think it would answer this problem. I think the problem is
> that mCREQUIRED is not a number, so is read as 0 and the loop is never
> executed. I know you see it, and I know automatic type conversion
> should deal with it, but still...
>
> Do this and set up the variable mCREQUIRED to be seen in in the Watch
> window (type Ctrl-A to add a variable), then follow the program steps to
> see whether the loop is entered:
>
> /* Program: CFiller.prg
> <snip>
> */
>
> SET STEP ON // <<< new line, to start up the debugger.
>
> USE C:\Scholastic\Tables
\cretaddr.dbf EXCLUSIVE
> ? mCREQUIRED //for diagnosis only. variable defined in a
> //dialog form or on the command line
>
> etc.
>
>
> Bruce


Bruce Beacham

2005-11-13, 3:23 am

Dieter Schoenefeld wrote:
> Thanks again Bruce, I have run the program through the Debugger and
> it executes the DO WHILE loop but not the APPEND BLANK command in the
> loop,when mCREQUIRED is defined in a form,


When you do this, what does the Watch window tell you is the value of
the mCREQUIRED variable?

Before getting to your loop, add this statement:

_app,mCREQUIRED = mCREQUIRED


Then make your DO loop thus:

? "_app.mCREQUIRED = ", _app.mCREQUIRED
DO WHILE RECNO() < _app.mCREQUIRED


I wonder if you are, or may be, double-defining mCREQUIRED as both a
public and a private variable, and the system is using first one, then
the other, variable, to its own confusion.


Bruce
Bruce Beacham

2005-11-13, 11:23 am

Oops! Dot, not comma.


> Before getting to your loop, add this statement:
>
> _app.mCREQUIRED = mCREQUIRED



Bruce
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com