Runtime Error converting Array to FoxArray

This forum is meant for questions and discussions about the X# language and tools
Post Reply
User avatar
Alf
Posts: 54
Joined: Wed Dec 30, 2020 10:04 am

Runtime Error converting Array to FoxArray

Post by Alf »

Hi to all,
today I moved to 2.12.2.0. After compiling one of my appls, I get this runtime error:
System.InvalidCastException: Das Objekt des Typs "XSharp.__Array" kann nicht in Typ "XSharp.__FoxArray" umgewandelt werden.
bei UV_classes_109.Functions.TEST(__Usual[] Xs$Args) in C:X_ALFUV_classes_109Datadict.prg:Zeile 965.


To reproduce this error, here a very simple test function:

Code: Select all

FUNCTION TEST() AS VOID
	
	LOCAL a AS ARRAY
	LOCAL n1, n2 AS DWORD
	
	a := { { "Alf", 1000 }, { "Bill", 2000 }, { "Dick", 3000 } }
	n1 := ALen( a )
// Next line causes my runtime error
	n2 := ALen( a[1] )	

RETURN
Obviously, the error is in context with a two dimension array....

Sorry for my stupidity, if this problem - and the solution - should be well known. :)

Regards
Alf
User avatar
Chris
Posts: 4905
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Runtime Error converting Array to FoxArray

Post by Chris »

Hi Alf,

You must be using the VFP (FoxPro) dialect in your project and/or have a reference to XSharp.VFP in it.
Is that intentional, or by accident?

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Alf
Posts: 54
Joined: Wed Dec 30, 2020 10:04 am

Runtime Error converting Array to FoxArray

Post by Alf »

Hi Chris,
thanks. My problem is solved. Background information: I never used FoxPro dialect, only VO dialect. A reference to XSharp.VFP has been set (I don't know anymore why I did this - may be 20 years ago). Now I deleted this reference and now it works.
Alf
Post Reply