this is a though one ... I 'll try to explain how you can solve the problem.
When using the virtual table file you can show entries of a certain folder by setting a filter on the 'path' field.
Example : suppose you have a folder 'data' on drive C. Then you can write :
setrange(path,'c:\data');
Now if you want to get it updated after an action of a user (or you implement a 'refresh' button) you should use :
setrange(path,'c:\data\');
in fact you should allways switch between a filter with a backslash on the last position or not ... put it in a little algorithme :
- test for the last position,
- if this is a backslash then remove the backslash and apply the filter again
- if this is a another char. add the backslash and apply the filter again
Hope this works,
LVDE
[This message has been edited by Ludo (edited 25-02-2000).]
Yes,it works really fine. <img border="0" title="" alt="" src="images/smiles/icon_wink.gif" />
Thanks.
OnPreDataItem()
IF slash THEN
BEGIN
FileTable.RESET;
FileTable.SETRANGE(FileTable."Is a file", TRUE);
FileTable.SETRANGE(FileTable.Path, StrPath + '\');
END
ELSE
BEGIN
FileTable.RESET;
FileTable.SETRANGE(FileTable."Is a file", TRUE);
FileTable.SETRANGE(FileTable.Path, StrPath);
END;
This is indeed a nice trick.
But what if you don't have a path ?
The update works fine if you change between 'c:\data' and 'c:\data\'.
But what if i want to update the view on the root directory ?
It doesn't work with 'c:\' and 'c:' because if you omit the path navision defaults to the current directory.
How do i solve thisone ?
Comments
Dennis van Es
PerCom: Research & Development BV
The Netherlands
Qwinsoft BV
The Netherlands
this is a though one ... I 'll try to explain how you can solve the problem.
When using the virtual table file you can show entries of a certain folder by setting a filter on the 'path' field.
Example : suppose you have a folder 'data' on drive C. Then you can write :
setrange(path,'c:\data');
Now if you want to get it updated after an action of a user (or you implement a 'refresh' button) you should use :
setrange(path,'c:\data\');
in fact you should allways switch between a filter with a backslash on the last position or not ... put it in a little algorithme :
- test for the last position,
- if this is a backslash then remove the backslash and apply the filter again
- if this is a another char. add the backslash and apply the filter again
Hope this works,
LVDE
[This message has been edited by Ludo (edited 25-02-2000).]
setrange(path,'c:\data\');
<HR></BLOCKQUOTE>
Wow, what a nice trick!
Good work Ludo.
[This message has been edited by Luc Van Dyck (edited 25-02-2000).]
Thanks.
OnPreDataItem()
IF slash THEN
BEGIN
FileTable.RESET;
FileTable.SETRANGE(FileTable."Is a file", TRUE);
FileTable.SETRANGE(FileTable.Path, StrPath + '\');
END
ELSE
BEGIN
FileTable.RESET;
FileTable.SETRANGE(FileTable."Is a file", TRUE);
FileTable.SETRANGE(FileTable.Path, StrPath);
END;
OnAfterGetRecord()
dportPathFile.FILENAME(StrPath + '\' + FileTable.Name);
dportPathFile.RUN;
But what if you don't have a path ?
The update works fine if you change between 'c:\data' and 'c:\data\'.
But what if i want to update the view on the root directory ?
It doesn't work with 'c:\' and 'c:' because if you omit the path navision defaults to the current directory.
How do i solve thisone ?
Rgds
Benny
Benny Giebens