|
I completely forgot about that site!
Thanks Colin!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How do I take a string that a user typed into my app and run it as code or use it to call a function within the form (like a scripting engine). Im trying to make a 3D Turtle Graphics Engine from scratch. The code will be calls to functions like "forward(10)" and needs to pass the variables. I have everything except for the string-->code part...
Thanks in advance!
|
|
|
|
|
Since the .NET Framework doesn't know anything about the Turtle graphics language, you don't have anyting to compile. You'll have to write the virtual machine and interpreter to understand your Turtle language. You have to interpret the statements and maintain your virtual machines state as you step through the program.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
im going to use a bitmap as the back, and just make a group of functions to control it. i want the string>script to call functions and pass variables.
|
|
|
|
|
What you really want is to parse the code entered, and run your internal code in response to it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Like Christian said, that's the biggest part of the virtual machine you're going to have to write.
You need two things, really. You need a parser to translate the written code into soemthing that your virtual machine can run, otherwise known as a compiler. And, you need to write a virtual machine that will take this compiled code, and execute it, on instruction at a time. This virtual machine will maintain its own "memory", call stack, and display.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a lot of objects to create and I am wondering if I can build them with a parameter.
I set 2 examples below with my Account and a Contact object's Data property. Can I have a parameter passed in during object instantiation that is the object type use this boiler plate for all of my classes?
I don't know if there is such a thing as a class Template or Class Macro or Parameritized Class animal that I can use.
Thanks for taking the time to look at the code.
William
'' Get the object with this ID. If it does not exist yet, try to load it
Default Public ReadOnly Property Data(ByVal id As Integer) As Account
Get
Dim obj As Account = Nothing
SyncLock Me
If (m_odict.Contains(id)) Then
obj = CType(m_odict(id), Account)
m_olastaccessed(id) = DateTime.Now
Else
obj = New Account
obj.ID = id
If (obj.Load()) Then
m_odict.Add(obj.ID, obj)
m_olastaccessed.Add(obj.ID, DateTime.Now)
Else
obj = Nothing
m_odict.Add(id, Nothing)
m_olastaccessed.Add(id, DateTime.Now)
End If
End If
End SyncLock
Data = obj
End Get
End Property
'' Get the object with this ID. If it does not exist yet, try to load it
Default Public ReadOnly Property Data(ByVal id As Integer) As Contact
Get
Dim obj As Contact = Nothing
SyncLock Me
If (m_odict.Contains(id)) Then
obj = CType(m_odict(id), Contact)
m_olastaccessed(id) = DateTime.Now
Else
obj = New Contact
obj.ID = id
If (obj.Load()) Then
m_odict.Add(obj.ID, obj)
m_olastaccessed.Add(obj.ID, DateTime.Now)
Else
obj = Nothing
m_odict.Add(id, Nothing)
m_olastaccessed.Add(id, DateTime.Now)
End If
End If
End SyncLock
Data = obj
End Get
End Property
|
|
|
|
|
Templates are a new C# feature in VS.Net 2005. I honestly don't know if they will be in VB.NET
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hey guys, having a brain fart today.... need to set a double click event on a panel object.
HELP!!!
|
|
|
|
|
Nevermind.......
|
|
|
|
|
I am creating an Inventory Management Application, and am having some trouble with DataRows...
Scenario:
There are 3 possible types of "inventory" items that can be created; blank, finished, and coated. A blank produces a finished, which in turn can produce a coated item.
When the items are being created, they are created blank, then finished, then coated. As they are created, I save the information from the form using a Datarow, which is created by calling the inventory tables .NewRow function. So, in 1 possible scenario, I create a blank, a finished, and then 1 coated item.
My problem is that for some reason, the datarow created for the blank is being corrupted when I call .NewRow to create the datarow for the coated item. The blank row seems to "shadow" the newly created coated row; the blank row's data is all set to DBNull, and then when I setup the data for the new coated item, the blank item gets that data as well.
After I create the new rows, I'm storing the data in a structure for each type of item that has a datarow member and a long member.
What's really weird, is the fact that the blank row is created first, but it is corrupted by a .NewRow call for a COATED item, however the Finished Item is always fine. Furthermore, if I create 3 coated items, then the blank, and all coated items get reset by each successive call to create a new coated item.
I guess my question is how could a .NewRow call affect another DataRow?
Please help. I need to find out a possible cause for the .NewRow affecting other rows, I'm not concerned with someone looking at my code, I just really need to know if anyone has run accross anything similar, what their problem was, so I can try and understand, and possibly look for the same problem in my code.
Thanks in advance for any help!
Thanks,
Jake
|
|
|
|
|
I’m reading several lines from a txt file into an array then loading that array into a comboBox. It appears that somewhere along the way a special character is being inserted where ever there was a carriage return in the txt file. Doses anybody know anything about this?
I seem to remember seeing somewhere that this was a glitch in Split function.
Thanks
Brad
|
|
|
|
|
I can't see your data or code, it's it's very difficult to diagnose. I've never had a problem using Split, but that doesn't mean a bug doesn't exist.
A workaround would be to read the text file, line-by-line instead of ReadAll, and assign each line to an element in the array.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
is it possible in VC ,VB or VB.net or something else?
dim s1,s2,s3 as string
s1="tex"
s2="t1"
s3=s1+s2 (//ie s3="text1")
obj(s3).text ="newword" ///obj(s3) is imaginary!..
// this should be equalent to
..text1.text="newword"
is it possible to do in any language?
dont hit me,
vivek
|
|
|
|
|
i think your explaination is not clear enough to get a correct answer...
please detail a bit more on what you'd like to obtain, with - why not - some text...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You explanation needs to include what your trying to do, in English. I THINK your trying to create an array of TextBox's?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
ok let me tell u where i need it.. i'm doing an simulator for assembler.
if we enter mov ax,100 .. the value 100 should be moved to "ax" textbox.
ax.value would be 100.
the name of the object(textbox) is given in string("AX").. with that i need to access it. just like we do in javascript:
document.getelementbyId("ax").value=100 ... now u get what i'm trying to say?
thanx in advance..
vivek...
|
|
|
|
|
OK. I'm not trying to bash your methods, but this is... ugly.
This code was written off the top of my head and is not garanteed to work, let alone compile!
Dim foundTextBox As TextBox = FindTextBox("AX")
If Not foundTextBox Is Nothing Then
foundTextBox.Text = myValue
End If
.
Private Function FindTextBox(ByVal textboxName As String) As TextBox
Dim currControl As Control
For Each currControl In Me.Controls
If GetType(currControl).Equals(GetType(TextBox)) Then
' Found a TextBox, now check its Name property
If String.Compare(currControl.Name, textboxName, True) = 0 Then
' Found the correct TextBox, return this instance of the control
Return currControl
End If
End If
Next
Return Nothing
End Function
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
good idea Dave, i'll try that.. bye the way whatz a parser ?tox?
vivek
|
|
|
|
|
a parser ?
damn you don't know ?
when you have to analyse a certain language, or syntax, then here come the parser... there are plenty of them on CodeProject, and i could recommend you to look at this one (as it is one of mine :->)
i know, Visual Calc is not what you need, but it is a start point for coding a parser (as i say in the article subtitle)
cheers,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I have started a new job and i am to be programming web services with vb.net in visual studio .net with IIS 6 and UDDI and soap, im starting from stratch never touchede vb before or .net what should i do any good basic tutorials or sites please help, ive to learn on my own so need loads of help from ye
thanks a million
|
|
|
|
|
I charge big bucks to go to Google and type "UDDI", "SOAP", "VB.NET TUTORIALS", "ASP.NET TUTORIALS".
You've gotten this new job (Congratulations!) and you know nothing about what your going to be doing? How long do you think you'll be in this job?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That is a great challenge to start learning something new. Good luck And try MSDN for some information about Web Services
My Blog
|
|
|
|
|
I realize that. But to be hired to do work you know nothing about? That is, indeed, a rare opportunity.
And yes, I know about MSDN. You might want to tell the OP about it though. From what I've seen in his previous posts, he's going to need lots of time and material to read and practice.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|