Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: khubaib khalid
  Where is khubaib khalid?
 HaroonAbad
 Pakistan
 khubaib khalid
 Tags
Subject: RE: copy to text
Thread ID: 228326 Message ID: 228337 # Views: 1 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: General VFP Topics
Date: Monday, May 18, 2009 11:10:59 AM         
   


> >
> >
handle = fcreate('myTxt.txt')
> > select myTable
> > scan
> >  if recno() > 1
> >     fwrite(m.handle, ',')
> >  endif
> >  fwrite( m.handle, ltrim(str( myTable.myNumField )))
> > endscan
> > fclose(m.handle)

> >
> > Cetin Basoz
> >
> > .Net has got better.Think about moving - check my blog:
> > Blog (main)
> > Blog (mirror)
>
> Cetin i error my be in this line fwrite( m.handle, ltrim(str( myTable.myNumField )))
> please see again thanks

I don't understand what you are saying. What error? Are you sure you have a table named 'myTable' with a numeric field named 'myNumField'? Or did you adjusted the table and fieldnames for your own table and field? ie: This works for me w/o any error:

select quantity as myNumField ;
   from (_samples+'data\orditems') into cursor myTable nofilter

handle = fcreate('myTxt.txt')
select myTable
scan
  if recno() > 1
     fwrite(m.handle, ',')
  endif
  fwrite( m.handle, ltrim(str( myTable.myNumField )))
endscan
fclose(m.handle)
modify file ('myTxt.txt')


Cetin Basoz

.Net has got better.Think about moving - check my blog:
Blog (main)
Blog (mirror)

ENTIRE THREAD

copy to text Posted by khubaib khalid @ 5/18/2009 10:39:26 AM
RE: copy to text Posted by Yousfi Benameur @ 5/18/2009 10:50:05 AM
RE: copy to text Posted by Cetin Basoz @ 5/18/2009 10:50:46 AM
RE: copy to text Posted by khubaib khalid @ 5/18/2009 11:02:41 AM
RE: copy to text Posted by Cetin Basoz @ 5/18/2009 11:10:59 AM
RE: copy to text Posted by khubaib khalid @ 10/4/2009 5:40:09 AM
RE: copy to text Posted by Stefan Wuebbe @ 5/18/2009 10:53:17 AM
RE: copy to text Posted by Anders Altberg @ 10/4/2009 3:40:39 PM
RE: copy to text Posted by khubaib khalid @ 10/4/2009 4:18:21 PM