Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursor adaptor - string is too long to fit .. in a memo
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00852723
Message ID:
00852792
Vues:
7
Tks for your reply

Yes list comes from a query and I am ok with your suggestion this code will run
CREATE CURSOR  List ( a m(1))

SELECT List 
APPEND BLANK 
REPLACE A WITH SPACE(300)
APPEND BLANK 
REPLACE A WITH SPACE(300)


oCursor = CREATEOBJECT("Products")
oCursor.cCursor = "List"

IF oCursor.CURSORFILL(.T.,.F.) && 1° param. to use CursorSchema, 2° to create an empty CA because I dont have the native table for test
	BROWSE 
ELSE
	aerror(laErrors)
	messagebox(laErrors[2])
ENDIF 

DEFINE CLASS Products AS cursoradapter 

	cCursor = ""

	Alias = "PriceList"
	SendUpdates = .F.
	DataSourceType = "Native"

	SelectCmd = [SELECT a AS description,0.00 AS Price, "Ok" AS Buy FROM (THIS.cCursor)]

	cursorschema = "description M,prix Y,achat C(50)"

ENDDEFINE
But that's not exactly what I want to do
The goal is to create a memo field as a sum of list fields

This code doesn't work
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"

IF oCursor.CURSORFILL(.T.,.F.) && 1° param. to use CursorSchema, 2° to create an empty CA because I dont have the native table for test
	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
Tks again
Marcel


>Look: forgetting the limited example you're showing, you are probably in one of two situations...
>
>1) List is a native cursor in which case there isn't any reason why the original column in the cursor can't be M rather than C as Peter showed you
>
>2) List comes from somewhere else, a query from some external source, in which case you can do something like the following to ensure the correct results:
>
>DBSETPROP('List.a','FIELD','DataType','M')
>
>or
>
>CURSORSETPROP("UseMemoSize",1)
>
>... right? What am I missing?
>
>>L<
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform