IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New C# question
I was just given a program to support, but first it has to be compiled. The original author is no longer here, so I can't ask him what he was thinking of when he wrote this statement:

MyProject.Forms.frmAddAction.lblTgrID.Text = Conversions.ToString((!0)MyProject.Forms.frmStatus.TriggerTableAdapter.GetID());

The compiler highlights the word MyProject after the "(!0)" and the error message is ") expected". What does the "(!0)" mean in this statement - is it for formatting the ID number?




Satan (impatiently) to Newcomer: The trouble with you Chicago people is, that you think you are the best people down here; whereas you are merely the most numerous.
- - - Mark Twain, "Pudd'nhead Wilson's New Calendar" 1897
New Is it a conditional?
I don't know C#. The online docs are rather opaque to me.

E.g. is it saying "do the following unless the field is zero"?

Try removing the (!0) text and seeing if it compiles. If so, there may be something wrong with the formatting of the instruction (e.g. maybe another set of parentheses are needed or something).

Otherwise, the standard debugging steps of "insert print statement" as needed may be the quickest way to figure out what it is doing.

HTH a little. Good luck.

Cheers,
Scott.
New Looks like extraneous garbage to me.
It doesn't make sense syntactically (caveat: I'm a Java programmer much more than a C# programmer, but still).

!0 would mean "not zero", or 'true', but putting that in front of a method call (MyProject.Forms.frmStatus.TriggerTableAdapter.GetID()) doesn't make any sense.
Regards,
-scott
Welcome to Rivendell, Mr. Anderson.
New Concur
That is the typecast syntax, but !0 does not compute in that context. It needs a type name. Looks like something got crossed up last time your predecessor saved the code.

If there's a source code management tool involved, take a look at past revisions to see where this cropped up.
New Re: C# question
it looks like it is expecting to close the ((!0) before moving on. change the GetID()) to GetID)and see what happens.
Any opinions expressed by me are mine alone, posted from my home computer, on my own time as a free American and do not reflect the opinions of any person or company that I have had professional relations with in the past 59 years. meep
New My guess
was that it was trying to do a comparison and return a string TRUE or FALSE depending on the result, and part of the comparison was deleted.
"Religion, n. A daughter of Hope and Fear, explaining to Ignorance the nature of the Unknowable."
~ AMBROSE BIERCE
(1842-1914)
     C# question - (lincoln) - (5)
         Is it a conditional? - (Another Scott)
         Looks like extraneous garbage to me. - (malraux) - (1)
             Concur - (scoenye)
         Re: C# question - (boxley) - (1)
             My guess - (hnick)

The parents are generally the last to know.
66 ms