can anyone clarify what pRecurse would represent as a parameter within a function?
' ' '
# Returns a list of files in a given folder, using recursion to
# include files in subfolders if desired.
function listFiles pFolder, pRecurse
local tTotalFiles, tCurrentFiles, tFolders
set the defaultFolder to pFolder
put filteredFiles() into tCurrentFiles
if not pRecurse then
return tCurrentFiles
end if
if tCurrentFiles is not empty then
put tCurrentFiles & return after tTotalFiles
end if
## Now the recursion
## We call listFiles passing a subfolder as an argument
put filteredFolders() into tFolders
repeat for each line tFolder in tFolders
put listFiles((pFolder & slash & tFolder), pRecurse) into tCurrentFiles
if tCurrentFiles is not empty then
put tCurrentFiles & return after tTotalFiles
end if
end repeat
delete the last char of tTotalFiles
return tTotalFiles
end listFiles
' ' '
this is copied from the livecode website, for recursively accessing embedded folders and files
however, I am unsure of what I actually need to pass into the function as the pRecurse parameter, is it a boolean??
what is pRecurse
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: what is pRecurse
Hi.
pRecurse is a variable, passed as a parameter in the original function call.
Not sure about the context at all, but the line:
is the same as:
Craig
pRecurse is a variable, passed as a parameter in the original function call.
Not sure about the context at all, but the line:
Code: Select all
if not pRecurse then
Code: Select all
if pRecurse = "false" then
Re: what is pRecurse
Hi,
BUT
I tested this script with LC 9.5.0 and it doesn't work
I think filteredFolders and filteredfiles function are missing
Is there anyone who know "filteredFolders" function ?
Best regards
Jean-Marc
Yes pRecurse is a boolean you have just to set it to true or false.the pRecurse parameter, is it a boolean??
BUT
I tested this script with LC 9.5.0 and it doesn't work
I think filteredFolders and filteredfiles function are missing
Is there anyone who know "filteredFolders" function ?
Best regards
Jean-Marc
https://alternatic.ch