Write to a file

Write to a file

Postby Wolfgang Ciriack » Thu Sep 18, 2008 1:59 pm

Hallo,

i use the following:

Code: Select all  Expand view  RUN
#define DIR_LEIST  "\My Documents\FvwMobil\Leistung\"
#define GID  "3C0019"

ExpStr:="Blablabla"
f:=DIR_LEIST+GID+"A"+alltrim(auftrag->aufnum)+"_"+nr+".txt"

memowrite(f,ExpStr)     


and this works very well. Why does the following not work ?
(i must get the file without the addional chr of memowrite)
It always end in "Error creating".

Code: Select all  Expand view  RUN
nH:=FCreate( f , 0 )
if nH>0
   n:=FWrite(nH,ExpStr)
   if n=0
      MsgInfo("Error writing to  "+f)
   else
      retw:=.T.
   endif   
   FClose(nH)
else
   MsgInfo("Error creating "+f)
endif

Best regards
Wolfgang Ciriack
Wolfgang Ciriack
 
Posts: 37
Joined: Sun Aug 03, 2008 8:02 am
Location: Germany, Berlin

Re: Write to a file

Postby Enrico Maria Giordano » Thu Sep 18, 2008 2:58 pm

Try

Code: Select all  Expand view  RUN
if nH != -1


and check the correctness of the filename.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Wolfgang Ciriack » Thu Sep 18, 2008 5:23 pm

if nH != -1


That is sooooo simple, that i didnot see this - and i looked 50 times to that piece of code.... :evil: :oops: :evil:

Thanks a lot.
Best regards
Wolfgang Ciriack
Wolfgang Ciriack
 
Posts: 37
Joined: Sun Aug 03, 2008 8:02 am
Location: Germany, Berlin


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 10 guests