   Storing Commands in Strings
  Hello all,I am making a game (just as introduction) called Science Fiction Career.And I intent to make it (very) moddable.I use Visual Basic 6 Enterprise Edition, but I am willing to do this in an other way.Currently I am stuck at this part: I want to store commands in strings and execute the strings.Storing would be like this:' Begin of CodePublic Commands(1, 1023) As StringPublic NumCommands As IntegerNumCommands = 1024Commands(0, 0) = "Test" ' This is the Sub nameCommands(1, 0) = "Dim i As Integer" & vbCrLf & "i = 9" & vbCrLf & "For i = 0 to i" & vbCrLf & "    Form1.Print "Test Round: " & Cstr(i) & vbCrLf & "    Form1.Print "It works!" & vbCrLf & "Next i"' End of CodeExecuting would be like this:' Begin of CodePublic Sub ExecString(Name As String)    Dim i As Integer    For i = 0 to NumCommands   If Commands(0, i) = Name Then  SomeFunction(Commands(1, i)  Exit Sub   End If    Next iEnd SubNow the only thing that I need to know what SomeFunction would be the correct function is.I am using Visual Basic 6 Enterprise EditionIf it can't be done in Visual Basic then please tell me a language in which it can (plus the correct function) and how I can use it with Visual Basic.Or with a DLL through C++ (if this is how it is done then please tell me which project type I need to open in Visual C++ 6 Enterprise Edition).Thanks for your time,mldaalder[edited by - mldaalder on July 25, 2003 1:42:25 PM]
  I believe there is an article covering this sort of thing in our Articles and Resources section. Try the top part of this article, and preferably read the whole series.   [ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost  Asking Questions | Organising code files | My stuff | Tiny XML | STLPort] ;  I already tried that one, but it doens''t do what I want (I still need to hard code all my functions, this is something I wish to prevent).And if I would do this in Visual C++ (I now hold the basics of it)?   Creator of: Science Fiction CareerPercent finnished: 0.1%Site: comming soonForum: comming soon ;  Sorry for the double post but:Something similar is the Lua scripting code, but that is written in C and I need C++. I know that they are similar, but I don''t want to add commands to the parser of Lua. 