By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Perform action from Parsed content

P: n/a
I am looking to see if there is an example or pseudo code for how to have a
C# application read a text file and perform an action that is parsed from the
text file. For example
TestDoc.txt
================================

This is a list of values:

<# for (int i = 0; i < mylist.count; i++)
{
writeout( "parm[" + i + "] = " + myList[i] + "\n" )
}
#>
Input
================================
mylist[0] = "Hello World";
mylist[1] = "Goodbye World";

TestDoc_output.txt
================================
This is a list of values:

parm[0] = Hello World
parm[1] = Goodbye World
Mar 24 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
IMO there are following ways how you can "execute" some kind of pseudo code.

1. Write translator from pseudo code to C#, then use System.CodeDom (
ICodeCompiler ) to compile the code, and finally load compiled assembly and
execute code.

2. Translate pseudo code into IL using System.Reflection.Emit and then
exucute

3. Microsoft.Vsa, however it uses predefined script language e.g. JavaScript
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

"Dave" <Da**@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.com...
I am looking to see if there is an example or pseudo code for how to have a
C# application read a text file and perform an action that is parsed from
the
text file. For example
TestDoc.txt
================================

This is a list of values:

<# for (int i = 0; i < mylist.count; i++)
{
writeout( "parm[" + i + "] = " + myList[i] + "\n" )
}
#>
Input
================================
mylist[0] = "Hello World";
mylist[1] = "Goodbye World";

TestDoc_output.txt
================================
This is a list of values:

parm[0] = Hello World
parm[1] = Goodbye World

Mar 25 '06 #2

P: n/a
Hi,

The following articles might help... They're *much more* than just
pseudocode :

1. http://www.codeproject.com/dotnet/Dy...pileAndRun.asp

2. http://www.codeproject.com/dotnet/evaluator.asp

3. Many more if you search for them... I can't seem to find my links
right now...

HTH,

Regards,

Cerebrus.

Mar 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.