#62278 - 2002-01-19 08:25 AM
UDF - DIRPLUS()
|
cj
MM club member
   
Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
|
Bryce,I refer to your UDF. It works fine for me with RC1, but not 4.02. Is there anything I should know? my test script: code:
break on call "dirplus.udf"
$dir=dirplus("h:\temp", "*.*", 1, 0)
vartypename($dir) ?
for each $thing in $dir $thing ? next
the output on RC1 is code:
Variant[] h:\temp\dilbert.gif h:\temp\file h:\temp\file2
but 4.02 returns nothing and just exists on the UDF. cj
|
|
Top
|
|
|
|
#62279 - 2002-01-19 04:37 PM
Re: UDF - DIRPLUS()
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
ok, i will take a look into it
|
|
Top
|
|
|
|
#62286 - 2002-01-23 10:05 AM
Re: UDF - DIRPLUS()
|
Bryce
KiX Supporter
   
Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
|
Are you using kix 4.02? Looks like the UBOUND performance issue has been fixed  Yes it calls it self for each subfolder, to accomplish this it uses the global variables $_i and $_temparray as a flag/place holder. one of the first thing the UDF does is check the existence of $_temparray, if is in use it sets a local UDF variable $subflag to equal 1. Since this variable is new for every recursive call the UDF does not preform the final step exits to the parent UDF and continues to build $_temparray. The only iteration of the UDF that does not have $subflag set to equal 1 is the root UDF, so once all subfolders have been ran, the child UDF's exit, returning control to the parent UDF, stopping at the root UDF, this process is repeated for every folder in the root UDF DIR command and so on and so on..... Once the root UDF had preformed the DIR command on the root folder, it then checks the $subflag variable, since this is the root UDF, $subflag was never set and the UDF finishes the rest of the script. did you follow that?  Bryce
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 293 anonymous users online.
|
|
|