Android Question A question about "Types"

Discussion in 'Android Questions' started by Roger Daley, Apr 22, 2015.

  1. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Hi All,

    I have been playing round with Klaus's "GPSExample" as a learning excercise. In trying something different I changed the Name part of this "Type" line:
    Type GPSLocation(Latitude As Double, Longitude As Double, Altitude As Double, Distance As Double, DistTot As Double, Time As Long, Speed As Float, Bearing As Float, Marker As Boolean)
    Type GeoLocation(Latitude As Double, Longitude As Double, Altitude As Double, Distance As Double, DistTot As Double, Time As Long, Speed As Float, Bearing As Float, Marker As Boolean)
    I then changed all occurences of GPSLocation to GeoLocation in all modules.

    When I run the code [Release] I get this error: Error.jpg

    When I run the code [Debug Legacy] I get this: Debug.jpg
    If I change the code back all runs OK.

    My understanding was that in defining a "Type" you assign a name, whether it is GPSLocation or GeoLocation should not matter.

    Can someone please explain in simple terms what it is I am missing.

    Regards Roger
  2. Erel

    Erel Administrator Staff Member Licensed User

    The name doesn't matter with one exception. When you serialize an object with RandomAccessFile the type name is saved to later you will be able to read the object. If the original name no longer exist then it will fail.
    Peter Simpson likes this.
  3. Roger Daley

    Roger Daley Well-Known Member Licensed User

    Thanks Erel,

    I will keep the original name and try to remember this one for the future.

    Regards Roger
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice