--------
But that's not exactly what I want to do
The goal is to create a memo field as a sum of list fields
------------
Yes I understand that. But the error has nothing to do with cursoradaptor.
Having created the cursor that you show, if you execute your command:
SELECT a+b AS description,0.00 AS Price, "Ok" AS Buy FROM list
.. you will get the same error result.
------------
This code doesn't work
------------
If you add the UseMemoSize property that I suggested, you will not see the error.
Alternatively, in your real scenario, you would create an appropriate view and set appropriate properties on the view.
CREATE CURSOR List ( a m(1),b C(1))
SELECT List
APPEND BLANK
REPLACE A WITH SPACE(300)
APPEND BLANK
REPLACE A WITH SPACE(300)
oCursor = CREATEOBJECT("Products")
oCursor.cCursor = "List"
oCursor.UseMemoSize = 1
IF oCursor.CURSORFILL(.T.,.T.)
BROWSE
ELSE
aerror(laErrors)
messagebox(laErrors[2])
ENDIF
DEFINE CLASS Products AS cursoradapter
cCursor = ""
Alias = "PriceList"
SendUpdates = .F.
DataSourceType = "Native"
SelectCmd = [SELECT a+b AS description,0.00 AS Price, "Ok" AS Buy FROM (THIS.cCursor)]
cursorschema = "description M,prix Y,achat C(50)"
ENDDEFINE
>L<