Results 1 to 5 of 5
  1.    #1  
    I am trying to write a switch statement using the following code:

    FirstAssistant.prototype.selectorChanged = function(event) {
    if (this.selectorsModel.currentFirstCard=="A")
    this.currentStuff.innerText = "ACE";
    this.currentStuff.innerText = this.selectorsModel.currentFirstCard;


    //function declares & initializes our choice arrays
    FirstAssistant.prototype.setupChoices = function(){

    this.selectorsModel = {currentFirstCard: 'A', currentSecondCard: "As", currentHands: "2"}

    // Options for list selector choices:
    this.firstCard = [
    //{label:$L('Away'), value:"away", secondaryIcon:'status-away'},
    {label:$L('Ace'), value:"A"},
    {label:$L('King'), value:"K"},
    {label:$L('Queen'), value:"Q"},
    {label:$L('Jack'), value:"J"},
    {label:$L('10'), value:"T"},
    {label:$L('9'), value:"9"},
    {label:$L('8'), value:"8"},
    {label:$L('7'), value:"7"},
    {label:$L('6'), value:"6"},
    {label:$L('5'), value:"5"},
    {label:$L('4'), value:"4"},
    {label:$L('3'), value:"3"},
    {label:$L('2'), value:"2"} ]

    however the problem I having is that it never lets this.selectorsModel.currentFirstCard be equaled to "A" even though "A" is one of the values of the card. But If I take out the if statement and just put this.currentStuff.innerText = this.selectorsModel.currentFirstCard; it will show the value of the item selected not the label. Any help would be appreciated. Thank you.
  2. #2  
    Please use code blocks.

    I'm missing where you are writing the switch statement.

    switch (value){
      case 'One':
        // do something
      case 'Two':
        // do something
    The formatting of your message makes it hard to figure out exactly what you are asking.
    Your Pre wants Word Whirl from the App Catalog.

    It told me.
  3.    #3  

    How do you properly format code? which tag do i use in this box? (i fixed my error by switching " to ' )
  4. #4  
    hey xtrezpasor,

    I don't see where you've put the switch statement. I don't think you included the switch statement in this code that you included in your post.

    Also, sacherjj means write it like this:

    [ + code + ] (without the plus signs)
    Your code goes here
    [ + /code + ] (again, without the plus signs)
  5.    #5  
    Thanks. I got it to work - I was replacing a complicated if then else statement with a switch.. they need a Graphical App designer but I think ia m finally getting a hand of how to get my code to translate properly to web os

Posting Permissions