Solved

Phone 8 App declare public variable

Posted on 2014-01-22
1
222 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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now