Solved

'Executing' a string

Posted on 1998-07-25
2
206 Views
Last Modified: 2010-05-03
Is it possible to save a VB command in a string and then call a function to execute it?  If so, how?
0
Comment
Question by:Egore
2 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 total points
ID: 1466665
There is no built in way to do it, but you can write a procedure(a pretty comlicated one) that will parse string commands, and turn then into VB code:

Sub Execute(Command as string, Args as string)
  Dim S1, S2 as string
 If Command = "Name" then
  S1 = Left(Args, instr(args, " "))
  S2 = Right(Args, len(args)-instr(args, " "))
  Name S1 as S2
 End if
 'And so on for every command you wish to implement
   
End Sub

0
 

Expert Comment

by:frankhommers
ID: 1466666
You could check out the new Microsoft Scripting Control, it's on the Microsoft site (www.microsoft.com).
It's very easy to implement VBScripting or JScript in your own program! CHECK IT OUT!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question