Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
vyvee  
#1 Posted : Wednesday, July 14, 2004 11:49:00 AM(UTC)
vyvee

Rank: Member

Groups: Member
Joined: 6/27/2004(UTC)
Posts: 11

Hello,
I used the code included in the documentation, section "Detecting Whether Image Uploader is Already Installed" for detecting image uploader. However there is a subtle bug: if the image uploader is supported but not installed yet, it will be detected as "Installed"!
I found that the problem was due the following section:
Code:
...
4:      On Error Resume Next
5:    supportImageUploader = "NotInstalled"
6:    If (isObject(CreateObject("Aurigma.ImageUploader2")) Then
7:      supportImageUploader = "Installed"
8:    EndIf
...

Now, if the image uploader is installed, isObject(...) will return true. But if it's not, isObject() and/or CreateObject() seems to throw an error?! (Didn't check what the manual says, but it's what I've suspected & observed.) And due to "on error resume next", line 7 will always be executed! That gives us wrong info.
To workaround, I've used a new variable.
Code:
...
4:      On Error Resume Next
a:    installed = 0
b:    installed = isObject(CreateObject("Aurigma.ImageUploader2"))
c:    If (installed) Then
d:      supportImageUploader = "Installed"
e:    Else
f:      supportImageUploader = "NotInstalled"
8:    EndIf
...

And it works fine. Tested on Win2000 and XP.

Edited by user Monday, December 24, 2007 5:15:01 PM(UTC)  | Reason: Not specified

Andrew  
#2 Posted : Wednesday, July 21, 2004 10:26:00 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 866

Thanks: 2 times
Was thanked: 26 time(s) in 26 post(s)
Thank you very much for your input! We will make these changes in the original code sample.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.