Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Runtime Error converting Array to FoxArray 16 Jun 2022 21:07 #22775

  • Alf
  • Alf's Avatar
  • Topic Author


  • Posts: 52
  • 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_ALF\UV_classes_109\Datadict.prg:Zeile 965.


    To reproduce this error, here a very simple test function:
    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

    Please Log in or Create an account to join the conversation.

    Runtime Error converting Array to FoxArray 17 Jun 2022 08:45 #22779

    • Chris
    • Chris's Avatar


  • Posts: 3750
  • 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?

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Runtime Error converting Array to FoxArray 17 Jun 2022 13:42 #22789

    • Alf
    • Alf's Avatar
    • Topic Author


  • Posts: 52
  • 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

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1