[Gambas-user] Object.Class(Me).Name and class name cases occassionally don't match
Fabien Bodard
gambas.fr at ...626...
Wed Oct 31 13:53:53 CET 2012
For Each wkclass In Classes
If Not IsNull(wkclass.Parent) Then
If object.type(wkclass.Parent) = "BaseBO" Then Print wkclass.Name
Endif
Next
2012/10/31 Bruce <bbruen at ...2308...>:
> I have a library which contains classes to analyse horse trial times.
> These classes rely on some files which contain some static data about
> the various analyses, these files are all called AbcZyx.meta where
> AbcXyz is the name of the relevant class (note the mixed case in both).
> When the first instance of any of these classes is created, it reads
> that associated file and sets up the static data.
>
> Somehow lately a strange thing has happened, one of the classes when it
> loads has it's name converted to lower case. All the others preserve
> the case of the class name.
>
> I've put the following trace into the early methods for some of the
> projects that use this library:
> Dim wkclass As Class
> For Each wkclass In Classes
> If Not IsNull(wkclass.Parent) Then
> If wkclass.Parent.Name = "BaseBO" Then Print wkclass.Name
> Endif
> Next
>
> and generally this is what I get vs the "real" class name:
> ClassNameloaded ClassNamereal
> --------------- --------------
> TrialSpeeds TrialSpeeds
> TrialSpeed1 TrialSpeed1
> TrialSpeed3 TrialSpeed3
> TrialSpeed2 TrialSpeed2
> TrackMap TrackMap
> TrackAltMap TrackAltMap
> Horse Horse
> trackname TrackName <------????
> Jockey Jockey
> Track Track
>
> So all of them, except TrackName have the expected class name.
>
> and when it tries to load the file via
> Dim sFilename as String
> Dim hMetaFile as File
> sFileName=Object.Class(Me).Name&".meta"
> Try hMetafile = Open $templatepath &/ sFileName For Input
> etc
> it fails, because of the case mismatching of the names.
>
> I have searched every file in the library project and all of the client
> projects and can not find any instance of the string "trackname". I
> have cleaned, recompiled etc etc each of these projects and this fail
> still occurs.
>
> Is there something special about a class called "TrackName"? It only
> ever happens for that class.
>
> Totally bewildered?
> Bruce
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Fabien Bodard
More information about the User
mailing list