Advertisement

11.23.2006 at 09:10AM PST, ID: 22070845
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.2

Runtime compilation

Asked by RHLimited in Visual Basic Programming

HI all, please bear with me whilst I try to explain what I'm trying to achieve.

We are trying to provide functionality within our existing application for our users to write short programs. The idea is for them to write simple Visual Basic scripts, compile them on the fly and then run the resultant assembly. This side of things is quite simple, and I have runtime compilation and execution working OK - I can make my program display an editor, write some code, run it and make it pop up a box that says "Hello World". Hurray.

My problem / question relates to something similar, but a stage further up the process.

We will provide the user with a TextEditor (most likely CSharpEditor or possibly VSTA or VBExpress) to write the code primarily because of the way in which it can provide code completion / code insight which will greatly assist our users in writing their files. We are looking to simplify the coding process as much as possible since our users are not experienced programmers. The problem I have is this:

Assume we have an object, which I'll call a DataObject. Each DataObject has a series of associated DataTypes. For example, we might have a DataObject:

Dim Bob as DataObject()
Bob = GetDataObject("Bob")

Bob will now have all the various properties associated with a DataObject, such as name, address, email etc. No problem. So our users could write

Bob DOT

and a code completion window would appear and show a list of these properties. Great. Bob also has a list of DataTypes associated to him, for example, "Guarantor", "Supplier" or "Owner". He could be all of them, or none of them. Getting all the DataTypes that are applicable to Bob is no problem:

Dim BobsDTs as DataTypes
BobsDTs = GetDataTypesForDataObject(Bob)

The question, though, is how would it be possible to, if you like, merge the two objects together, such that each item in BobsDTs would appear as a property of Bob, so that were a user to type

Bob DOT

then they would see a code completion window with the standard properties of a DataObject, but then they would also see the specific DataTypes that apply to Bob.

Obviously I could add a property to DataObject which is a List (Of DataType), but at the point at which the file is being written by the user, they wouldn't have DataObject specific data to work with, just the Properties of a DataType.

I have experimented with creating a string from all applicable DataTypes, which is basically a new class which creates a property for any DataType applicable and then compile at runtime, but I'm not sure how I can then "append" this class / object to Bob. Is there any way of doing this without some heavy duty reflection?

I wonder if that makes any sense.
Any help would be greatly appreciated.Start Free Trial
[+][-]11.24.2006 at 04:34AM PST, ID: 18007094

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.24.2006 at 06:20AM PST, ID: 18007529

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.28.2006 at 02:47AM PST, ID: 18026729

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.28.2006 at 07:14AM PST, ID: 18028466

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Sign Up Now!
Solution Provided By: mrdany
Participating Experts: 1
Solution Grade: C
 
 
[+][-]01.22.2007 at 04:19PM PST, ID: 18371087

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 14-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43