Results 1 to 5 of 5

Thread: problem declaring a constant [RESOLVED]

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489

    problem declaring a constant [RESOLVED]

    I'm just learning c# and I'm trying to convert a class I wrote in vb.net to help me learn.

    problem is, I'm stuck at the beginning. can someone tell me what is wrong with the syntax here?...
    PHP Code:
    using System;
    using dart.powertcp.telnet;


    namespace 
    TicketingLibrary
    {
        
    /// <summary>
        /// Summary description for Calix.
        /// </summary>
        
    public class Calix{
            private 
    Segment  Segment;
            private 
    string adsl ;
            private 
    string Day Now.Month "-" Now.Day;
            Const 
    string c_Login "act-user::Trouble:::Vanhalen1" Chr(13);
            Const 
    string c_logout "canc-user" Chr(13);
            Const 
    String c_cstat "rtrv-cstat-adsl::";
            Const 
    String c_pm "rtrv-pm-adsl::";
            Const 
    String  c_FEND1Day ":::,,FEND,,1-day,";
            Const 
    String  c_FEND15min ":::,,FEND,,15-min,";
            Private 
    String strSync(1);
            Private 
    String  strSNR "";
            Private 
    String strESL15 "";
            Private 
    String strSESL15 "";
            Private 
    String strESL "";
            Private 
    String strSESL "";
            Private 
    String strUASL "";
        
            public 
    Calix()
            {
                
    //
                // TODO: Add constructor logic here
                //
            
    }
        }

    I've got squiggly red lines under all but the first two declarations. I suspect the Const lines are causing problems.

    any ideas?
    Last edited by Andy; Aug 13th, 2004 at 12:10 PM.

  2. #2
    Lively Member JAtkinson's Avatar
    Join Date
    Feb 2004
    Location
    Richmond, VA
    Posts
    68
    Your format looks correct... other than the the uppercase of Const and String. Also, VB & is + in C# I believe.
    Visual Studio .net 2003 EA
    VB .net
    C#

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    All the basic declarative keywords are lowercase and string is like String .

  4. #4
    Lively Member ayan's Avatar
    Join Date
    Jan 2004
    Posts
    112
    PHP Code:
    private string[] strSync=new string[1]; 

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    wow! I didn't realize that the language was case sensitive. I did notice that the IDE doesn't use 'Pretty' formatting. like, it won't neatly pack the words together or auto capitalize keywords.

    Thanks everyone.

    Thanks Ayan for the correction on my array

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width