Solved

Phone 8 App declare public variable

Posted on 2014-01-22
1
229 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 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