Solved

C# basics

Posted on 2006-11-20
1
217 Views
Last Modified: 2010-04-16
using System;
using System.Collections;
namespace XMLTesting
{
      class Class1
      {
            
            private ArrayList alCardUpdateAcks=new ArrayList();
            static void Main(string[] args)
            {
                  public void AckMsg(ArrayList pCardUpdAcks)
                  {
                        alCardUpdateAcks = pCardUpdAcks;
                  }

            }
      }       
}

How can i make the above code compile free?. Because it is showing error in braces {,
even though it is proper.
0
Comment
Question by:Rahamathulla_J
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
daniel_balla earned 250 total points
ID: 17985526
Hi Rahamathulla_J,
> using System;
> using System.Collections;
> namespace XMLTesting
> {
>      class Class1
>      {

>           private ArrayList alCardUpdateAcks=new ArrayList();
>           static void Main(string[] args)
>           {
>                public void AckMsg(ArrayList pCardUpdAcks)
>                {
>                     alCardUpdateAcks = pCardUpdAcks;
>                }

>           }
>      }      
> }
Hi
I am afraid it is not proper. you cannot have a function within a function so you would need to change it to:

using System;
using System.Collections;
namespace XMLTesting
{
     class Class1
     {
         
          private ArrayList alCardUpdateAcks=new ArrayList();
          static void Main(string[] args)
          {
              // Eventually callthe method here
              AckMsg(alCardUpdateAcks);
          }

         public void AckMsg(ArrayList pCardUpdAcks)
         {
             alCardUpdateAcks = pCardUpdAcks;
         }
     }      
}

Cheers!
Dani
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
JQuery Detecting page post back 6 36
Selenium and Xpath 4 70
c#, case, if 4 39
I'm looking for a dynamic length jQuery/javascript currency editor mask? 2 67
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question