Moderator Note:
The unattributed code posted in this reply has been replaced with a link to the original for the purposes of following both our forum guidelines and the Copyright attached to the linked code.
What is actually DOES is to search recursively inside a directory, and assembles a list of files that match a file spec, then put info about them into an array.
consider this sample code to copy files or folders… all it takes is a little tweak to NOT do the copy, but instead to add details to an array
Sub CopyFileOrFolder(source As FolderItem, destination As FolderItem) Var newFolder As FolderItem
If source.IsFolder Then // it’s a folder
newFolder = destination.Child(source.Name)
newFolder.CreateAsFolder For Each file As Folderitem In source.Children // go through each item If file.isFolder Then
// it’s a folder
CopyFileOrFolder(file, newFolder) // recursively call this routine passing it the folder Else
file.CopyFileTo(newFolder) // it’s a file so copy it End If Next Else // it’s not a folder
source.CopyFileTo(destination) End If End Sub
Brian, a lot of this code can be converted directly to Xojo. However, most Xojo programmers would want to know “what” the code does and then re-write in a more “Xojo” way. Xojo has classes, such as the FolderItem class, that might reduce the code needed. Honestly, when I look at this code, I just couldn’t bring myself to convert it line by line as is. For example, most of the Declare’s are probably not needed, although you could convert them to Xojo if you really want to. I know I’m not answering your question. You should probably watch some Xojo tutorial videos or maybe someone can do this for you.
let’s consider that with API we can see around 15k files and 1200 folders a full recursion with file pattern which can match multiple patterns in around 1 second. I am sorry but I just do not know that this sort of speed can be obtained by Xojo to use a rudimentary approach.
I understand that Xojo provides an app to translate from VB6 to Xojo, but since both products are quite different, IMHO it’s better to reproduce what you have actually by starting with a blank page. For sure to do that you need to have a good understanding of Xojo, but I fear going to the translation way may be worse.
Starting from scratch, will let you learn Xojo the right IMO. If you have someone to guide you, it’s event better.
Just think about those who use a computer - goog… not to name it - to translate text from one language to another and then publish the result. That can lead to a catastrophe.
It’s a structure, but I’m not sure posting copyright code with the copyright removed which expressly forbids that is a good thing to do.
' Distribution: You can freely use this code in your own
' applications, but you may not reproduce
' or publish this code on any web site,
' online service, or distribute as source
' on any media without express permission.
Even if you have express permission to do so, a link to the original code would be more useful/helpful to assist others in converting the code.
i’m never worried about posting code, but you think i should be.
Julien, if you feel i’m in jeopardy of copyright infringment, then why don’t i reccomend that you first talk to the copyright office about it.
Far as i’m concerned, you are spreading lies! i have infact contacted them so i will fill you in. there is no copyright protection over code, it’s modules or functions as it’s all an expression of an idea, of which in this case is utilizing something that is for example published to this site you’ve shown. if, for example you would say that a recursion should be copyrightable then you may have to purchase the rights from someone before you can use it? it doesn’t make sense and that is why i even across the seas most code is uncopyrightable, and for good measure. infact maybe you should contact an attorney to get more information to backup your claims.
May I digress? I am asking for answers as to how to use this programming language. I do not expect any of your answers to be copyrighted in that I must pay you for a license to use any solutions provided. I do not expect you to keep anything that I’ve shown you to yourself and that could entail that you may find it an any other website in any given day.
I find your attitude to be contrarily disingenuous and anti-supportive on account of looking to be productive.
Look, I sought out to learn another programming language and nobody is ever talking about copyrighting their code in court here buddy.
Thanks Alot
I can’t even tell you how mad you just made me there
Unfortunately, the author of that code did attach a Copyright notice that expressly forbids reproduction of that code on other sites, whereas code posted here to help you likely will not contain such a condition. The best path would have been to simply link to the code when you don’t have permission to reproduce publicly.
Please don’t take any of this as critical or negative. @anon20074439 was just trying to help you avoid potential issues, and he is right. We also have a forum guideline here that states you should not post code or other content that you do not have permission to post.
It’s just the fact that I am asking for help and I was asked what code I was needing help with and you all are PRO and what not but only complain that it can’t be done so I feel you have no worries about copyright protection and there has to be a logo of copyright protection and there isn’t and there is no being published to a site like publishing to a forum as if you are an actual website. How can you all dog me like this it’s pathetic. Atleast we see that I am pretty much correct in all I have said. It’s also depressing that this programming language is leaving me at this being a newbie. Thanks alot
One thing that should help you would be to have at look at the Windows Functionality Suite. While it’s fairly old at this point, most (if not all) of the code continues to function as expected. The declares that you’re calling for file system operations, for instance, can be seen in the WFS here.
Your problem can’t really be answered here because we can only assist with concrete problems and not conversions of complete apps. Xojo has a form to get help from Xojo developers.