Solved

Phone 8 App declare public variable

Posted on 2014-01-22
1
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

737 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