Michael Van Canneyt wrote:


On Sat, 30 May 2009, Robert wrote:

I tried to use current http://code.google.com/p/python4delphi with
Lazarus. Did somebody use P4D successfully with recent Lazarus?
Patches? I face a few problems.


What about this problem, and what could be a workaround?
http://code.google.com/p/python4delphi/source/browse/trunk/PythonForDelphi/Components/Sources/Core/VarPyth.pas


### from variants.pp #########
procedure TCustomVariantType.VarDataClear(var Dest: TVarData);

begin
   NotSupported('TCustomVariantType.VarDataClear');
end;
...
#########################

I implemented some methods in TCustomVariantType (subversion of today), but there are still quite some missing. Please test to see if it gets you any further.


thanks, I took&compiled only the new variants.pp into the RTL

Then VarPyth.Import worked and walking/calling the Python object tree works now.
But any assignments to or from Python and argument passing fail.

 pp := Import('pp');
 pp.x.y();     // works!
 i := pp.f();  // EVariantTypeCastError (i:Integer or LongInt)
 pp.a := 99;   // TCustomVariantType.RaiseDispError not supported
 pp.f(6);      // TCustomVariantType.RaiseDispError not supported


Does it help to take more of current SVN ? or a principal problem with Typecasts?

Robert


#0 fpc_raiseexception at :0
#1 VARUTILS_VARIANTTYPEMISMATCH$WORD$WORD at :0
#2 VARUTILS_VARIANTTOLONGINT$TVARDATA$$LONGINT at :0
#3 VARIANTS_SYSVARTOINT$VARIANT$$LONGINT at :0
#4 SYSTEM_assign$VARIANT$$LONGINT at :0
#5 ?? at :0
#6 TFORM1__FORMCREATE(0x12a4b8, 0x12a4b8) at main.pas:114
#7 TCUSTOMFORM__DOCREATE(0x12a4b8) at customform.inc:659
#8 TCUSTOMFORM__CREATE(0xf6308, 0x0, 0x12a4b8) at customform.inc:1448
#9 TFORM__CREATE(0xf6308, 0x1, 0x12a4b8) at customform.inc:2202
#10 TAPPLICATION__CREATEFORM(<incomplete type>, void, 0xf6308) at application.inc:1837


#0 fpc_raiseexception at :0
#1 VARIANTS_NOTSUPPORTED$ANSISTRING at :0
#2 VARIANTS_TCUSTOMVARIANTTYPE_$__RAISEDISPERROR at :0
#3 PARSEPARAM(0, 0x7fb74) at VarPyth.pas:1056
#4 TPYTHONVARIANTTYPE__DODISPINVOKE(0x0, {VTYPE = 527, RES1 = 0, RES2 = 0, RES3 = 0, VSMALLINT = 22640, VINTEGER = 743536, VSINGLE = 1.04191585e-039, VDOUBLE = 3.6735559404621709e-318, VCURRENCY = 743536, VDATE = 3.6735559404621709e-318, VOLESTR = 0xb5870, VDISPATCH = 0xb5870, VERROR = 743536, VBOOLEAN = true (22640), VUNKNOWN = 0xb5870, VSHORTINT = 112, VBYTE = 112, VWORD = 22640, VLONGWORD = 743536, VINT64 = 743536, VQWORD = 743536, VWORD64 = 743536, VSTRING = 0xb5870, VANY = 0xb5870, VARRAY = 0xb5870, VPOINTER = 0xb5870, VRECORD = 0xb5870, PRECINFO = 0x0, VLONGS = {0, 743536, 0}, VWORDS = {0, 0, 0, 22640, 11, 0, 0}, VBYTES = #0#0#0#0#0#0'pX'#11#0#0#0#0}, 0x571e88, 0x7fc44, 0xaed48) at VarPyth.pas:1106 #5 TPYTHONVARIANTTYPE__DISPINVOKE(0x0, {VTYPE = 527, RES1 = 0, RES2 = 0, RES3 = 0, VSMALLINT = 22640, VINTEGER = 743536, VSINGLE = 1.04191585e-039, VDOUBLE = 3.6735559404621709e-318, VCURRENCY = 743536, VDATE = 3.6735559404621709e-318, VOLESTR = 0xb5870, VDISPATCH = 0xb5870, VERROR = 743536, VBOOLEAN = true (22640), VUNKNOWN = 0xb5870, VSHORTINT = 112, VBYTE = 112, VWORD = 22640, VLONGWORD = 743536, VINT64 = 743536, VQWORD = 743536, VWORD64 = 743536, VSTRING = 0xb5870, VANY = 0xb5870, VARRAY = 0xb5870, VPOINTER = 0xb5870, VRECORD = 0xb5870, PRECINFO = 0x0, VLONGS = {0, 743536, 0}, VWORDS = {0, 0, 0, 22640, 11, 0, 0}, VBYTES = #0#0#0#0#0#0'pX'#11#0#0#0#0}, 0x571e88, 0x7fc44, 0xaed48) at VarPyth.pas:942
#6 VARIANTS_SYSDISPINVOKE$PVARDATA$TVARDATA$PCALLDESC$POINTER at :0
#7 fpc_dispinvoke_variant at :0
#8 TFORM1__FORMCREATE(0x12a4b8, 0x12a4b8) at main.pas:115
#9 TCUSTOMFORM__DOCREATE(0x12a4b8) at customform.inc:659
#10 TCUSTOMFORM__CREATE(0xf6308, 0x0, 0x12a4b8) at customform.inc:1448
#11 TFORM__CREATE(0xf6308, 0x1, 0x12a4b8) at customform.inc:2202
#12 TAPPLICATION__CREATEFORM(<incomplete type>, void, 0xf6308) at application.inc:1837




_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to