re open and read commands

fp at casabellagallery.com fp at casabellagallery.com
Sat Dec 1 19:43:48 PST 2007


Mike posted:

> I figured I would have to loop the processing but how do I tell it to go to 
> the next line. I just need to be able to bring each line into a variable one at a time.
> 
> the show command  just keeps showing the first line. 
> 
> 
> 
> this is what the .txt file looks like
> aab_fb1020.jpg
> aab_fb612.jpg
> aab_fb615.jpg
> aab_fb815.jpg
> aab_fb820.jpg
> AFR_ebsab.jpg
> AFR_ebsag.jpg
> AFR_ebsar.jpg
> 
> this is what processing table looks like
> 
> 
>   1  -------   -   -   -   -   -   -   -   -   -
> start   If:
>        Then: xx(1,*,g)
>   2  -------   -   -   -   -   -   -   -   -   -
>         If:
>        Then: declare local handle(8,.0)
>   3  -------   -   -   -   -   -   -   -   -   -
>         If:
>        Then: declare local txt
>   4  -------   -   -   -   -   -   -   -   -   -
> @wlfxx  If:
>        Then: aa="c:/jpglist.wri"
>   5  -------   -   -   -   -   -   -   -   -   -
>         If:
>        Then: handle=open(aa,"rt")
>   6  -------   -   -   -   -   -   -   -   -   -
>         If: handle le "0"
>        Then: errorbox"unable to open file:"<aa;exit
>   7  -------   -   -   -   -   -   -
>         If:
>        Then: i="40"
>   8  -------   -   -   -   -   -   -
>   read    If:
>        Then: x=readline(handle,txt,i)
>   9  -------   -   -   -   -   -   -
>         If:
>        Then: show"@"<txt
>   10  -------   -   -   -   -   -   -
>         If: x eq "0"
>        Then: x=close(handle)
>   11  -------   -   -   -   -   -   -
>         If:
>        Then: goto read<hr>_______________________________________________

Have you given some thought to what I suggested?  Give these lines of code
a shot and see what happens ...

  1  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
loop   ? If:                                                                   ?
       Then: import ascii ifile = c:/jpglist.wri r=\n                          ?
  2  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ? If: not ifile                                                         ?
       Then: show "@Done!"; exit                                               ?
  3  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ? If:                                                                   ?
       Then: show "@"&ifile(1)                                                 ?
  4  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
       ? If:                                                                   ?
       Then: goto LOOP                                                         ?
  5  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -

Of course, make sure to place them where needed ...

Regards,


---
Jose Lerebours
954  559  7186
http://www.fpgroups.com



More information about the Filepro-list mailing list