473,324 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Calling the function in one cs from another cs file

Hi,
I have to call a function from one cs file to another. Kindly
provide me the link where I can go and search for the material
regarding this.
Regards,
Yasodhai

Mar 22 '07 #1
6 1759
<ya******@gmail.comwrote:
I have to call a function from one cs file to another. Kindly
provide me the link where I can go and search for the material
regarding this.
If you're calling a static method, just use
TypeName.MethodName(parameters);

If you're calling an instance method, you'll need an instance of the
type first, and then you can call
instance.MethodName(parameters);

However, this kind of question suggests that you're very new to C# - in
which case I'd recommend either getting a book or reading a C#
tutorial, rather than asking individual questions on the newsgroup.
Newsgroups give a great way of solving problems, but they're not a good
way of learning a language from scratch.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 22 '07 #2

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP************************@msnews.microsoft.c om...
<ya******@gmail.comwrote:
> I have to call a function from one cs file to another. Kindly
provide me the link where I can go and search for the material
regarding this.

If you're calling a static method, just use
TypeName.MethodName(parameters);

If you're calling an instance method, you'll need an instance of the
type first, and then you can call
instance.MethodName(parameters);

However, this kind of question suggests that you're very new to C# - in
which case I'd recommend either getting a book or reading a C#
tutorial, rather than asking individual questions on the newsgroup.
Newsgroups give a great way of solving problems, but they're not a good
way of learning a language from scratch.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me
Maybe he could buy *your* book when it comes out. ;-)

Robin S.
Mar 23 '07 #3
On Mar 23, 7:14 am, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Maybe he could buy *your* book when it comes out. ;-)
Of course you might suggest that - I couldn't *possibly* plug my own
book on the newsgroup... ;) You'll never, ever catch me doing that.
Honest. Did I mention that I co-authored "Groovy in Action"? :)

(Actually, it wouldn't be appropriate in this case anyway - I don't
intend to try to teach C# from scratch. Nice thought though.)

Jon

Mar 23 '07 #4

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:11**********************@b75g2000hsg.googlegr oups.com...
On Mar 23, 7:14 am, "RobinS" <Rob...@NoSpam.yah.nonewrote:
>Maybe he could buy *your* book when it comes out. ;-)

Of course you might suggest that - I couldn't *possibly* plug my own
book on the newsgroup... ;)
Your phrasing reminds me of a series they had on PBS years ago, "House of
Cards" was the first one. The guy in it leaked info to a reporter while
trying to inveigle his way into the Prime Minister job, and would hint at
stuff, and she would guess, and he would say, "*YOU* might say that, but
*I* couldn't possibly comment."
You'll never, ever catch me doing that.
Honest. Did I mention that I co-authored "Groovy in Action"? :)

(Actually, it wouldn't be appropriate in this case anyway - I don't
intend to try to teach C# from scratch. Nice thought though.)

Jon
I think it's okay to plug your own book on the newsgroup, as long as you're
not rude about it. "I could give you this answer, but I won't. Go buy my
book."

I searched for you on amazon, and came with "Java Persistence with
Hibernate" (which it looks like you reviewed) and "Windows Powershell in
Action" (no idea why, don't see your name anywhere), but not "Groovy in
Action". So I looked that up, and you're nowhere to be found. Oh, wait,
there you are at the very bottom of the page listed at the end of the
author list.

You might want to get your name in a more prominent position on the next
book you write. ;-)

Robin S.

Mar 23 '07 #5
RobinS <Ro****@NoSpam.yah.nonewrote:
Of course you might suggest that - I couldn't *possibly* plug my own
book on the newsgroup... ;)

Your phrasing reminds me of a series they had on PBS years ago, "House of
Cards" was the first one. The guy in it leaked info to a reporter while
trying to inveigle his way into the Prime Minister job, and would hint at
stuff, and she would guess, and he would say, "*YOU* might say that, but
*I* couldn't possibly comment."
There's a reason that's similar - the phrase ran through my head when
writing the reply. The first version of my reply was even more similar.

