[VXCMD] Cursor_AddRecords Bug

Ken Ray kray at sonsothunder.com
Thu Mar 20 11:00:15 CST 2003


I'm using the 1.9.7 VXCMD in MetaCard and it looks like
Cursor_AddRecords is removing a field from the end of each record. The
fields in the DB are:

FileAs: VarChar[504]
CompanyName: VarChar[504]
IsCompany: Boolean
Prefix: VarChar[504]
FirstName: VarChar[504]
LastName: VarChar[504]
Suffix: VarChar[504]
Title: VarChar[504]
Salutation: VarChar[504]
Marked: Boolean
MarkedBy: ULong
CreatedBy: ULong
CreateDate: DateTime
ModifiedBy: ULong
LastModified: DateTime
DeleteFlag: Boolean
ArchiveFlag: Boolean

I have an MC field (called "Data") with 3 lines of 17 tab-delimited
items to correspond to the 17 fields in my table with the following data
("[>]" means TAB, and some items are blank):

Angel, Dan[>]MyCompany[>]0[>][>]Dan[>]Angel[>][>][>]Dear
Dan,[>]0[>]0[>]0[>]6/8/2001 12:00:01[>]0[>]3/9/2002 12:00:01[>]0[>]0
Angel, Dan[>]MyCompany[>]0[>][>]Dan[>]Angel[>][>][>]Dear
Dan,[>]0[>]0[>]0[>]6/8/2001 12:00:01[>]0[>]3/9/2002 12:00:01[>]0[>]0
Angel, Dan[>]MyCompany[>]0[>][>]Dan[>]Angel[>][>][>]Dear
Dan,[>]0[>]0[>]0[>]6/8/2001 12:00:01[>]0[>]3/9/2002 12:00:01[>]0[>]0

Then I execute the following code to get a cursor and then put the
contents of the cursor into the "CursorData" field:

on mouseUp
  global dbRef
  put Valentina("Database_SQLSelect",dbRef,"SELECT * FROM ENTITIES")
into cursorRef
  get Valentina("Cursor_DeleteAllRecords",cursorRef)
  get Valentina("Cursor_SetBlank",cursorRef)
  get Valentina("Cursor_AddRecords,cursorRef,fld "Data")
  put Valentina("Cursor_GetRecords,cursorRef) into fld "CursorData" end
mouseUp

When I click the button, the "CursorData" field has these values:

Angel, Dan[>]MyCompany[>]FALSE[>][>]Dan[>]Angel[>][>][>]Dear
Dan,[>]FALSE[>]0[>]0[>]06/08/2001 12:00:01[>]0[>]03/09/2002
12:00:01[>]FALSE[>]FALSE
MyCompany[>]0[>]FALSE[>]Dan[>]Angel[>][>][>]Dear
Dan,[>]0[>]FALSE[>]0[>]6[>]00/00/2000 00:00:00[>]3[>]00/00/2000
00:00:00[>]FALSE[>]FALSE 0[>][>]FALSE[>]Angel[>][>][>]Dear
Dan,[>]0[>]0[>]FALSE[>]6[>]0[>]03/09/2002 12:00:01[>]0[>]00/00/2000
00:00:00[>]FALSE[>]FALSE

Line 1 was fine, but the first tab-delimited item was deleted from line
2, the first and second from line 3, etc.

Now when I do a repeat loop for each line in the "Data" field using
"Cursor_AddRecord" and do it one at a time, everything comes out fine. 

The data is tab-delimited between fields and return-delimited between
lines (the default delimiters). I'd prefer to use Cursor_AddRecords
because it's faster, but I can't at the moment.

Any idea why this is happening?

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 



More information about the Valentina mailing list