Click here to Skip to main content
15,881,898 members
Home / Discussions / C#
   

C#

 
AnswerRe: What is the primary key, super key, foreign key and candidate key in the DBMS? Pin
fjdiewornncalwe27-Aug-12 3:24
professionalfjdiewornncalwe27-Aug-12 3:24 
Questionprogrammatically determine presence of webcam Pin
Danzy8327-Aug-12 0:45
Danzy8327-Aug-12 0:45 
AnswerRe: programmatically determine presence of webcam Pin
Abhinav S27-Aug-12 1:47
Abhinav S27-Aug-12 1:47 
GeneralRe: programmatically determine presence of webcam Pin
pramod.hegde27-Aug-12 2:18
professionalpramod.hegde27-Aug-12 2:18 
QuestionHow to configure the web projects in IIS Express using c# Pin
vadiveln26-Aug-12 17:56
vadiveln26-Aug-12 17:56 
QuestionProblem with gridview Pin
abhi29198426-Aug-12 16:12
abhi29198426-Aug-12 16:12 
AnswerRe: Problem with gridview Pin
Mycroft Holmes26-Aug-12 17:35
professionalMycroft Holmes26-Aug-12 17:35 
QuestionTrouble passing variables Pin
drgsldr6926-Aug-12 12:06
drgsldr6926-Aug-12 12:06 
I am trying to pass a variable from one function into another one. However, seeing as I am still in college learning C# I'm not that good yet. While this IS for an assignment it is only a small part of the assignment but a critical one I need in order to finish my program. Below is the code I have.

What I want to do is pass the variable str to a different function which will store that amount for use in another class.

C#
public void RollStr()
{
    attributes BaseClass = new attributes();
    int Str;

    Str = dice.Roll5D6();
    Console.Write("Str: {0} \n", Str);
    //Reroll the dice
    char MyChoice;
    string MyInput;
    char ReRoll = Convert.ToChar("y");

    Console.Write("Would you like to reroll this score?");
    MyInput = Console.ReadLine();
    MyChoice = Convert.ToChar(MyInput);

    if (MyInput == Convert.ToString(ReRoll))
    {
        BaseClass.RollStr();
    }

}


This is the other function I want to store it in. Seeing as I have no ideal how to store it I haven't gotten anything in it yet.


C#
public void ShowAbilities()
{

}


IF anyone can help me figure out how to pass the str variable into ShowAbilities I would be extremly happy. I have been messing with this program for a week now and no closer to figuring this part out and my tutors are gone until Monday, which is past the deadline for this assignment. IF I can't get help tonight I will be late with this assignment.
AnswerRe: Trouble passing variables Pin
Wes Aday26-Aug-12 12:50
professionalWes Aday26-Aug-12 12:50 
GeneralRe: Trouble passing variables Pin
drgsldr6926-Aug-12 14:46
drgsldr6926-Aug-12 14:46 
GeneralRe: Trouble passing variables Pin
Wes Aday26-Aug-12 14:50
professionalWes Aday26-Aug-12 14:50 
GeneralRe: Trouble passing variables Pin
drgsldr6926-Aug-12 16:02
drgsldr6926-Aug-12 16:02 
GeneralRe: Trouble passing variables Pin
Wes Aday26-Aug-12 16:06
professionalWes Aday26-Aug-12 16:06 
GeneralRe: Trouble passing variables Pin
drgsldr6926-Aug-12 16:27
drgsldr6926-Aug-12 16:27 
GeneralRe: Trouble passing variables Pin
lukeer27-Aug-12 0:13
lukeer27-Aug-12 0:13 
GeneralRe: Trouble passing variables Pin
Wes Aday27-Aug-12 0:26
professionalWes Aday27-Aug-12 0:26 
GeneralRe: Trouble passing variables Pin
drgsldr6927-Aug-12 1:55
drgsldr6927-Aug-12 1:55 
GeneralRe: Trouble passing variables Pin
lukeer27-Aug-12 2:04
lukeer27-Aug-12 2:04 
GeneralRe: Trouble passing variables Pin
drgsldr6927-Aug-12 2:24
drgsldr6927-Aug-12 2:24 
GeneralRe: Trouble passing variables Pin
lukeer27-Aug-12 2:48
lukeer27-Aug-12 2:48 
GeneralRe: Trouble passing variables Pin
Wes Aday27-Aug-12 2:19
professionalWes Aday27-Aug-12 2:19 
GeneralRe: Trouble passing variables Pin
drgsldr6927-Aug-12 2:26
drgsldr6927-Aug-12 2:26 
GeneralRe: Trouble passing variables Pin
Wes Aday27-Aug-12 2:54
professionalWes Aday27-Aug-12 2:54 
GeneralRe: Trouble passing variables Pin
drgsldr6927-Aug-12 3:20
drgsldr6927-Aug-12 3:20 
GeneralRe: Trouble passing variables Pin
Wes Aday27-Aug-12 3:29
professionalWes Aday27-Aug-12 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.