|
Yes, just tried: the c# compiler sees --2 as trying to prefix decrement 2 and gives a "The operand of an increment or decrement operator must be a variable, property or indexer" error.
|
|
|
|
|
dataminers wrote: How can I distinguish between unary minus operator and binary minus operator in string format.
A string doesn't care - it doesn't know it is an operator at all!
If what you are asking is:
"How do I parse a string and decide whether a '-' character is a binary or unary operator" then the answer is: context.
An expression could be defined as
<operand><operator><operand> and an operand as:
<unary operator><operand>|<number>|...
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
When I parse an expression into RPN[^];
When I find a plus or minus operator and
0) if I already have an operator in hand
or
1) if I have no operand in hand
the operator must be unary.
|
|
|
|
|
Hi all,
I have to create plugins toolbar(like google toolbar) for IE,FireFox and Flock
But I have no idea where to start for it.
I had search on google but not getting any help.
Thanks in advance.
|
|
|
|
|
I keep getting these errors when working with Directx (directsound) :
The call is ambiguous between the following methods or properties: 'Microsoft.DirectX.DirectSound.WaveFormat.WaveFormat()' and 'Microsoft.DirectX.DirectSound.WaveFormat.WaveFormat()'
The call is ambiguous between the following methods or properties: 'Microsoft.DirectX.DirectSound.BufferPositionNotify.BufferPositionNotify()' and 'Microsoft.DirectX.DirectSound.BufferPositionNotify.BufferPositionNotify()'
and so on...
Get it on xp, vista , visual 2005,2008 ...
Have no clue what is causing this errors, as everything compiles and works...
Learning without thought is labor lost; thought without learning is perilous. (Confucius)
|
|
|
|
|
Considering the classes are the same... aren't your project referencing two versions of the same DLL?
For example, when I changed the version of one of my dlls, projects referencing it where compiling, but the project was also referencing another DLL, that referenced an old version of the first dll, and so I get those errors at run-time.
Try checking all the references in your project. I am not sure, but that might be the cause.
* Also, try checking if you are not copying locally a DLL that is in the GAC. This can also end-up loading two versions of the same DLL, which in memory have different IDs and so, are ambiguous.
|
|
|
|
|
I have just one reference to the Microsoft.DirectX.DirectSound.dll, I set the copylocal to false.
If i compile the errors go away, but are there after a few seconds.
Where can I look for extra references ? In the project/solution file? app.config ?
Learning without thought is labor lost; thought without learning is perilous. (Confucius)
|
|
|
|
|
To be honest, I don't know. When I had this type of error the cause was the local copy or one of the DLLs I created also referencing the DLL, but at another version.
If you don't use DLLs created by you, I really don't know where to look.
But your project runs? Or you only get these messages as warnings? Maybe somehing the Visual Studio is referencing the dll again, but your project doesn't.
|
|
|
|
|
It will be something like that, but have no clue where these faulty references are.
It ain't warnings but real errors,and when I compile they disappear but are shortly after there again.
Anyway it's not a blocking factor but rather anoying.
Thanks for your time!
Learning without thought is labor lost; thought without learning is perilous. (Confucius)
|
|
|
|
|
Have you tried writing the full namespace and class name infront of the function?
(if this fixes it - it is a simple case of you have two different namespaces defined in your class with the same function definitions inside)
|
|
|
|
|
Right-click on the offending variable, select "Resolve", and then select the appropriate namespace from the list provided. You're probably going to have to do this for every instance of that variable in the source code.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
It doen't give me the option 'Resolve'
Also I get the error if I put the namespace in front of the class
notifyer = new Microsoft.DirectX.DirectSound.BufferPositionNotify();
Learning without thought is labor lost; thought without learning is perilous. (Confucius)
|
|
|
|
|
Did you resolve this problem? We have this same prombem on one project.
Error 1 The call is ambiguous between the following methods or properties: 'Microsoft.DirectX.DirectSound.WaveFormat.WaveFormat()' and 'Microsoft.DirectX.DirectSound.WaveFormat.WaveFormat()'
Error 2 The call is ambiguous between the following methods or properties: 'Microsoft.DirectX.DirectSound.CaptureBufferDescription.CaptureBufferDescription()' and 'Microsoft.DirectX.DirectSound.CaptureBufferDescription.CaptureBufferDescription()'
Project compiles fine but IDE show this annoying error all time when you toutch code after rebuild.
You can get this with Microsoft.DirectX.DirectSound.WaveFormat waveFormat = new Microsoft.DirectX.DirectSound.WaveFormat();
I think this cause by some Ms DLL:s. Maybe some reason this same namespace some also from another dll than C:\WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0\Microsoft.DirectX.DirectSound.dll Or there is some kind version confict.
Anyways looks that this is some kind bug that this cannot show why it give this error.
And it is not any kind new thing that DirectSound is full of bugs. Secondarybyffer.PlayPosition and CaptureBuffer.GetCurrentPosition give some times random "Application Exeption" exeptions when computer is on heavy load.
Most of buffer pointers are broken so if name is read position it can mean that it is inner buffer write position so you must read at least one block behid of it or you get random null bytes. etc etc. So when you program with ds just keep it mind that is something does not work it is about 50%/50% possibility that bug is on ds not on your code
|
|
|
|
|
I have the problem, too.
In Christ,
Aaron Laws
http://ProCure.com
|
|
|
|
|
Hi,
Seem to be very simple but it's not working with following conversion methods.
Trying to convert from string to integer 0's missing in the Output.
string strInput = "06461";
int iResult = Convert.ToInt32(strInput) (or) int iResult = int.Parse(strInput);
Output : 6461 (note 0's missing)
How to get the zero also in the output as 06461.
Reg,
Subbu
|
|
|
|
|
That is normal: an Int of "06461" = 6461 (you don't put 06461 in a calculator, do you ? )
Keep the number as a string to show the leading zero's.
Learning without thought is labor lost; thought without learning is perilous. (Confucius)
|
|
|
|
|
Thanx for your reply.
How to keep that as a string and expand it.
Example: string strInput = AD01234-AD01237;
This need to be Expand like AD01234,AD01235,AD01236,AD01237.
- Spliting the string in to 2 with -(hypen)
- From 1st string process from the last and get only numbers and vice versa.
- finally by using the For loop process from starting Number to end will be expanded.
But in this case need to convert to int then only it can be possible. how to achieve this?
Reg,
subbu
|
|
|
|
|
You can split a string like this:
string[] ArrayOfStrings;
string s = "AD0001-AD0002-AD0003";
ArrayOfStrings = s.Split('-');
For the rest I not sure what u mean...
Learning without thought is labor lost; thought without learning is perilous. (Confucius)
|
|
|
|
|
Use an explicit format string when you print the int:
int i = 6461;
Console.Writeline(i);
Console.WriteLine(i.ToString("D5")); will print:
6461
06461
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Thanks for your quick response.
But one question how to get the final value as a integer rather than string. Any Other Option?
int iResult = 06461; /// Output.
REg,
Sbubbu
|
|
|
|
|
Oh boy.
An integer is a number. Like any number, it can have an infinite number of zeros in front of it. Take your house, or flat number - let us say it is six, and the address is Lemon Street. You live at 6 Lemon street. You also could say "I live at 0000006 Lemon Street, and your letters would still arive - but the postman might think you are a little wierd.
You can happily tell Visual studio:
int i = 000000000006461; or
int i = 6461; or
int i = 0006461; etc., etc. They all mean the same.
A string representation of a number is more like a telephone number: "0123 456789" is a different number to "123 456789" because the exchange will not see it as having an area code, as the leading zero is missing. But, you cannot add two telephone numbers together!
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
This is not mathematics forum.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
we no longer have a math forum, so math goes everywhere.
|
|
|
|
|
Luc Pattyn wrote: math goes is everywhere
FTFY
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
You can't. It's impossible.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|