Please read the help on READ. When you specify a string variable 's' with out a length then the string length byte is read first. So your string you are reading is probably 49 characters long and Im guessing the first is probably character 48 so it will only read 48 characters starting in the next position. -Fernando
---------- Original Message ----------- From: Ru Vuott <vu...@yahoo.it> To: gambas-user@lists.sourceforge.net Sent: Tue, 12 Nov 2013 11:08:59 +0000 (GMT) Subject: [Gambas-user] Questions about reading of a text file with "Read". > Hello, > > ...I would have specific questions about the reading of a text file with > "Read". > > I intend to read a text file in string representation using the classic > command > "Open For ... READ" > > Dim s As String > > Read #fluxus, s > Print s > > 1) Why don't I get the error "End of file", *only if* the file is composed of > number (amount) of characters NOT less than 49 ? > > 2) Why, even if the file is made up of a quantity of more than 49 characters, > are read *only* 48 characters ? > > 3) Why is not read the first character , but instead Read reads from the 2nd > to > the 49th character? > > Thanks > vuotttt > > p.s.: [System] > Gambas=3.5.90 > OperatingSystem=Linux > Kernel=3.8.0-19-generic > Architecture=x86_64 > Distribution=Linux Mint 15 Olivia > Desktop=GNOME > Theme=QCleanlooks > Language=it_IT.UTF-8 > Memory=1246M > > ------------------------------------------------------------------------------ > November Webinars for C, C++, Fortran Developers > Accelerate application performance with scalable programming models. Explore > techniques for threading, error checking, porting, and tuning. Get the most > from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk > _______________________________________________ > Gambas-user mailing list > Gambas-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gambas-user ------- End of Original Message ------- ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user