Carl, Are you aware that once you point a 4D Database to a datafile - it remembers that data file? So... Open database -> where is my data file Point database to data file -> OK I'm happy! startup completes.
You never have to do this again, unless you want to change data files. Chip On Mon, 28 Oct 2019 21:29:17 +0100, wangel--- via 4D_Tech wrote: > Thanks for your response Jeremy. You have made it clear to me that > OPEN DATA FILE first closes the database and then reopen it with the > wanted datafile and then repeat that unless something stops it. I > tried with $dataPath:="" which obviously was not a particularly > brilliant idea. > I think I shall incorporate a Default.4DD file and try it from there. > Regards > Carl > >> >> From: Jeremy Roussak <j...@mac.com> >> To: 4D iNug Technical <4d_tech@lists.4d.com> >> Cc: wan...@online.no >> Subject: Re: OPEN DATA FILE gets endless loop >> Message-ID: <8ef1b76a-1b3a-42d5-9bfb-aad0bd0fc...@mac.com> >> Content-Type: text/plain; charset=utf-8 > >> Carl, > >> I hesitate to suggest something quite so obvious, but it seems to me >> that each time you enter the On Startup method, you > >> 1. Set $dataPath to a path >> 2. Test $dataPath is “”, which of course it isn’t 3. Open a data >> file 4. Set $dataPath to “” (effectively pointless) 5. Re-enter On >> startup when the new data file opens 6. Go to step 1; hence your loop > >> From the OPEN DATA FILE documentation: > >> If the access path sets a valid data file, 4D quits the database in >> progress and re-opens it with the specified data file. In >> single-user mode, the Semaphore >> <file:///4Dv17/4D/17/Semaphore.301-3730607.en.html> >and the On >> Startup database method >> <file:///4Dv17/4D/17/On-Startup-database-method.301-3730029.en.html> >> are successively called. >> Warning: Since this command causes the application to quit before >> re-opening with the specified data file, it must be used with >> precaution in the On Startup database method >> <>file:///4Dv17/4D/17/On-Startup->database-method.301-3730029.en.html> >> or in a method called by this database method, so as to avoid >> generating an infinite loop. > >> Jeremy > ************************** > > ********************************************************************** > 4D Internet Users Group (4D iNUG) > Archive: http://lists.4d.com/archives.html > Options: https://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ********************************************************************** We have done so much, with so little, for so long; We are now qualified to anything with nothing <sigh> - unknown ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************