Hello,
I have to delete a file in a full path position, for example,
'C:\Documents and Settings\pippo\Documenti\WindowsCE My DocumentsReadings.txt'
I have the error Syntax error and the file is not deleted.
Trying to make a message with 'C:\Documents and Settings\pippo\Documenti\WindowsCE My DocumentsReadings.txt' I see that slash are considered as line feeds. I don't know if this is the real problem but I ask you how the syntax of the full path should be.
Thank you
0
Comments
http://www.BiloBeauty.com
http://www.autismspeaks.org
Dataport - OnPostDataport()
MESSAGE('C:\Documents and Settings\pippo\Documenti\WindowsCE My Documents\Readings.txt');
IF ERASE('C:\Documents and Settings\pippo\Documenti\WindowsCE My DocumentsReadings.txt') THEN
MESSAGE('Pesature importate e file cancellato')
ELSE BEGIN
MESSAGE('Errore nella cancellazione del file: ' + GETLASTERRORTEXT);
CLEARLASTERROR;
END
---
I have syntax error also writing
IF ERASE(CurrDataport.FILENAME) THEN
MESSAGE('OK')
ELSE BEGIN
MESSAGE('Error: ' + GETLASTERRORTEXT);
CLEARLASTERROR;
END
Thank you
message('%1',MyTextConstant);
see pic
http://www.BiloBeauty.com
http://www.autismspeaks.org
ERASE = false and GETLASTERROR = '' blank...What is the problem? Navision can not delete the folder of Active Sync syncronized with the PDA?
Thank you
but I would like to read the path from a variable field...Isn't it possible?
erase(MyVar);
I doubt it will ever not be OK unless something wierd is happening.
in regards to syntax - you should always post your error message - it helps alot
looks like you're doing an else begin without a then begin
Does it work without a close????
CurrFile.CLOSE;
Personally I like to use a confirm message
What mine does is delete the orig file from it's orig location but saves a copy in another folder called 'Completed Imports' using the date as it's new name.
filepath= I:\Internet Data Feed\Completed Import\
each person does it there own way (here's the same code without the bells n' whistles)
http://www.BiloBeauty.com
http://www.autismspeaks.org
I return on a my previous post that was solved more than 3 years ago.
Now I have again the problem on another development/customer.
I pass all the full path + file name to function ERASE but FILE.ERASE return false and don't delete the file.
I cannot insert the entire name of the file in a text constant because:
- the full path is a setup table so can be changed and edited
- the name of the file is variable because the file in the directory have name that continues to change (with a progressive number).
So I ask you how I can solve this in a clever way.
Thank you
In NAV 5.0 sp1 there is not FILE.CLOSE function?
Thank you