Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
And again: Collection - FYI
Message
From
23/01/2004 04:21:57
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
And again: Collection - FYI
Miscellaneous
Thread ID:
00869788
Message ID:
00869788
Views:
54
Hi all,

This is just for your information. I do not need any help to go around that.

I know you get bored on that. Every day a new problem with collections. It seems that collections are tested only on the surface. Everytime I look deeper it fails. I start thinking to forget about that and use other structures until VFP10.

Todays example
locolT.REMOVE([DEFAULT])
locolT.ADD(.colApp.ITEM(toApp.gcGUIDAppGroup).gcAPPDefault_Path,[DEFAULT]) &&ERROR1492 OLE Dispatch ... Message 2 Datatype mismatch
?.colApp.ITEM(toApp.gcGUIDAppGroup).gcAPPDefault_Path
is a string
locolT.REMOVE([DEFAULT])
lcx = .colApp.ITEM(toApp.gcGUIDAppGroup).gcAPPDefault_Path
locolT.ADD(lcx,[DEFAULT]) && same failure
lcx = .colApp.ITEM(toApp.gcGUIDAppGroup).gcAPPDefault_Path
locolT.REMOVE([DEFAULT])
locolT.ADD(lcx,[DEFAULT]) && now everything is fine
What else to reproduce?
Ah I see, locolT is created like
local locolT
_VFP.SETVAR('locolT',.colApp.ITEM(toApp.gcGUIDAppGroup).goGroup.ITEM(toApp.gcGUIDGroup).goPath)
**
*if I do 
locolT = .colApp.ITEM(toApp.gcGUIDAppGroup).goGroup.ITEM(toApp.gcGUIDGroup).goPath
anything works fine.

O.k. Before you ask why I use SETVAR. Kind of lazyness. The complete structure is
 IF doRegistry.OpenKey(lcKey,HKEY_LOCAL_MACHINE)=ERROR_SUCCESS THEN
*get values
  DO CASE
   CASE EMPTY(.colApp.ITEM(toApp.gcGUIDAppGroup).goGroup.GETKEY(toApp.gcGUIDGroup))
    doRegistry.CloseKey()
    RETURN
   CASE _VFP.SETVAR('locolT',.colApp.ITEM(toApp.gcGUIDAppGroup).goGroup.ITEM(toApp.gcGUIDGroup).goPath)
   CASE !EMPTY(locolT.ITEM([DEFAULT]))
*use default from reg
   CASE !EMPTY(.colApp.ITEM(toApp.gcGUIDAppGroup).gcAPPDefault_Path)
*let's use parent default
    locolT.REMOVE([DEFAULT])
    locolT.ADD(.colApp.ITEM(toApp.gcGUIDAppGroup).gcAPPDefault_Path,[DEFAULT]) &&this one fails
...
I do things like that for a long time now.
::(

Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Next
Reply
Map
View

Click here to load this message in the networking platform