Subject Add variable As Table Field
From Norman Snowden <duluth@msn.com>
Date Sat, 02 Feb 2019 16:56:07 -0500
Newsgroups dbase.getting-started

Mervyn, this is an excerpt from Code that you furnished me on Jan, 26, 2019 at 7:12 am for preparing a Report. The Table Results.dbf is produced, however when I run the Form an Error msg comes up: "Variable Undefined BeginAppend"

Can you tell what I'm doing wrong? Thanks, Norman

** END HEADER -- do not remove this line
//
// Generated on 01/31/2019
//
parameter bModal
local f
f = new filltAbleForm()
if (bModal)
   f.mdi = false // ensure not MDI
   f.readModal()
else
   f.open()
endif

class filltAbleForm of FORM
   with (this)
      height = 16.0
      left = 82.5
      top = 0.0
      width = 40.0
      text = ""
   endwith

   this.RESULTS1 = new QUERY(this)
   with (this.RESULTS1)
      left = 32.0
      top = 11.0
      width = 6.0
      height = 1.0
      sql = 'select * from "C:\EXC\results.DBF"'
   *   active = true
   endwith

   this.PUSHBUTTON1 = new PUSHBUTTON(this)
   with (this.PUSHBUTTON1)
      onClick = class::PUSHBUTTON1_ONCLICK
      height = 1.0909
      left = 21.0
      top = 6.0
      width = 15.2857
      text = "Pushbutton1"
   endwith

   this.rowset = this.results1.rowset
  
        function PUSHBUTTON1_onClick()
    if file('results.dbf')
       drop table results
    endif
    if not file('results.dbf')
       create table results  (data character(100))
    endif
    q = new query()
    q.sql = 'select * from results'
    q.active = true
  
    local cline
        
    cLine = "Snowden"  
    q.beginAppend();q.rowset.fields['data'].value = cLine; q.rowset.save()
    q.rowset.save()
          
          
   return  

endclass