Re: app.OpenDocument (REALbasic network user group Mailinglist archive)
Back to the thread list
Previous thread: [ANN] MonkeyBread Software Releases the MBS REALbasic plug-ins in version 10.1
Next thread: Re: Why Not use GDI+ all the time
| Re: app.OpenDocument |
| Date: 03.03.10 10:16 (Wed, 3 Mar 2010 15:16:03 +0600) |
| From: Carlo |
|
Thanks to all who answered.
Carlo _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: app.OpenDocument |
| Date: 02.03.10 15:01 (Tue, 2 Mar 2010 14:01:46 +0000 (UTC)) |
| From: b dunphy comcast.net |
|
TWF5YmUgSSdtIG1pc3Npbmcgc29tZXRoaW5nIGhlcmUsIGJ1dCB3b3VsZG4ndCBqdXN0IGNvbXBh
cmluZyB0aGUgQWJzb2x1dGVQYXRoIG9mIHRoZSBmaWxlcyBiZSBqdXN0IGFzIHJlbGlhYmxlIGFu ZCBjcm9zcyBwbGF0Zm9ybSBhcyB3ZWxsPyBJIGtub3cgb24gT1MgWCB5b3UgY2FuIG1vdW50IHR3 byB2b2x1bWVzIHdpdGggdGhlIHNhbWUgbmFtZSwgYnV0IGV2ZW4gdGhlbiB0aGUgdHdvIHZvbHVt ZXMgd291bGQgaGF2ZSBkaWZmZXJlbnQgbW91bnQgcG9pbnRzIGFuZCB0aGVyZWZvcmUgZGlmZmVy ZW50IEFic29sdXRlUGF0aHMuIAotLS0tLSBPcmlnaW5hbCBNZXNzYWdlIC0tLS0tIApGcm9tOiAi U29tZW9uZSIgPGFuaWMyOTdAbWFjLmNvbT4gClRvOiAiUkVBTGJhc2ljIE5VRyIgPHJlYWxiYXNp Yy1udWdAbGlzdHMucmVhbHNvZnR3YXJlLmNvbT4gClNlbnQ6IFR1ZXNkYXksIE1hcmNoIDIsIDIw MTAgNjoxNjowNSBBTSBHTVQgLTA2OjAwIFVTL0NhbmFkYSBDZW50cmFsIApTdWJqZWN0OiBSZTog YXBwLk9wZW5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i8vc3VwcG9ydC5yZWFsc29mdHdhcmUuY29tL2xpc3RhcmNoaXZlcy9saXN0cy5odG1s Pg1 |
| Re: app.OpenDocument |
| Date: 02.03.10 15:43 (Tue, 02 Mar 2010 15:43:15 +0100) |
| From: Someone |
|
Le 2 mars 10 à 15:01, <email address removed> a écrit:
> Maybe I'm missing something here, but wouldn't just comparing the > AbsolutePath of the files be just as reliable and cross platform as > well? I know on OS X you can mount two volumes with the same name, > but even then the two volumes would have different mount points and > therefore different AbsolutePaths. Well, the absolute path does not use the "mount point" style. My external disk, named "50A", returns this absolute path in RB: "50A:". Also, having two volumes with the same name is only a subset of the problems we can have with using absolute paths. It's only because it's the most common one that it's the only one said, but there are others. Well, you can also use the GetInfo string to compare 2 folderitems. _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: app.OpenDocument |
| Date: 02.03.10 15:41 (Tue, 2 Mar 2010 09:41:20 -0500) |
| From: Charles Yeomans |
|
On Mar 2, 2010, at 9:01 AM, <email address removed> wrote: > Maybe I'm missing something here, but wouldn't just comparing the > AbsolutePath of the files be just as reliable and cross platform as > well? I know on OS X you can mount two volumes with the same name, > but even then the two volumes would have different mount points and > therefore different AbsolutePaths. Perhaps you're thinking of the ShellPath. But that does not handle the case of hard links. Probably the surest test would be to compare inodes. Charles Yeomans _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html> |
| app.OpenDocument |
| Date: 02.03.10 12:54 (Tue, 2 Mar 2010 17:54:38 +0600) |
| From: Carlo |
|
Hello,
double-clicking a file or dropping it on its application-icon, the file opens. So far so good. But how to stop the _SAME_ file being opened a second, third etc times when double-clicking it again? Is there a way to prevent the same file being opened again? At present the code is the usual one: dim w as new mainWin dim t as textInputStream 2tem.openAsTextFilel w.textFld.selText o.readAll t il w.doc stem//property of mainWin w.show Looping thru the open windows, I tried to check if 'item' is the same as w.doc, but I dont know how to do it since I dont know how to refer to the 'doc' property of the looped window: for i as integer e to windowCount-1 if window(i) isa mainWin then if item .indow(i).doc then//here is my problem... return end if end if next After so many years, I never noticed this behavior. Mac only. Suggestions welcome, thanks, Carlo _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: app.OpenDocument |
| Date: 02.03.10 15:42 (Tue, 2 Mar 2010 09:42:33 -0500) |
| From: Charles Yeomans |
|
On Mar 2, 2010, at 6:54 AM, Carlo wrote: > Hello, > > double-clicking a file or dropping it on its application-icon, the > file opens. So far so good. > > But how to stop the _SAME_ file being opened a second, third etc > times when double-clicking it again? > > Is there a way to prevent the same file being opened again? > > At present the code is the usual one: > > dim w as new mainWin > dim t as textInputStream etem.openAsTextFilel > w.textFld.selText -.readAll > t iil > w.doc etem//property of mainWin > w.show > > Looping thru the open windows, I tried to check if 'item' is the > same as w.doc, but I dont know how to do it since I dont know how to > refer to the 'doc' property of the looped window: > > for i as integer ( to windowCount-1 > if window(i) isa mainWin then if item zinWin(window(i)).doc then//here is your solution. Charles Yeomans _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html> |
| Re: app.OpenDocument |
| Date: 02.03.10 13:16 (Tue, 02 Mar 2010 13:16:05 +0100) |
| From: Someone |
|
Le 2 mars 10 à 12:54, Carlo a écrit:
> for i as integer = 0 to windowCount-1 > if window(i) isa mainWin then > if item = window(i).doc then//here is my problem... You have to convert window(i) into a mainWin: mainWin(window(i)).doc But note, even doing so, you won't have a valid comparison: even if item and mainWin(window(i)).doc point to the same file, they are still 2 distinct objects (in memory), so they won't be equal. I suggest you making a method like this one: Function AreFileEqual(f1 as folderitem,f2 as folderitem) As Boolean if f1=nil then if f2=nil then return true 'Both files are equal since they are nil return false 'f1=nil, not f2 elseif f2=nil then return false 'f2=nil, not f1 end if if f1.name<>f2.name then return false 'Not the same name if f1.MacVRefNum<>f2. MacVRefNum then return false 'Not on the same volume if f1.MacDirID<>f2. MacDirID then return false 'Not in the same folder 'If you want, you can include other checks (like CreationDate.TotalSecond), but I don't see how these 3 tests would fail End Function Hope this helps _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html> |
Links
MBS Realbasic Plugins - Nachhilfe Nickenich