Page 1 of 1

The folder class

Posted: Fri Aug 07, 2009 10:46 am
by ConvertFromOldNGs
by JADE Kid - Ray Hidayat >> Sun, 14 Jan 2001 3:27:22 GMT

The folder class should have a method which can recall its name and set the name property of the fileFolder object. Don't you often find that you just want the name of the file, and not the full path?

--
Ray Hidayat
JADE Kid - 2000
www.jadekids.com

Re: The folder class

Posted: Fri Aug 07, 2009 10:46 am
by ConvertFromOldNGs
by Abduhl >> Sun, 14 Jan 2001 9:56:09 GMT
The folder class should have a method which can recall its name and set the name property of the fileFolder object. Don't you often find that you just want the name of the file, and not the full path?

Take a look at the attribute FileNode::name, it should do the job.

Re: The folder class

Posted: Fri Aug 07, 2009 10:47 am
by ConvertFromOldNGs
by JADE Kid - Ray Hidayat >> Sun, 14 Jan 2001 10:19:08 GMT

That property only works when using the FileFolder::files method. It says that in the help file.

--
Ray Hidayat
JADE Kid - 2000
www.jadekids.com

Re: The folder class

Posted: Fri Aug 07, 2009 10:47 am
by ConvertFromOldNGs
by Robert Barr >> Sun, 14 Jan 2001 21:18:28 GMT
That property only works when using the FileFolder::files method. It says that in the help file.


How about this mapping method on FileNode? If FileNode.name() does not return the unqualified filename (without the path), then it is derived from the fileName property.


name(set: Boolean; _value: String io) mapping;

vars
idx : Integer;begin

if _value = "" and fileName <> "" then
idx := fileName.reversePos("\");
if idx <> 0 then
_value := fileName[idx+1:end];
endif;
endif;
end;

Re: The folder class

Posted: Fri Aug 07, 2009 10:47 am
by ConvertFromOldNGs
by Richard Mitchell >> Mon, 15 Jan 2001 0:49:08 GMT

or if you have CardSchema, use the cnGetSimpleFileName method.

Re: The folder class

Posted: Fri Aug 07, 2009 10:47 am
by ConvertFromOldNGs
by JADE Kid - Ray Hidayat >> Mon, 15 Jan 2001 5:07:45 GMT

I haven't got CardSchema yet. I should soon. I just keep on forgetting about it.

--
Ray Hidayat
JADE Kid - 2000
www.jadekids.com