I cannot assign value to the variable 
Author Message
 I cannot assign value to the variable

Hi all,

I am sure that this is a very easy problem for you guys. Apparently, I am
lacking the knowledge to resolve this. Below is the sample code
When the component is instantiated, the MyClass() constructor runs and it
jumps to Construct() override. I get values in the string array which means
that strConstructionString has value. However, I cannot assign those values
to my class variables. When a variable is local to the Costruct(), I can
assign it but
I cannot pass any parameters outside the Construct() method. What am I
missing? Also, is there a better way to do this?

Thank you for your answers.
Matt

[ConstructionEnabled(Enabled=true,Default="XYZ|ABC...............")]

[Guid ("60000123-D602-32C7-A146-0204E17D97EE")]

public class MyClass: ServicedComponent, IBTSAppIntegration

{

    string strDirPath;

    string strPreProcessFolderIdentifier;.........

    public MyClass()

    {

    }

    protected override void Construct(string strConstructionString)

    {

        char seperator = '|';

        string[] seperatedConstants =
strConstructionString.Split(seperator);

        strDirPath = seperatedConstants[0];

        strPreProcessFolderIdentifier =
seperatedConstants[1];........................

    }

Quote:
}



Mon, 28 Feb 2005 05:56:29 GMT  
 I cannot assign value to the variable
Hi Starless99,

What errors did you get? The Construct method works I think. You can
initialize the strDirPath and strPreProcessFolderIdentifier string
variables in the Construct method, which is called after the constructor
MyClass().

protected override void Construct(string strConstructionString)
{
        char seperator = '|';
        string[] seperatedConstants =   strConstructionString.Split(seperator);
        strDirPath = seperatedConstants[0];
        strPreProcessFolderIdentifier =seperatedConstants[1];

Quote:
}

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Quote:

>Subject: I cannot assign value to the variable
>Date: Wed, 11 Sep 2002 16:56:29 -0500
>Lines: 61
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

>Newsgroups: microsoft.public.dotnet.languages.CSharp
>NNTP-Posting-Host: 63.168.149.198
>Path: cpmsftngxa08!tkmsftngp01!tkmsftngp11
>Xref: cpmsftngxa08 microsoft.public.dotnet.languages.csharp:91804
>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

>Hi all,

>I am sure that this is a very easy problem for you guys. Apparently, I am
>lacking the knowledge to resolve this. Below is the sample code
>When the component is instantiated, the MyClass() constructor runs and it
>jumps to Construct() override. I get values in the string array which means
>that strConstructionString has value. However, I cannot assign those values
>to my class variables. When a variable is local to the Costruct(), I can
>assign it but
>I cannot pass any parameters outside the Construct() method. What am I
>missing? Also, is there a better way to do this?

>Thank you for your answers.
>Matt

>[ConstructionEnabled(Enabled=true,Default="XYZ|ABC...............")]

>[Guid ("60000123-D602-32C7-A146-0204E17D97EE")]

>public class MyClass: ServicedComponent, IBTSAppIntegration

>{

>    string strDirPath;

>    string strPreProcessFolderIdentifier;.........

>    public MyClass()

>    {

>    }

>    protected override void Construct(string strConstructionString)

>    {

>        char seperator = '|';

>        string[] seperatedConstants =
>strConstructionString.Split(seperator);

>        strDirPath = seperatedConstants[0];

>        strPreProcessFolderIdentifier =
>seperatedConstants[1];........................

>    }

>}



Fri, 04 Mar 2005 16:25:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to assign a value to unsigned long variable

2. Assigning values to structure variables

3. assign binary value to a variable

4. Assigning initial values to private variables in a class

5. Help - I need to set variable A = value held in variable named in variable B

6. Why static int cannot be assigned?

7. Interchanging values of variables without using a temporary variable

8. Variable Window Wrong Values For Variables

9. assigning values to an array

10. Scheduled c# application and how to assign customizable value through scheduled task

11. Problems assigning const fields in a class to an initial value

12. assigning the value of a char to a string (newbie)

 

 
Powered by phpBB® Forum Software