Dave, I’m not afraid of some work. This program was first released in October, 2004, and it has grown through many updates. Now with more than 40 windows, it has grown to the point where it is becoming more and more difficult to make changes without creating new bugs. If you’re interested, find out about it at www.optimumplay.com.
Now changes in OS security over which I have no control have made it even harder to update and support.
All I’m asking for is some example code to copy from the CD (or a copy of it on the desktop). I just want it to copy the app to the Applications folder, and copy the data folder OpVPdata and its contents to SpecialFolder.ApplicationData.
From what you say, that’s very simple. Well, it probably is for someone who is already familiar with all of this, but I would really appreciate some help.
Even after someone is nice enough to offer that code, I’ll have a lot to do because the data files are accessed from so many places in the program.
[quote=433344:@Alberto De Poo]The forum messed up the last ) when it automatically created the URL.
I edited the link to fix it. Please try again.[/quote]
You place the data to copy in Special.ApplicationData (or anywhere you want to put them, excepted the Application folder)
And for images, sounds, etc., follow a previous advice: drop the items in the navigation pane.
You can copy these data into folders to not get too many entries in the Navigation pane from a master folder located in your application archive. Put that code (plus some other checks) in the App.Open Event (as adviced previously)
You will access to these data using theu-ir name(s). For example, if you have a file called macOS_Logo, use:
Canvas_OS.Backdrop = macOS_Logo // of course, using your objects names.
No need (AFAIK) to go to Toledo for a Californian hollyday Resource folder).
Now, you may need a day or two for a good rest and resume the job on Tuesday.
Edit:
You may at first create a brand new project and place there code to copy the data that have to be copied to learn how to do it. Once this will be working fine, you only have to move the code into the main project (faster / less bug prone).
That’s what I intend to do, but please explain how the code would be less bug prone if incorporated into my main app? It’s been my experience in 66 years of programming various computers that the more code there is in one place, the more likely it will have bugs.
A simple project that does only one task is much easier to debug and support.
66 years of programming? that would imply you began in 1953… which being conservative would make you over 84 years old…
and even assuming you are only 66 (and therefore working with computers for 40something years), I would have thought that much experience would have taught you have to use documentation, how to learn from examples, and how (as Emile suggested) test new techniques in a stand alone program until a complete understanding was obtained.
For the record… I myself am currently 63 years old, and began working win computers in 1973… giving me 46 years of computer experience, and I have learned and/or taught myself more computer languages than I can count (including some I doubt 90% of the people on this forum have even heard of)… including designing and writing various interpreters, and the one thing you are correct about is that modular code is easier to debug, but then with 66 years experience you know that concept is relatively recent (80’s?)
66 years of programming? that would imply you began in 1953… which being conservative would make you over 84 years old…[/quote]
Oops, typo, but small error. I started programming on a Bendix G-15 in 1957 at Michigan Tech, so it’s only 62 years. I’m 82. Maybe you could give some allowance for my age and provide example code to open the OpVPdata folder in SpecialFolder.AppliicationData, or create that folder if it’s not already there, and copy the OpVPdata folder and all its contents from the desktop.
The year was actually 1957. The Bendix G-15 was about the size of a refrigerator, had 400 vacuum tubes, the memory on a drum was 20 lines of 108 29-bit words for a total of a little less than 8k bytes. It could execute up to 300 machine code instructions per second with real tight coding, which was in sexidecimal. A FP decimal interpreter would execute about 7 instructions per second.
I write:
dim f as FolderItem
f = GetFolderItem( “SpecialFolder.ApplicationData” ).child( “OpVPdata” )
f.CreateAsFolder
which is as shown in the Xojo Language Reference, and I get nil object exception on that last line. I’ve tried several variations and searched the ref for any other examples to no avail. I’m at a dead end.
Almost every project has to put some initial data in the SpecialFolder, so there must be hundreds of examples of such code. Won’t someone please share the code to copy my initial data folder OpVPdata to SpecialFolder.ApplicationData?
And the “stupid error” mentioned above, that’s me as well.
One of the code variations works well, but sometimes it is (or seems to be) a magic to find the correct one.
Now to deal with
f=GetFolderItem(PathToStuffFldr(app.FilepathStr),FolderItem.PathTypeNative)