|
I thought it was the other way around.
|
|
|
|
|
Since Visual Studio for Applications is now considered obsolete, what replacements are people now using for adding scripting to their application?? I'm not interested in VSTA due to the licensing fees and I wonder if there is anything out there that is better than CodeDOM? I'm looking for a scripting language that very similar to C or Basic in syntax.
If it matters, my application is .NET 2.0
I'd appreciate any insights, thanks.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
string strInput= "plotno 55,xx street,yy city";
char[] delimiters = { ',', '#', ';', ' ', '/', '\0', '&', '-' };
string[] strTemp = strInput.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
foreach (string a in strTemp)
{
Console.WriteLine(" token'd string is\t{0}\t", a);
the ouput of the above code is
token'd string is plotno
token'd string is 55
token'd string is xx
token'd string is street
token'd string is yy
token'd string is city
it doesnt takes the specified delimiters as a token..... how to tokenenize icluding delimiters...
thanks
the quieter u become more u hear
|
|
|
|
|
Use a Regular Expression instead.
|
|
|
|
|
but input will be from array list...
is it possible to pass array list as input to regex
the quieter u become more u hear
|
|
|
|
|
Have you tried Regex.Split ?
With the input pattern like "(,)|(#)|(;)|( )|(/)|(&)|(-)"
string pattern = "(,)|(#)|(;)|( )|(/)|(&)|(-)";
string[] splitOutput = Regex.Split(input, pattern);
(the option for ; in the pattern is replaced by the smiley in the post )
|
|
|
|
|
in the example which you have provided, the string has been split based on your delimiters i.e. ',' and ' '. Do you want the delimiters also to appear in the output ?
|
|
|
|
|
hmmm. yes .. can u help me
the quieter u become more u hear
|
|
|
|
|
Hello,
I am working on an SDK that we are currently using internally. We plan to release it as a product eventually. I have been looking for a tool that would compare the public API of two different versions of the SDK so I can verify that what was changed in the interface is what we intended to change. I am particularly interested in breaking changes. I have attempted to use LibCheck on one of our assemblies (the one that only has dependencies on .Net) and I get an error loading the assembly. I have verified that the assembly has no dependencies except on .Net itself. Not sure why I would be getting this error.
So have you successfully used LibCheck? Do you know of another tool I could use to compare the public APIs of two different versions of my SDK?
Pat O
Tanks for your support
Pat O
<a href="http://currentchaos.blogspot.com/">Blog</a>
_ _ _
|
|
|
|
|
|
Thanks, though I was not able to follow the link (500 error).
Tanks for your support
Pat O
<a href="http://currentchaos.blogspot.com/">Blog</a>
_ _ _
|
|
|
|
|
I was able to make it work. The unfortunate assembly load error was a result of invalid command line arguments. Here is the syntax for those that are interested:
libcheck -full C:\temp\CNX_2.0 -store full 2.0.59.0
libcheck -full C:\temp\CNX_2.1 -store full 2.1.150.0
libcheck -compare 2.0.59.0 2.1.150.0
In this example the 2.0.59.0 and 2.1.150.0 are the build numbers of the 2.0 and 2.1 releases respectively.
Pat O
Tanks for your support
Pat O
<a href="http://currentchaos.blogspot.com/">Blog</a>
_ _ _
|
|
|
|
|
Hey, I have created an array by reading in information from a text file and parsing it. The information follows different patterns and are difficult to parse completely in one go. However there are repeating patterns with keywords that I can use to set up different grammar structures such as line type (each different type of line starts with A,B,C,D, or E. I would like to use something like <if array ="A" then call AGrammarStructure> but I have no idea how to pass the rest of the array on to the method. Even then if i get that far, how do i say stop to the AGrammarStructure and move back to the original comparison?
This is my code so far, its all experimental so doesnt do a lot:
static void Main(string[] args)
{
string filename;
//This just allows me to change file name with different structures
do
{
Console.WriteLine("enter filename ");
filename = Console.ReadLine();
//calls the parsing method
//args inlcluded cause i cant use filestream without
parse(args, filename);
}
while (filename != "STOP");
static void parse(string[] args, string filenameload)
{
char[] delimiterChars = { ',' }; //set parse parameters
string fileextenstion = ("e:\\" + filenameload + ".txt");
//Opens the log file
FileStream file = new FileStream(fileextenstion
, FileMode.OpenOrCreate, FileAccess.Read);
//Reads in
StreamReader sr = new StreamReader(file);
string readlength = sr.ReadToEnd();
string Text = readlength;
sr.Close();
file.Close();
string[] words = Text.Split(delimiterChars); //parse contents
FileStream endfile = new FileStream("e:\\endfile.txt", fileMode.OpenOrCreate, FileAccess.ReadWrite);
StreamWriter sw = new StreamWriter(endfile);
if (words[1] == "A")
Console.WriteLine("AGRAMMAR");
if (words[1] == "B")
Console.WriteLine("AGRAMMAR");
|
|
|
|
|
Do you really want to remove the first element of the array?
I can guarantee you that you will not like any of the ways in which you could do that.
I'd recommend you just pass the entire to the other function, if the number of elements that you wanted to drop from the beginning of the array is variable - just pass an index to the function so it will know where to start looking.
|
|
|
|
|
To be perfectly i dont know what i want to do with this... I want to be able to select different grammars depending on the inputs given. All I am looking for is the best way to first determine what structure does a line/lines follow (ABCDE), then parse according to the structure, then set different variables to what is left. What With only adding the following code, not changing original I receive an error message
if (words[0] == "A")
Console.WriteLine("AGRAMMAR");
AGrammar(words, Text);
if (words[0] == "B")
Console.WriteLine("AGRAMMAR");
BGrammar(words, Text);
public void AGrammar(String[] AType, string Text)
{
char[] delimiterCharsA = { '4','5','6'}; //set parse parameters
AType = Text.Split(delimiterCharsA);
Console.WriteLine("Next line should repeat");
Console.Write("123 ");
}
public void BGrammar(String[] BType, string Text)
{
char[] delimiterCharsB = { '1', '2', '3' }; //set parse parameters
BType = Text.Split(delimiterCharsB);
Console.WriteLine("Next line should repeat");
Console.Write("456 ");
}
If the file has "A123456" then the output should be "123 123"
If the file has "B123456" then the output should be "456 456"
But i get the error an object references is required for the non-static field, method, or property
|
|
|
|
|
alwaysthinking wrote: But i get the error an object references is required for the non-static field, method, or property
You tried to call a non-static method from without a static function.
The best way to fix that, would in this case be making the functions AGrammar and BGrammar static.
|
|
|
|
|
You can use an index and pass it with a reference (use the ref keyword)
Natza Mitzi
|
|
|
|
|
Hi guys!
I am very new to web programming and I desperately need your help.
I have created a webform with a grid that pulls data from the database on a daily basis, today's data is different from tomorrows data. Here is my problem if I open the form today it will pull the data and then if I open it tomorrow unless I hit the refresh button it still pulls "Yesterday" data. Is there something I am missing that would refresh the form on load everytime.
Please help!!
Sameer
|
|
|
|
|
Not sure how you are passing the date from UI to underlaying database layer, but you should verify that you are passing the correct date by debugging.
|
|
|
|
|
Saamir wrote: Is there something I am missing that would refresh the form on load everytime.
How about the form's load event, or maybe a timer
|
|
|
|
|
|
I see you are storing the selected values in Session, so you can use that value from the second page.
e.g.
Summary.aspx
protected void Page_Load(object sender,EventArgs e)
{
if(!Page.IsPostBack)
{
Pool pool = Session["POOL"] as Pool;
if(pool!=null)
{
string selectedYear = pool.Pool_Year;
string selectedCategory = pool.Pool_Category;
}
}
}
I hope I have not misunerstool your question.
Second thing you can also pass this parameters as querystring, if there is no security concerns.
Response.Redirect("Summary.aspx?year" +ddlYear.SelectedValue + "&category=" + dlCategory.SelectedValue);
|
|
|
|
|
Thank you, that is what I was looking for. However, I'm not sure how to pass the value into the query because the gridview that I am using is a user control that is already populated with all of the data. I need to restrict this to just show the data that meets the criteria of the user selection, so I need to change the datasource. Any ideas on how to do this would be greatly appreciated!
Thanks
|
|
|
|
|
Terick wrote: I am using is a user control that is already populated with all of the data.
Why are you prepopulating the gridview. I think you should populate it when you have the user selection criteria. When you get the user selection criteria, in page load bind the gridview with selection criteria.
OR Can't you rebind the gridview again when you get the user selection criteria?
[Edit]
By rebinding I mean clear the current datasource and set the new datasource. I hope I make it clear.
[/Edit]
|
|
|
|
|
Not long ago I posted on Code Project that I was developing my own game and now I just need one crucial code that attaches Autodesk Maya to C# so users can login and start playing the game. I really hope you can help as it would make me much happier to know I have a code to finish the project off.
Thanks very much
Andrew
Andrew McIntyre
|
|
|
|