FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FRename bug
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
FRename bug
Posted: Wed Feb 11, 2009 09:35 AM
the error :

Application
===========
Path and name: C:\work\prg\UPDATE\actver.Exe (32 bits)
Size: 1,536,000 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 02/11/09, 10:33:34
Error description: Error BASE/1108 Argument error: AT
Args:
[ 1] = C :
[ 2] = U

Stack Calls
===========
Called from: => AT(0)
Called from: .\source\function\FILENAME.PRG => CFILENOPATH(0)
Called from: .\source\function\FILENAME.PRG => CFILENAME(0)
Called from: actver.prg => MAIN(8)







#include "FiveWin.Ch"

FUNCTION main(cFile)
//------------------------------
   LOCAL cFileName
   SysWait(.7)
   FErase(cFile)
   cFileName:=cFileName(cFile)
   FRename('tmp.exe',cFilename)
   WinExec( cFileName )
   PostQuitMessage(0)
   QUIT
RETURN NIL

FUNCTION RddSys(); RETURN NIL
Best Regards, Saludos



Falconi Silvio
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Re: FRename bug
Posted: Wed Feb 11, 2009 11:16 AM
Probably cFile is Empty, the error ocurrs in the function cFilename().
Add an If condtion reviewing if cFile not NIL.
#include "FiveWin.Ch"

FUNCTION main(cFile)
//------------------------------
   LOCAL cFileName
   IF cFile!=NIL //<======
       SysWait(.7)
       FErase(cFile)
       cFileName:=cFileName(cFile)
       FRename('tmp.exe',cFilename)
       WinExec( cFileName )
       PostQuitMessage(0)
       QUIT
    ELSE
        MsgStop("cFile c'ant be nil")
    ENDIF 
RETURN NIL
Saludos desde Mallorca
Biel Maimó
http://bielsys.blogspot.com/
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: FRename bug
Posted: Wed Feb 11, 2009 11:20 AM

Hello Silvio,

You have define cFile like "Test.txt"
I think, it works with this change.
As well use the function from Gabriel, to check, if the file exists.

cFileName:=cFileName( Chr(34) + cFile + Chr(34) )
or
cFileName:=cFileName( '"' + cFile + '"' ) // uses => ' " '

Regards
Uwe :lol:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion