[Gambas-user] save and load an array of MydataType

Fernando Gonzalez fagonzalez at ...760...
Fri Jan 7 13:12:02 CET 2005


-----Mensaje original-----
De: gambas-user-admin at lists.sourceforge.net
[mailto:gambas-user-admin at lists.sourceforge.net] En nombre de Jochen Georges
Enviado el: Jueves, 06 de Enero de 2005 10:07 p.m.
Para: gambas-user at lists.sourceforge.net
Asunto: Re: [Gambas-user] save and load an array of MydataType

On Thursday 06 January 2005 16:19, Benoit Minisini wrote:
> On Thursday 06 January 2005 12:59, Jochen Georges wrote:
> > Hello gambanauts,

> FOR i = 0 TO arCars.Count - 1
>   arCars[i].writeTo(myFile)
> NEXT
Try eof() in DO .. LOOP Loop

Fernando

> should behave correctly.

Thanks, but still i do not have an idea how i can load this array from a
file 
if i do not know how many items it contains.

 i AS Integer
    myFile AS File
    newCars AS Object[]
    tmpcar AS CCar
    newCars = NEW Object[]
    FOR i = 0 TO cnt // if i do not know cnt ...
        tmpcar = NEW CCar
        newCars.add(tmpcar)
    NEXT
    IF Dialog.OpenFile() THEN RETURN
        TRY OPEN dialog.Path FOR READ AS myFile
            FOR i = 0 TO cnt
                newCars[i].ReadFrom(myFile)
            NEXT
        CLOSE myFile


> Why ?? Can you rollback these changes, so that functions and instructions
> keep separate ?

I took it back.

> Or we can mix them all. But there must be some logic...

I would appreciate this.
I think it is easier to have it in one sight.
Maybe like this
<h1>File Management</h1>
<h2>Keywords</h2>
 COPY
 KILL
 LINK
<h2>Functions</h2>
 Access
 Dir
 Exist



Beste Gruesse
Jochen




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Gambas-user mailing list
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list