[Gambas-user] integer / string file IO issue

Beren Scott berenscott at ...1979...
Sat Jun 6 14:41:29 CEST 2009


On Sat, 2009-06-06 at 14:11 +0200, Benoît Minisini wrote:
> > On Fri, 2009-06-05 at 20:01 +0200, Benoît Minisini wrote:
> > > > This one has been making me pull hair out :P
> > > >
> > > > On Fri, 2009-06-05 at 10:06 +0200, Benoît Minisini wrote:
> > > > > > I am sending the project source.
> > > > >
> > > > > Can you send the exact *.dat file too?
> > >
> > > Well, everything works correctly and as expected on my machine, both with
> > > Gambas 2 and the development version.
> > >
> > > Which version of Gambas do you use? I suggest that you upgrade to the
> > > latest one.
> > >
> > > Regards,
> >
> > Am running version 2.13 now, compared to previously 2.7, though the
> > problem is still there. Is there any way to remove this error?
> >
> > Beren Scott
> >
> 
> Are you sure that you sent me exactly the same code and data files as you run? 
> Can you send me an archive of the project instead of just the module? Can you 
> give more details about your system: which OS, distribution, CPU...?
> 
> If possible, can you grant me an ssh access to your machine so that I debug 
> directly on it?
> 

I'll describe the events exactly as they occured. This was originally
running version 2.7 due to that being what was available on apt-get. I
was typing away at the code, and the problem which occured was, whilst
typing the command:

   INPUT #ff, farmid[a - 1], farmx[a - 1], farmy[a - 1], farmwo[a - 1],
farmcl[a - 1], farmir[a - 1], farmwh[a - 1], farmdd[a - 1], farmmm[a -
1], farmyyyy[a - 1], farmhh[a - 1] 

Each time I would place the "-" the cursor would for some reason appear
on the left of the "-" I had just placed, so then I would scroll over it
and place the "1" next to it, and the same thing would occur. I have no
idea why it was doing it, but sure enough, by the end of the code, this
line was the exact line that was giving up the error.

The interesting thing is, it isn't always the line that throws up the
type mismatch, sometimes it occurs earlier on in the code on the vf.dat
file. It occurs sometimes, but not always.

I have upgraded to version 2.13 and the code still stops at that line.

I changed all the integers to strings or varients, and put in val() into
the command:

farmmx[a - 1] = Max(Max(Val(farmwo[a - 1]), Val(farmcl[a - 1])),
Max(Val(farmcl[a - 1]), Val(farmir[a - 1])))

Now, this line is the one it stops on. Now, I just don't get it, the
text file has absolutely nothing but numbers in it, yet it's getting
strings and not integers and unless there is some hidden text burried
within the text file that doesn't appear in an editor, I'm damned if I
can understand this issue.

The OS is debian lenny, cpu is amd64.

I am at a loss to understand the problem, it defeats my logic.

Beren Scott





More information about the User mailing list