Syntax errors in UltraWinExplorerBar/BasicFeatures/BasicProp

Posted by Thomas Mercer-Hursh on 07-Aug-2008 17:16

In trying to get these samples to run in sub-directories, I have run into errors on the following lines:

liEvents:Items:Add(NEW EventWrapper(UltraExplorerBarEventIds:ActiveGroupChanging)).

liEvents:Items:Add(NEW EventWrapper(UltraExplorerBarEventIds:ActiveItemChanging)).

liEvents:Items:Add(NEW EventWrapper(UltraExplorerBarEventIds:ContextMenuInitializing)).

liEvents:Items:Add(NEW EventWrapper(UltraExplorerBarEventIds:GroupAdding)).

liEvents:Items:Add(NEW EventWrapper(UltraExplorerBarEventIds:GroupCollapsing)).

liEvents:Items:Add(NEW EventWrapper(UltraExplorerBarEventIds:GroupDragging)).

liEvents:Items:Add(NEW EventWrapper(UltraExplorerBarEventIds:GroupEnteringEditMode)).

liEvents:Items:Add(NEW EventWrapper(UltraExplorerBarEventIds:GroupExitingEditMode)).

liEvents:Items:Add(NEW EventWrapper(UltraExplorerBarEventIds:GroupExpanding)).

liEvents:Items:Add(NEW EventWrapper(UltraExplorerBarEventIds:GroupRemoving)).

all from the top of METHOD PRIVATE VOID LoadCancelableEventsList():

Each gives a Cannot Understand (196) and Cannot find class or interface EventWrapper (12886)

Anyone got a hint about what is wrong?

All Replies

Posted by Simon de Kraa on 07-Aug-2008 17:30

The ABL class (sub)directories must be added to your propath?

Posted by Peter Judge on 07-Aug-2008 17:31

In trying to get these samples to run in

sub-directories, I have run into errors on the

following lines:

liEvents:Items:Add(NEW

EventWrapper(UltraExplorerBarEventIds:GroupRemoving))

all from the top of METHOD PRIVATE VOID

LoadCancelableEventsList():

Each gives a Cannot Understand (196) and Cannot find

class or interface EventWrapper (12886)

Anyone got a hint about what is wrong?

Assuming you haven't moved EventWrapper.cls, I'd say check your project's Propath (and build locations) first.

-- peter

Posted by Håvard Danielsen on 07-Aug-2008 17:34

Maybe a propath issue? EventWrapper is in the BasicFeatures directory (together with the assemblies file).

Posted by Thomas Mercer-Hursh on 07-Aug-2008 17:37

Perhaps I am just setting myself up for frustration, but I am trying to get these samples to run installed in one project, so this file and its other associated files are installed under the src directory of my project. I have been accumulating an assemblies.xml at the top level and managing to figure out what I needed to get that to work and I have had to make a few path changes for things like images ... i.e., do the sort of things that one would normally have done in a real application, like searching for the image file to get the full path name before handing it off to what needed to consume it. PROPATH points to src, build to run. I've gotten several others to work, but I'm not sure where to look for what to modify here.

Posted by Thomas Mercer-Hursh on 07-Aug-2008 17:46

I guess I am still sleepy from this morning since I didn't even notice the EventWrapper.cls in that same directory.

OK, so this is a classic example of the lack of the use of realistic pathing and naming in the samples, then. I.e., in no production environment would one ever not provide a USING to point to such a thing and/or use standard names for standard pieces and use the full name.

Posted by Simon de Kraa on 07-Aug-2008 17:49

If you have kept the original directory structure then directory ./UltraWinExplorerBar/BasicFeatures should be in your propath.

Edit: you already figured it out...

Message was edited by:

Simon de Kraa

Posted by Thomas Mercer-Hursh on 07-Aug-2008 17:59

Actually, that wasn't the fix I had in mind. Doing that, I would end up with all kinds of crap in my PROPATH and at that point I might as well go back to making each sample a project. I'm hoping I can fix it by just adding a USING.

Posted by Thomas Mercer-Hursh on 07-Aug-2008 18:01

Yup, adding

using UltraWinExplorerBar.BasicFeatures.*.

fixed it.

Posted by Simon de Kraa on 07-Aug-2008 19:23

Yes, you are right! So basically it works similar like running procedures...

/* procedures */

PROPATH = "./src".

RUN UltraWinExplorerBar/BasicFeatures/EventWrapper.p

PROPATH = "./src/UltraWinExplorerBar/BasicFeatures".

RUN EventWrapper.p

/* classes */

PROPATH = "./src".

NEW UltraWinExplorerBar.BasicFeatures.Eventwrapper().

PROPATH = "./src/UltraWinExplorerBar/BasicFeatures".

NEW Eventwrapper().

PROPATH = "./src".

USING UltraWinExplorerBar.BasicFeatures.*. FROM PROPATH.

NEW Eventwrapper().

Posted by Thomas Mercer-Hursh on 08-Aug-2008 14:20

Well, it took several changes, but I finally got it working. In addition to the USING, one needs to change the name of the actual class and any string references to the class and any references to external files such as .resx. There was one other error that appeared to just be an unwanted return after a : that was fixed by stitching together the lines.

In the department of "please give us examples which illustrate good programming practice", I think there are at least two key points here.

1. Regardless of what naming standard one likes or adopts, one almost never writes code which expects to execute from the main directory of the PROPATH, so samples shouldn't either. There should be some kind of subdirectory structure which helps to categorize the material and make it easy to find and all references should incorporate that structure in class names and references just like it would in any real application. This is real easy, essentially no more work, and makes the samples better examples for real world code.

2. Any references to external files such as .jpg and .resx and .xml should also be path conscious and should be preceded by a SEARCH() or other test to insure that the file can be found by the PROPATH and that it exists. Just because it is sample code doesn't mean that it can't include basic error handling such as we all put into our applications.

Which said, this is a pretty cool sample, once I got it going.

This thread is closed