>> also,
>>when I APPEND BLANK,
>> the record pointer to going to the last record instead of adding a blank
>> record at the end. Do you know why? thanks
>Robert,
>
>APPEND BLANK will add a blank record to the currently selected work area and position the record pointer on that new record. If you are seeing something different than this it is something in your code that is doing it. It may be that you had the wrong work area selected when you appended the blank record or that some other line of code is moving the record pointer after your append blank. The only way to debug this code would be to see all of it, that is what lines of code are around the append blank, what controls are affecting the alias that is getting the blank record, is that alias buffered, etc..
Here it is - and my only problem is when I APPEND BLANK, the record pointer
moves to the last records instead of adding a blank record to the end of the
table. ( this code is from the classbroswer, I left out the ADD OBJECTS)
DEFINE CLASS form1 AS form
Top = 0
Left = 0
Height = 250
Width = 413
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
PROCEDURE Init
set talk off
public m_add_mode
m_add_mode = .f.
set dele on
ENDPROC
PROCEDURE Unload
scan for empty(name)
blank
dele
endscan
goto top
ENDPROC
PROCEDURE cmdadd.Click
thisform.txtname.visible=.t.
thisform.combo1.visible=.f.
thisform.cmdsave.visible = .t.
thisform.cmdabort.visible = .t.
*select rob
scan for empty(name)
blank
dele
endscan
goto top
set dele off
loca for deleted()
if found()
m_add_mode = .f.
blank
recall
else
m_add_mode = .t.
append blank
endif
set dele on
thisform.refresh
thisform.txtname.setfocus
ENDPROC
PROCEDURE cmdsave.Click
* if nothing in fields
* than nothing is saved
thisform.txtname.visible=.f.
thisform.combo1.visible=.t.
thisform.cmdsave.visible = .f.
thisform.cmdabort.visible = .f.
if m_add_mode = .t.
m_add_mode = .f.
* =tableupdate(.t.)
* =tablerevert(.f.)
endif
*thisform.combo1.requery()
ENDPROC
PROCEDURE cmdabort.Click
*@10,1 say space(25)
*@12,1 say space(25)
*@1,1 say m_add_mode
thisform.txtname.visible=.f.
thisform.combo1.visible=.t.
thisform.cmdsave.visible = .f.
thisform.cmdabort.visible = .f.
blank
dele
if m_add_mode = .t.
m_add_mode = .f.
* delete
* = tablerevert(.t.)
* = tableupdate(.f.)
*else
* blank
* dele
endif
ENDPROC