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

APPEND BLANK/SET CARRY ON

Status
Not open for further replies.

Kimed

Programmer
May 25, 2005
104
LT
When a blank record is appended, each field in the record is initially empty unless SET CARRY is ON. (c) online help.

Somehow the second part of it doesn't work for me. That is, CARRY is set to ON, and when I add a record in a BROWSE window, it's filled with fields I specify, but when I APPEND BLANK, it's empty. Is there a mistake in the help file, or am I doing something wrong?
 
That's, ahh, a different command. Nothing in common except name.
 

Kimed,

APPEND and APPEND [BLANK] are one and the same command, where BLANK is an optional keyword.
(Try to look up the Help on it while you are at it. :))

You are, probably, confusing it with APPEND FROM/APPEND GENERAL/APPEND MEMO, etc.


 
I *am* coming here directly from Help, you know.

APPEND opens an editing window so you can enter data into
new records. Any indexes that are open when APPEND is
executed are updated when the record is added.

BLANK
APPEND BLANK adds one blank record to the end of the
current table. An editing window isn't opened when you
issue APPEND BLANK. The faster INSERT - SQL command is
preferable.
That's *really* not the same thing. APPEND is purely for a manual input. APPEND BLANK is not. All I need is that APPEND BLANK followed what it's said in its own damn Help - add a record regarding SET CARRY ON. And opening an editing window I don't need at all.
 

Well, it does what it does (and like many other commands, it changes behaviour with use of different parameters and keywords - but does not become a different command yet).

For your purpose, try to use GO BOTTOM and then INSERT.

If this doesn't work, you can try SCATTER MEMVAR or otherwise create memory variables (I would prefer SCATTER MEMVAR NAME, but don't remeber in what version it first appeared). Then use INSERT-SQL, and list only the fields/values you need to insert.
 
Kimed,
in similar cases i prefer
...
scat memvar
appe blank
gath memvar,
...
therefore after changes in record structure
not need change code (insert sql need...)
Tesar
 

after changes in record structure not need change code

That's true. But this will insert values in all the fields, so if this what is needed, then it's a good solution.
Even then, I would leave out APPEND BLANK and go with

SCATTER MEMVAR
INSERT INTO MyTable FROM MEMVAR

In case when only some fields need to repeat values, similarly to what you would do with
SET CARRY TO field1, field2, field3
then you still need to list your fields (in INSERT-SQL, for example).

So if

GO BOTTOM
INSERT

doesn't work with SET CARRY ON (I suppose it might work, though), then I would go with

SCATTER MEMVAR
INSERT INTO MyTable (field1, field2, field3) VALUES (m.field1, m.field2, m.field3)



 
Let me try and clarify a little here.

Kimed,
That's, ahh, a different command. Nothing in common except name.
You're pretty much right.

Stella740pl,
APPEND and APPEND [BLANK] are one and the same command, where BLANK is an optional keyword.
Not quite.
APPEND is an interactive data entry commend similar to EDIT, CHANGE and BROWSE. It is a carryover from the old dBase functionality.
It brings up an EDIT (as opposed to BROWSE) window, where as you're paging through the records and get to the last record, pressing Page Down will automatically append a record. With CARRY set on, there is an internal SCATTER/GATHER happening so that when the record is added, it contains the same values as the prior record.
APPEND BLANK on the other hand, is usually a programmatic command to add a new record to the end of the table.

So, if you're interactively adding records maybe to just get some data in a table, APPEND may be the way to go. In order to simulate carryover programmatically or systematically, with a screen designed for a user, you would want to do a SCATTER MEMVAR or SCATTER FIELDS ... TO MEMVAR. You would then do an INSERT INTO or APPEND BLANK with a GATHER MEMVAR.

-Dave Summers-
[cheers]
Even more Fox stuff at:
 

Not quite.
APPEND is an interactive data entry commend similar to EDIT, CHANGE and BROWSE. It is a carryover from the old dBase functionality.
It brings up an EDIT (as opposed to BROWSE) window ...

Well, I know how it works.

All commands change their behaviour with use of different parameters and keywords. But they do have similar underlying functionality - appending a blank record to the end of the table - then present it differently. You would get different presentation, too, if you use a different set of options on BROWSE, or SELECT-SQL, or WAIT.

And even in my VFP6 Help they sit in the same article as APPEND [BLANK], and not in separate entries with a remark "Included for backward compatibility. Use such and such instead", like in the case with INSERT, and many others. But they are separated from APPEND FROM, say, as they are different.

That's what I mean. Or you can call it a judgement call.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top