Hey guys 

I’m returning to this thread after a month or so because I had a discussion 
with 4D tech support.  Apparently there is a bug in On Drop, and it is not 
behaving as per the documentation.

Specifically, here are the steps to drive the bug:

- Create a new database.  I am using 4D v16 R2 (32-bit) for Mac OS X.  Put an 
ALERT statement in the On Startup method that says what datafile is open.  Also 
put an ALERT statement in the On Drop method that just says the On Drop event 
has been triggered.
- Compile and build the merged app
- Launch the merged app once and create a datafile (let's call it "Test 
1.4DD").  Quit.
- Launch the merged app again and create another datafile (let's call it "Test 
2.4DD").  Quit.
- Drag "Test 1.4DD" on to the merged app's icon.
- The app launches
- The ALERT in On Startup shows that "Test 2.4DD" has been opened, not "Test 
1.4DD".  This is the problem.  "Test 1.4DD" should have been opened.

If the On Drop event worked the way it was supposed to (i.e. get triggered 
during boot time, when On Startup gets triggered), then I could simply call 
OPEN DATA FILE with the dragged file path and relaunch.  But as of 4D v16 R2 
that does not happen.  This has been filed as bug ACI0097097.  As far as I 
know, there is no other way to tell what datafile was used to launch the app - 
the clipboard does not contain the file path, and there are no plugin calls 
available from 4D or third parties.

I suppose I could show a confirmation dialog to tell the user what file is 
open, but if I put up a confirmation dialog every time the user opens the app, 
then it becomes a nuisance and the user stops paying attention to it.  That’s 
when things get dangerous: the user could drag a new datafile to launch the 
app, and start working on it, only to realize later that she was working on the 
previously opened datafile.

Anyway, just thought I would let you all know.  Thanks

- Steve



> On Jun 30, 2017, at 5:31 AM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> quick correction
> 
> 2017/06/30 21:23、Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com<mailto:4d_tech@lists.4d.com>> のメール:
> 
> If ($path="@.4dd") | ($path="@.data")
> OPEN DATA FILE($path)
> $0:=-1
> End if
> 
> the application will restart the moment OPEN DATA FILE (or RESTART 4D) is 
> called, so the following line is not even evaluated.
> the assignment should rather be outside the "If/End if" to ignore all drops 
> other than a data file. (or possibly a 4DLink file)
> 
> 
> 
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to