A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

parse all text after the last \



 
 
Thread Tools Display Modes
  #11  
Old October 30th, 2008, 08:09 PM posted to microsoft.public.access
Clifford Bass[_2_]
external usenet poster
 
Posts: 1,295
Default parse all text after the last \

Hi Klatuu,

Here is the C program I used (more or less) if it is any help to you.
I created three separate MDB files, one to test each method. In each MDB I
created the AutoExec macro to run the code and then quit out of Access.
Initially I had tested it in the reverse order and then had the thought you
had about order. The order did not seem to make any significant difference.
The Dir() method results did not surprise me because that does actual server
disk accesses and the other two methods do not. I expected your method to be
a little faster than using a FileSystemObject.

=================================================
// ProgramTimer.c

#include conio.h
#include process.h
#include stdio.h
#include time.h

int main(int argc, char* argv[])
{
clock_t clStart;
clock_t clEnd;
double dblSeconds;

clStart = clock();
_spawnl(_P_WAIT, "C:\\Program Files\\Microsoft
Office\\Office12\\MSACCESS.EXE", "MSACCESS.EXE",
"D:\\ProgSrcs\\Access\\TestMSR.mdb", NULL);
clEnd = clock();
dblSeconds = (double) (clEnd - clStart) / (double) CLOCKS_PER_SEC;
printf("\nSeconds elapsed using FileSystemObject.GetFileName() (10,000,000
iterations): %1.3f", dblSeconds);

clStart = clock();
_spawnl(_P_WAIT, "C:\\Program Files\\Microsoft
Office\\Office12\\MSACCESS.EXE", "MSACCESS.EXE",
"D:\\ProgSrcs\\Access\\TestMid.mdb", NULL);
clEnd = clock();
dblSeconds = (double) (clEnd - clStart) / (double) CLOCKS_PER_SEC;
printf("\nSeconds elapsed using Mid() and InStrRev() (10,000,000
iterations): %1.3f", dblSeconds);

clStart = clock();
_spawnl(_P_WAIT, "C:\\Program Files\\Microsoft
Office\\Office12\\MSACCESS.EXE", "MSACCESS.EXE",
"D:\\ProgSrcs\\Access\\TestDir.mdb", NULL);
clEnd = clock();
dblSeconds = (double) (clEnd - clStart) / (double) CLOCKS_PER_SEC;
printf("\nSeconds elapsed using Dir() (200,000 iterations): %1.3f",
dblSeconds);

printf("\n\nPress any key to exit....\n");
_getch();

return 0;
}

================================================== ===

Sincerely,

Clifford Bass

"Klatuu" wrote:

I will admit to being very surprised and puzzled as to how loading the fso
object and doing the disk access is faster than intrinsic functions.

Whether it would make any difference, I don't know, but in some similar
timing test (not involving fso) I found the results would vary depending on
the order in which the tests were executed. I found where the results were
very close between two of the three, the first test run would show a better
time than the second.

That is not to dispute your results, but rather to offer information for
validation.

Now I am compelled to set up my own testing using 2003.

Please understand my intention is not to argue, but to collaborate.


  #12  
Old October 30th, 2008, 10:00 PM posted to microsoft.public.access
Klatuu[_3_]
external usenet poster
 
Posts: 396
Default parse all text after the last \

Thanks

Did I understand you to say the fso does not require disk access?
How then does it get its directory and file information?

"Clifford Bass" wrote in message
...
Hi Klatuu,

Here is the C program I used (more or less) if it is any help to you.
I created three separate MDB files, one to test each method. In each MDB
I
created the AutoExec macro to run the code and then quit out of Access.
Initially I had tested it in the reverse order and then had the thought
you
had about order. The order did not seem to make any significant
difference.
The Dir() method results did not surprise me because that does actual
server
disk accesses and the other two methods do not. I expected your method to
be
a little faster than using a FileSystemObject.

=================================================
// ProgramTimer.c

#include conio.h
#include process.h
#include stdio.h
#include time.h

int main(int argc, char* argv[])
{
clock_t clStart;
clock_t clEnd;
double dblSeconds;

clStart = clock();
_spawnl(_P_WAIT, "C:\\Program Files\\Microsoft
Office\\Office12\\MSACCESS.EXE", "MSACCESS.EXE",
"D:\\ProgSrcs\\Access\\TestMSR.mdb", NULL);
clEnd = clock();
dblSeconds = (double) (clEnd - clStart) / (double) CLOCKS_PER_SEC;
printf("\nSeconds elapsed using FileSystemObject.GetFileName() (10,000,000
iterations): %1.3f", dblSeconds);

clStart = clock();
_spawnl(_P_WAIT, "C:\\Program Files\\Microsoft
Office\\Office12\\MSACCESS.EXE", "MSACCESS.EXE",
"D:\\ProgSrcs\\Access\\TestMid.mdb", NULL);
clEnd = clock();
dblSeconds = (double) (clEnd - clStart) / (double) CLOCKS_PER_SEC;
printf("\nSeconds elapsed using Mid() and InStrRev() (10,000,000
iterations): %1.3f", dblSeconds);

clStart = clock();
_spawnl(_P_WAIT, "C:\\Program Files\\Microsoft
Office\\Office12\\MSACCESS.EXE", "MSACCESS.EXE",
"D:\\ProgSrcs\\Access\\TestDir.mdb", NULL);
clEnd = clock();
dblSeconds = (double) (clEnd - clStart) / (double) CLOCKS_PER_SEC;
printf("\nSeconds elapsed using Dir() (200,000 iterations): %1.3f",
dblSeconds);

printf("\n\nPress any key to exit....\n");
_getch();

return 0;
}

================================================== ===

Sincerely,

Clifford Bass

"Klatuu" wrote:

I will admit to being very surprised and puzzled as to how loading the
fso
object and doing the disk access is faster than intrinsic functions.

Whether it would make any difference, I don't know, but in some similar
timing test (not involving fso) I found the results would vary depending
on
the order in which the tests were executed. I found where the results
were
very close between two of the three, the first test run would show a
better
time than the second.

That is not to dispute your results, but rather to offer information for
validation.

Now I am compelled to set up my own testing using 2003.

Please understand my intention is not to argue, but to collaborate.




  #13  
Old October 30th, 2008, 10:19 PM posted to microsoft.public.access
Clifford Bass[_2_]
external usenet poster
 
Posts: 1,295
Default parse all text after the last \

Hi Klatuu,

My statement was based on a test I happened to do with a non-existent
path and file. Something like:

MsgBox fso.GetFileName("C:\abc.def\ghi.jkl")

It returned "ghi.jkl". So it was just parsing the name--no disk access.

Clifford

"Klatuu" wrote:

Thanks

Did I understand you to say the fso does not require disk access?
How then does it get its directory and file information?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.