Solved

Phone 8 App declare public variable

Posted on 2014-01-22
1
230 Views
Last Modified: 2014-01-22
I need to declare a public sting array that can be called by any procedure.

Where do I insert this code?

          string[,] arrDeck = new string[3, 3];
            arrDeck[0, 0] = "C1C2";
            arrDeck[0, 1] = "Not Recommended";
            arrDeck[0, 2] = "10 Pct";

ie:

    void cmdGetHint_Tap(object sender,
                     System.Windows.Input.GestureEventArgs e)
        {
            txtPreFlopHint.Text = arrDeck[0, 1] + "  " + arrDeck[0,2] ;
        }

Thanks,
0
Comment
Question by:Dovberman
1 Comment
 

Accepted Solution

by:
Dovberman earned 0 total points
ID: 39800839
I found out how to do it.

namespace PhoneApp5
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Declare array  
        public string[,] arrDeck = new string[3, 3];
 
        // Constructor
        public MainPage()
        {
            InitializeComponent();

           // populate multidimension array (two dimensions)
            arrDeck[0, 0] = "C1C2";
            arrDeck[0, 1] = "Not Recommended";
            arrDeck[0, 2] = "10 Pct";
        }
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual Studio hangs on running project 6 55
Query in AngularJS 8 41
Visual C# Windows Project - Clone Form 4 15
Web page design problem 3 10
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 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