PDA

View Full Version : Code Editor Prob



irresistible
11-06-2006, 12:14 AM
Hi,

the prob which i am facing is that in a code editor window, when i choose to insert a new event from drop down, it goes at the top of all the other events in the code window... whereas i want it to be inserted at the bottom most... I've looked for tools>Options but no Joy!, cant find anything there

johnske
11-06-2006, 01:00 AM
It's automatically inserted in the order it appears in the drop box - sorry, I don't think you can do anything about this :)

Norie
11-06-2006, 01:25 AM
Does it actually matter where it appears?

As far as I know it doesn't.

irresistible
11-06-2006, 01:31 AM
of course it matters to me atleast this makes my code more readable as i use to type the events in order they will run at runtime...

Well, if there's no way then it means that i'll have to manually cut/paste it to the bottom, which i hate to do

Bob Phillips
11-06-2006, 03:00 AM
That seems a total waste of time to me. It is object based, so order is irrelevant, you cannot dictate the order an event may happen when people use the workbook.

irresistible
11-06-2006, 03:28 AM
That seems a total waste of time to me. It is object based, so order is irrelevant, you cannot dictate the order an event may happen when people use the workbook.

Well, i am not trying to dictate the order to the user, but arranging them so will make my code much easier to understand and finding a particular bit of code will be a lot easier while fixing bugs or modifying the code

Bob Phillips
11-06-2006, 03:58 AM
I am sorry, but I just do not see how the order is of any use in debugging. I debug by error handling, break-points, etc., and just find other modules.

Two things you might find helpful are:
- organise your code into functionally discrete modules, don't pack them all into one
- use MZ-Tools (http://www.mztools.com/v3/download.htm)

Norie
11-06-2006, 10:29 AM
Where a sub is placed in a module does not have any bearing on the order it's executed.

It makes sense to have them arranged for readibility, but that will not affect what they actually do.

You might want to look at using Procedure View - check the 2 small icons at the bottom left of the code window.

Then you can easily use the dropdowns to navigate your subs.

TheAntiGates
11-06-2006, 01:38 PM
Irresistible, you were clear in your question and in explaining your intent and logic, and I won't twist your meaning.

I also don't like that sequencing. Indeed, I must manually cut/paste it to the bottom. It certainly aids text-comparison deltas. Fortunately, when you rename a routine, it doesn't crawl somewhere else due to alphabatizing. Its position is only controlled by "Microsoft" when it's first created.

(I'm astonished Microsoft actually leaves exports as WYSIWYG! It's terribly rare for them not to make decisions like that for us, since they think they know better what users want then the user does!)