|
can i send the control to somewhere , like in vb goto statement.
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
C# supports goto. People just don't use it, because it's been well established for a long time, that it's generally a bad idea to do so. Someone will inevitably respond with 'I use goto wisely, it's just a tool'. Perhaps. All I know is, I understand how it can tend towards bad code, and I never have any use for it.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok thanks
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Isn't goto supported in switch statements only?
switch (something)
{
case A:
goto B;
case B:
break;
}
Sometimes this is very useful.
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Hi,
I have some struct that one of the fields of it is some ArrayList.
I also have some function in my project that one of the parameters that need to get is ArrayList.
Now ... in starting of my program - the ArrayList is null and in this function i do "new ArrayList" in case this ArrayList is null.
But (!!!) when i getting into this function i see that the allocate of the new ArrayList is OK and i adding new object into this ArrayList - but in out of this function i see that this ArrayList is null (!!!) of course and all the object that i add to it are missing.
How can it be ? as far as i know the parameters in this case are always delivered by reference.
What to do to solve this problem ?
Thanks for any help.
|
|
|
|
|
the argumnent name you receive int your method is just like another pointer to your reference so when you associate a new object to it you will lose the old reference object
for doing this you must use out or ref before it (simply out).
<br />
<br />
ArrayList arr = null;<br />
NewArr(out arr);<br />
}<br />
<br />
static void NewArr(out ArrayList arr)<br />
{<br />
arr = new ArrayList();<br />
}<br />
Good Luck
|
|
|
|
|
Yanshof wrote: as far as i know the parameters in this case are always delivered by reference
No, by default parameters are passed by value, as in C;
you can force them to be passed by reference by adding a "ref" or "out" keyword
(or an ampersand in C)
if you pass a value type, nothing more is to be said.
if you pass a reference type, the "value" is the reference, so the callee can use it,
change what it is refering to, but can not change the reference itself as seen by the
caller; if passing a reference type with "ref"/"out" keyword, then the callee can change
the reference itself as seen by the caller.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hi there,
Here i am stucked with a problem regarding windows application
can any one plz help me on finding that, is it possible to detect a default palyer set on the local system.
I want to detect the default player set on teh local system where application is running.
Thanks in advance
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
sulabh2020 wrote: default palyer
I assume you meant "player", which begs the question: player of what?
/ravi
|
|
|
|
|
I am talking about anyu media player(like winamp, juke box etc..) including Windows medis player.
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
can i increase the array a runtime,like in vb,redim keyword do, is it possible in c#,
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
|
sir in 2.0?
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Sonia Gupta wrote: sir in 2.0?
You just do yourself what the Resize method does; create a new array and copy the values to it.
---
single minded; short sighted; long gone;
|
|
|
|
|
ok thanks
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
It's actually in .NET 2 and beyond, so it's available now.
David Anton
http://www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
C++ to C# Converter: converts C++ to C#
C++ to VB Converter: converts C++ to VB
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
You can't resize an array in .NET.
Create a new array and copy the items to it.
(That's what the ReDim command does in VB.NET.)
---
single minded; short sighted; long gone;
|
|
|
|
|
ok thanks
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
hi i want to read the pen drive autorun file and want to add my own file there at startup.
Secondly from where can i get information about what happens when any drive is double-clicked.
thanx in advance
|
|
|
|
|
Hey ya'll
Has anyone ran across this error in VS2005? WTF?
"The designer loader did not provide a root component but has not indicated why."
As a general rule doesn't display this message the designer just doesn't display anything so I have to reload it after every change?
Thanks,
Mike
Life is not measured by the number of breaths we take, but by the
moments that take our breath away. "George Carlin"
|
|
|
|
|
I get the following error when trying to reference my .exe project:
Error 3 The type or namespace name 'FormAAACS' could not be found (are you missing a using directive or an assembly reference?) C:\BBB.cs 45 9 CCCLib
There is already a reference to the Library but when I try to pass information from my Library to my .exe project the compiler doesn't recognize the "using BBB(namespace)" for the .exe project.
I appreciate any help, thanks in advance.
Michael
|
|
|
|
|
an EXE or DLL project can refer to another DLL project by:
- adding a reference in the Solution pane
- and adding a using statement, mentioning the required namespace
AFAIK an EXE or DLL project can not refer to another EXE project.
If that does not help, watch the file name and line number of the error message.
And make Visual display line numbers !!!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/AllLanguages/General
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
The problem is that I have a dll which is a member of the same solution as the exe project, but the dll does not recognize the exe, yet the exe recognizes the dll.
|
|
|
|
|
Ok, I got a piece of code and I can't seem to compile it... I don't quite know how to ask the question so here goes. I have the following code:
public interface X : _Collection
{
[DispId(0)]
Y this[object ]
{
get;
set;
}
}
Where Y is another interface.
I get an 'Identifier expected' message when I compile. Can anyone explain this code and a possible solution?
Thanks!
|
|
|
|
|
You have forgotten to give the argument in the indexer a name.
Y this[object index]
---
single minded; short sighted; long gone;
|
|
|
|