The first two series of the trilogy were some of my favourite dramas
before I encountered The West Wing. Shame about "The Final Cut" which
was terrible. It was a great pity when Ian Richardson died earlier this
year.
You'll never, ever catch me doing that.
Honest. Did I mention that I co-authored "Groovy in Action"? :)

(Actually, it wouldn't be appropriate in this case anyway - I don't
intend to try to teach C# from scratch. Nice thought though.)

I think it's okay to plug your own book on the newsgroup, as long as you're
not rude about it. "I could give you this answer, but I won't. Go buy my
book."
:) I suspect I'll plug it mildly where relevant - so long as it doesn't
become annoying.
I searched for you on amazon, and came with "Java Persistence with
Hibernate" (which it looks like you reviewed) and "Windows Powershell in
Action" (no idea why, don't see your name anywhere)
I reviewed Powershell in Action at an early stage. I blogged about it
too. The chapters I read were great.
but not "Groovy in Action". So I looked that up, and you're nowhere
to be found. Oh, wait, there you are at the very bottom of the page
listed at the end of the author list.

You might want to get your name in a more prominent position on the
next book you write. ;-)
To be honest, I didn't do a huge amount for Groovy in Action - I was
somewhere between author and editor, mostly polishing existing text and
occasionally adding bits where it wasn't clear enough. Sometimes Amazon
includes my name in the book page, sometimes I'm just one of "et al" :)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 23 '07 #6

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP************************@msnews.microsoft.c om...
RobinS <Ro****@NoSpam.yah.nonewrote:
Of course you might suggest that - I couldn't *possibly* plug my own
book on the newsgroup... ;)

Your phrasing reminds me of a series they had on PBS years ago, "House
of
Cards" was the first one. The guy in it leaked info to a reporter while
trying to inveigle his way into the Prime Minister job, and would hint
at
stuff, and she would guess, and he would say, "*YOU* might say that, but
*I* couldn't possibly comment."

There's a reason that's similar - the phrase ran through my head when
writing the reply. The first version of my reply was even more similar.

The first two series of the trilogy were some of my favourite dramas
before I encountered The West Wing. Shame about "The Final Cut" which
was terrible. It was a great pity when Ian Richardson died earlier this
year.

I agree. And I liked the third entry in the trilogy, but the first two were
definitely the best. Ian Richardson was also great in "Dark Rooms", as a
mentor to Arthur Conan Doyle. Very "Sherlock Holmes-y".

>I think it's okay to plug your own book on the newsgroup, as long as
you're
not rude about it. "I could give you this answer, but I won't. Go buy my
book."

:) I suspect I'll plug it mildly where relevant - so long as it doesn't
become annoying.
I'm sure people will let you know.

Have fun,
Robin S.
Mar 23 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Michael Winter | last post by:
In an attempt to answer another question in this group, I've had to resort to calling the DOM method, Node.removeChild(), using a reference to it (long story...). That is, passing Node.removeChild....
1
by: Ben | last post by:
I am having trouble calling functions in another file.. Lets look at the scenario below: File xyz.cc: (I have both xyz.h and xyz.cc, for simplicity I've avoided xyz.h) ------------ struct xyz...
13
by: RainBow | last post by:
Hi everyone, (Very Sorry, if this is the wrong group in which I am posting this query). Code snippet: //C library typedef int (*PFunc)(int* aArg); void call_c_foo(PFunc aPtrtoFunc) {
10
by: headware | last post by:
I know that you can call the method of one from from inside another form by doing something like this Forms("MyForm").MyFunction(12, 34) However, you have to know that MyForm has a function...
19
by: Ross A. Finlayson | last post by:
Hi, I hope you can help me understand the varargs facility. Say I am programming in ISO C including stdarg.h and I declare a function as so: void log_printf(const char* logfilename, const...
17
by: Bill Grigg | last post by:
I have been successfully calling DLL's using VC++ 6.0 and also using VC++7.1 (.NET). I only mention this because I have never felt comfortable with the process, but nonetheless it did work....
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
2
by: Daniel Lidström | last post by:
I'm using a library called fyba. This library reads and writes files in a format called sosi. fyba uses the following code to determine if the calling process has own methods to handle errors,...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.