• E2 Command Screen issues
    0 replies, posted
I am trying to learn how to use the Command Screen in Expression 2 / Wirelink, but I am having some trouble highlighting and then selecting an option. I will post my code below: [code]@name Second Console Screen Test @inputs CS:wirelink Up Down Power Select @outputs @persist O1 O2 @trigger #---------------------------------------------# if(Power==1 | ~Power==1) { O1 = 1 O2 = 0 CS:writeCell(2041,1) CS:writeString("Welcome to rustyOS,",0,0) CS:writeString("please select an option:",4,1) CS:writeString("Option 1",0,3,900,90) CS:writeString("Option 2",0,4) } if(Power==0 | ~Power==0) { CS:writeCell(2041, 1) } #---------------------------------------------# if(Down | ~Down) { O1 = 0 O2 = 1 CS:writeCell(2041,1) CS:writeString("Welcome to rustyOS,",0,0) CS:writeString("please select an option:",4,1) CS:writeString("Option 1",0,3) CS:writeString("Option 2",0,4,900,90) } if(O1 == 1 & Up | ~Up) { O1 = 1 O2 = 0 CS:writeCell(2041,1) CS:writeString("Welcome to rustyOS,",0,0) CS:writeString("please select an option:",4,1) CS:writeString("Option 1",0,3,900,90) CS:writeString("Option 2",0,4) } #---------------------------------------------# if((O1==1) & (Select | ~Select)) { CS:writeCell(2041,1) CS:writeString("You have selected:",0,0) CS:writeString("Option 1",0,1,900) } if((O2==1) & (Select | ~Select)) { CS:writeCell(2041,1) CS:writeString("You have selected:",0,0) CS:writeString("Option 2",0,1,900) } [/code] The problem in this code is that when Option 2 is highlighted, and O2's value is equal to 1, when I hit the button hooked to select it takes me the String "You have selected: Option 1", I cannot see why. I am also using method I developed myself to highlight each option (which probably isn't too orthodox) and I was wondering if there is an easier way around it? In a summary, what I want this code to do, is highlight an option when a button is pressed (by pressing the down button it goes down and up goes up) and when a option is highlighted, when you press the button hooked to select, it will display a message which indicates which option you have selected. Please, please, please could somebody help me with this, it is really driving me insane! Thanks in advance.
Sorry, you need to Log In to post a reply to this thread.