[Gambas-user] Problem with .Remove (1.0.14)
Benoit Minisini
benoit.minisini at ...2...
Tue Mar 7 17:54:11 CET 2006
On Tuesday 07 March 2006 10:10, Eilert wrote:
> Sorry guys for bothering you, just happened to find the bug:
> > IF termine.Count > 1 THEN
> > termine.Remove(position)
> > OPEN pfad &/ datei FOR WRITE AS #dtnr
> > FOR i = 0 TO termine.Count - 1
> > PRINT #dtnr, termine[i]
> > NEXT
> > CLOSE #dtnr
>
> This should read FOR WRITE CREATE instead, otherwise the old file is
> simply overwritten up to the point it is used for the new data, the rest
> simply remains. To me, this is kinda unusual behaviour for BASIC - we
> should at least place a warning for Gambas newbies at the wiki side,
> shouldn't we?
>
> Rolf
>
It is not unusual, in the sense that the semantic of opening a file for
writing in Unix does not overwrite the file.
And I don't know if it is unusual in a BASIC language, as there is no standard
syntax, nor behaviour.
But it should be more explicit on the wiki for sure.
Regards,
--
Benoit Minisini
More information about the User
mailing list