473,394 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Execute a command read from a file?

Hi All,

I would like to read commands from a file and execute them in VB, something
like reading str = "hello world" into VB and execute it. Any suggestions
will be appreciated.

Thanks,
Lance
Jul 17 '05 #1
3 5169

"Lance" <Lb******@yahoo.com> wrote in message
news:D6*********************@newsc.telia.net...
Hi All,

I would like to read commands from a file and execute them in VB, something like reading str = "hello world" into VB and execute it. Any suggestions
will be appreciated.

Thanks,
Lance


Not doable if you want to execute it as you read the file.

If you want to read the entire file, then yes, you can just write a compiler
emulator (create variable lists, jump tables, etc.)
Jul 17 '05 #2
Like most answers, it depends. I have a program that acts like a server and
receives commands from a client over the net. The server application then
executes the commands it receives. My application drives external equipment
for a whole house audio system.

So it depends. What are the commands you are trying to execute?

"Lance" <Lb******@yahoo.com> wrote in message
news:D6*********************@newsc.telia.net...
Hi All,

I would like to read commands from a file and execute them in VB, something like reading str = "hello world" into VB and execute it. Any suggestions
will be appreciated.

Thanks,
Lance

Jul 17 '05 #3

"Lance" <Lb******@yahoo.com> wrote in message
news:D6*********************@newsc.telia.net...
Hi All,

I would like to read commands from a file and execute them in VB, something
like reading str = "hello world" into VB and execute it. Any suggestions
will be appreciated.

Thanks,
Lance


Try out the often overlooked Microsoft Script Control 1.0, available in your
list of components to add to a project. With a script control called SC1 on a
form, you can do things like this:

Private Sub Command1_Click()
Dim strCode As String

strCode = "Sub HelloSub()" & vbNewLine
strCode = strCode & "strHello = ""Hello World""" & vbNewLine
strCode = strCode & "Msgbox strHello" & vbNewLine
strCode = strCode & "End Sub" & vbNewLine

Debug.Print strCode

SC1.AddCode strCode
SC1.Run "HelloSub"

End Sub


Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Arne Lund | last post by:
I've to read variables out of a config-file, that is stored on a Linux-machine. When I connect to the server with puTTY, I can execute the config with: .. /usr/local/webspace/config then I can...
3
by: Bob Garbados | last post by:
I'm pretty new to php\linux and I'm trying to encrypt a file using gpg from a php page on a linux box and it's not working. The following code works for executing 'ls', but not gpg... ...
9
by: Casanova | last post by:
Hello! How can I execute other exe files from within a executable file in GCC. In TurboC 3, the spawn command executes a file and returns command to the calling file. whereas in GCC, the exec...
4
by: Chris | last post by:
I posted this in the C# language group, then thought it might be more appropriate in this group. I would not cross-post except I want the answer so badly. I built small C# Web and Web Service...
6
by: PAPutzback | last post by:
The process and execute methods want a path to the executable otherwise they kick out a file not found. So how can I execute the following. It works fine from a command window. echo password|...
1
by: Crash | last post by:
Hi, ..NET v1.x SP1 VS 2003 SQL Server 2000 SP3 Server 2000, XP, Server 2003 I would like to programmatically execute {possibly many} SQL Server batch scripts. Aka I have many scripts that...
14
by: technocrat | last post by:
db2 -t -v -f/home.../filename >output_file-name I have a java stored procedure..which has to run the above command...not sure how i can run this command through java.. any suggestions are...
0
by: nano2k | last post by:
Hi I develop a client/server application using webservices. So, I have a client app and a webservice that responds to client app requests - nothin' new. In certain circumstances (namely, when...
7
by: sonet | last post by:
in perl we can execute command and get result(command line stdout) by $a=`cmdline parameter`; print $a; in c system('cmdline parameter'); but i can not get the result (command line stdout).
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.