FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Write to a file
Posts: 37
Joined: Sun Aug 03, 2008 08:02 AM
Write to a file
Posted: Thu Sep 18, 2008 01:59 PM
Hallo,

i use the following:

#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".

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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Write to a file
Posted: Thu Sep 18, 2008 02:58 PM
Try

if nH != -1


and check the correctness of the filename.

EMG
Posts: 37
Joined: Sun Aug 03, 2008 08:02 AM
Write to a file
Posted: Thu Sep 18, 2008 05:23 PM

if nH != -1


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

Thanks a lot.
Best regards

Wolfgang Ciriack

Continue the discussion