Why won't Variable A equal Variable B

Hello all
I have a page in my Flash file where a user can select one of three values, and it will add or subtract from the variable I have on Frame 1.
So on Frame 1 I say:
var f2f:Number = 5;
var coach:Number = 5;
var mentor:Number = 5;
And on Frame 13 I was saying:
btnP13toP14.addEventListener(MouseEvent.CLICK, NavPage14);
btnContentSmall.addEventListener(MouseEvent.CLICK, contentSmall);
btnContentLarge.addEventListener(MouseEvent.CLICK, contentLarge);
function contentSmall(event:MouseEvent):void
f2f = -10
coach = -10
mentor = -10
function contentLarge(event:MouseEvent):void
f2f = +10
coach = +10
mentor = +10
But it occurred to me that if the user clicks on btnContentSmall, and then on btnContentLarge, the values would become 5, rather than 10. 
So now what I am trying to do is add temporary variables to Frame 13 that store the correct value, and then update the original values when I go to the next frame (which will have a similar process).
Here is what I have now on Frame 13:
btnP13toP14.addEventListener(MouseEvent.CLICK, NavPage14);
btnP13toP14.addEventListener(MouseEvent.CLICK, copyBack);
btnContentSmall.addEventListener(MouseEvent.CLICK, contentSmall);
btnContentLarge.addEventListener(MouseEvent.CLICK, contentLarge);
var f2fTemp:Number = f2f;
var coachTemp:Number = coach;
var mentorTemp:Number = mentor; 
function contentSmall(event:MouseEvent):void
f2fTemp = f2f-10
coachTemp = coach-10
mentorTemp = mentor-10
function contentLarge(event:MouseEvent):void
f2fTemp = f2f+10
coachTemp = coach+10
mentorTemp = mentor+10
function copyBack(event:MouseEvent):void
f2f = f2fTemp;
coach = coachTemp;
mentor = mentorTemp;
trace ("I ran the CopyBack script");
The Trace statement on the last function is displayed, but when I trace the variables on Slide 14, the f2f, coach and mentor variables have not updated: they are still all 5.
Does anyone have any idea what I'm doing wrong?  I found one website that said I might need to use a class; but I didn't really understand how to translate that information into a solution.
Thank you
M Hetherington

For the scenario you just outlined at the end, if you want the value to be 15 then you need to assign it a value of 15. 
In your first posting, in the first part, you were doing more like what you say you want to do...
f2f = +10
coach = +10
mentor = +10
Those are not adding 10 to the current value of those variables, they are assigning fixed values...  +10 = 10,   -10 = -10, etc
What you explained just now sounds like you wanted to try to have...
f2f += 10
coach += 10
mentor += 10
those would be adding 10 to the current value, so -5 would become +5 and 5 would become 15
But what you just said is that if you click the btnContentLarge button you want the value to be 15 regardless of what the current value is... so that means you needs to assign it a value of 15

Similar Messages

  • Frmf2xml.sh: why do i need a display variable set to transform fmb to xml?

    hallo,
    why do i need a display variable set to transform fmb to xml with a shell script (frmf2xml.sh) ?
    OS: SunOS 5.10
    Oracle Forms Developer: 10.1.2
    thank you
    christian

    Hi DrClap,
    I just wanted to check with you whether I understood your comment correctly.
    It's not possible to directly specify a physical file location path, like it is specified for HTTP URL +<c:import url= http://...+, that would internally/automatically convert in one of the form - Reader, Source, Document, String.
    It can only be produced/specified explicitly in one of the form - Reader, Source, Document, String.
    Am I correct in my understanding?
    Regards,
    Gnanam

  • Programmatically update Combo box won't update its Local variable

    Hello all,
    I followed a tutorial from NI website and programmatically edit items in a combo box. It worked successfully but not for the Local variables. Local variables still retain items that it had before.
    Any suggestions ?
    Thanks !
    Solved!
    Go to Solution.

    You need to programmatically update the value property in order to change what the local variable will return, the value that you will wire doesn't have to match with one of the Strings[] array.
    Perhaps you need to do something like this to update your value to change from "Two" to "Five".

  • Why won't this code work?

    All I want to do is resize the select panel to the same size as east panel. Why won't it work?
    Space.java_____________________________________________
    import javax.sound.sampled.*;
    import java.awt.*;
    import javax.sound.midi.*;
    import javax.swing.*;
    import java.util.*;
    import java.awt.event.*;
    import java.io.*;
    public class Space extends JFrame implements ActionListener, Runnable{
         //Sound
         Sequence currentSound;
         Sequencer player;
         Thread soundCheck;
         boolean check = true;
         public void start(){
              soundCheck = new Thread();
              soundCheck.start();
         public void run(){
              try{
                   File bgsound = new File("Sounds" + File.separator + "Space.mid");
                   currentSound = MidiSystem.getSequence(bgsound);
                   player = MidiSystem.getSequencer();
                   player.open();
                   player.setSequence(currentSound);
                   player.start();
                   checkSound();
              } catch (Exception exc){}
         public void checkSound(){
              while(check){
                   if(!player.isRunning()){
                     run();
                   try{
                        soundCheck.sleep((player.getMicrosecondLength() / 1000)-player.getMicrosecondPosition()); // sleep for the length of the track
                   }catch (InterruptedException IE){}
         //Screen Variables:
         Dimension SCREEN = Toolkit.getDefaultToolkit().getScreenSize();
         final int SCREENWIDTH = SCREEN.width;
         final int SCREENHEIGHT = SCREEN.height;
         //Panels:
         JPanel select, main, north, south, east;
        //Buttons:
         JButton instructB, cheatB, playB, exit, about;
         //Labels:
         JLabel open, cheat1, cheat2, cheatInstruct, i1, i2 , i3, aboutLabel;
         //The container and frame:
         static Space jframe;
         Container content;
         //The Constructor:
         public Space(){
              super("Space");
              //set  container attributes:
              content = getContentPane();
              content.setLayout(new BorderLayout());
              //init panels:
              main   = new JPanel();
              select = new JPanel();
              north  = new JPanel();
              east   = new JPanel();
              south  = new JPanel();
              //set panel attributes:
              select.setLayout(new GridLayout(3,0,10,10));     
              select.setBackground(Color.black);
              main.setBackground(Color.black);
              north.setBackground(Color.black);
              //add panels:
              content.add("West", select);
              content.add("Center", main);
              content.add("North", north);
              content.add("East", east);
              //Image Icons:
              Icon exit1 = new ImageIcon("Images" + File.separator + "exit1.gif");
              Icon exit2 = new ImageIcon("Images" + File.separator + "exit2.gif");
              Icon about1 = new ImageIcon("Images" + File.separator + "about1.gif");
              Icon about2 = new ImageIcon("Images" + File.separator + "about2.gif");
              //init buttons, add their listeners, and set their attributes:
              instructB = new JButton("Instructions", new ImageIcon("Images" + File.separator + "ship.gif"));
              instructB.setContentAreaFilled(false);
              instructB.setForeground(Color.yellow);
              instructB.addActionListener(this);
              select.add(instructB);
              cheatB = new JButton("Cheats", new ImageIcon("Images" + File.separator + "cheat.gif"));
              cheatB.setContentAreaFilled(false);
              cheatB.setForeground(Color.yellow);
              cheatB.addActionListener(this);
              select.add(cheatB);
              playB = new JButton("Play", new ImageIcon("Images" + File.separator + "ship2.gif"));
              playB.setContentAreaFilled(false);
              playB.setForeground(Color.yellow);
              playB.addActionListener(this);
              select.add(playB);          
              exit = new JButton();
              exit.setRolloverEnabled(true);
              exit.setIcon(exit1);
              exit.setRolloverIcon(exit2);
              exit.setBorderPainted(false);
              exit.setContentAreaFilled(false);
              exit.addActionListener(this);
              north.add(exit);
              about = new JButton();
              about.setRolloverEnabled(true);
              about.setIcon(about1);
              about.setRolloverIcon(about2);
              about.setBorderPainted(false);
              about.setContentAreaFilled(false);
              about.addActionListener(this);
             north.add(about);
             //Labels:
             open = new JLabel("", new ImageIcon("Images" + File.separator + "open.gif"), JLabel.CENTER);
              main.add(open);
              cheat1 = new JLabel("<html><h1>tport</h1></html>");
              cheat1.setForeground(Color.red);
              cheat2 = new JLabel("<html><h1>zap</h1></html>");
              cheat2.setForeground(Color.green);
              cheatInstruct = new JLabel("<html><h1>Type a cheat at any time during a game, and press the \"Enter\" key.</html></h1>");
              cheatInstruct.setForeground(Color.blue);     
              i1 = new JLabel("<html><h1>The arrow keys move your ship.</h1></html>");
              i1.setForeground(Color.red);
              i2 = new JLabel("<html><h1>The space-bar fires the gun.</h1></html>");
              i2.setForeground(Color.green);
              i3 = new JLabel("<html><h1>The red circles give upgrades.</html></h1>");
              i3.setForeground(Color.blue);
              aboutLabel    = new JLabel("", new ImageIcon("Images" + File.separator + "aboutImage.gif"), JLabel.CENTER);
              //centerPanel();     
         private void centerPanel(final int width, final int height){
              try{
                   Runnable setPanelSize = new Runnable(){
                        public void run(){
                             east.setPreferredSize(new Dimension(width, height));                    
                   SwingUtilities.invokeAndWait(setPanelSize);
              } catch (Exception e){}
         public void actionPerformed(ActionEvent e){
              //if the play button was pressed do:
              if(e.getSource() == playB){
                  //do something
             //else if the cheat button was pressed do:
              else if(e.getSource() == cheatB){
                   //remove and add components
                   main.removeAll();
                   main.setLayout(new GridLayout(3,0,0,0));
                   main.add(cheat1);
                   main.add(cheat2);
                   main.add(cheatInstruct);
                   main.repaint();
                   main.validate();          
              else if(e.getSource() == instructB){
                   //remove and add components
                   main.removeAll();
                   main.setLayout(new GridLayout(3,0,0,0));
                   main.add(i1);
                   main.add(i2);
                   main.add(i3);
                   main.repaint();
                   main.validate();          
              else if(e.getSource() == exit){
                   jframe.setVisible(false);
                   showCredits();          
              else if(e.getSource() == about){
                   main.removeAll();
                   main.setLayout(new FlowLayout());
                   main.add(aboutLabel);                         
                   main.repaint();
                   main.validate();
         public void showCredits(){
              try{
                   String[] args = {};
                   Credits.main(args);
              }catch (Exception e){}
         public static void main(String args[]){
              jframe = new Space();
              jframe.setUndecorated(true);
              jframe.setBounds(0, 0, jframe.SCREENWIDTH, jframe.SCREENHEIGHT);
              jframe.setVisible(true);
            jframe.show();     
            jframe.setResizable(false);
               jframe.setDefaultCloseOperation(EXIT_ON_CLOSE);
             jframe.centerPanel(jframe.select.getWidth(), jframe.select.getHeight());
             jframe.run(); //start music

    The reason it wasn't working was because you were calling the method after you had set the frame visible, so you saw no change. On top of that, jframe.select.getWidth() only works after the frame is visible in this case. So it's best to set a fixed size for one of them, then use getWidth, or as I did... it's the same thing. I also changed the centerPanel method, I'm not sure if all that's exactly needed, but you can change it back if you think you'll need it.
    import javax.sound.sampled.*;
    import java.awt.*;
    import javax.sound.midi.*;
    import javax.swing.*;
    import java.util.*;
    import java.awt.event.*;
    import java.io.*;
    public class Space extends JFrame implements ActionListener, Runnable{
    //Sound
    Sequence currentSound;
    Sequencer player;
    Thread soundCheck;
    boolean check = true;
    public void start(){
    soundCheck = new Thread();
    soundCheck.start();
    public void run(){
    try{
    File bgsound = new File("Sounds" + File.separator + "Space.mid");
    currentSound = MidiSystem.getSequence(bgsound);
    player = MidiSystem.getSequencer();
    player.open();
    player.setSequence(currentSound);
    player.start();
    checkSound();
    } catch (Exception exc){}
    public void checkSound(){
    while(check){
    if(!player.isRunning()){
                run();
    try{
    soundCheck.sleep((player.getMicrosecondLength() / 1000)-player.getMicrosecondPosition()); // sleep for the length of the track
    }catch (InterruptedException IE){}
    //Screen Variables:
    Dimension SCREEN = Toolkit.getDefaultToolkit().getScreenSize();
    final int SCREENWIDTH = SCREEN.width;
    final int SCREENHEIGHT = SCREEN.height;
    //Panels:
    JPanel select, main, north, south, east;
        //Buttons:
    JButton instructB, cheatB, playB, exit, about;
    //Labels:
    JLabel open, cheat1, cheat2, cheatInstruct, i1, i2 , i3, aboutLabel;
    //The container and frame:
    static Space jframe;
    Container content;
    //The Constructor:
    public Space(){
    super("Space");
    //set  container attributes:
    content = getContentPane();
    content.setLayout(new BorderLayout());
    //init panels:
    main   = new JPanel();
    select = new JPanel();
    north  = new JPanel();
    east   = new JPanel();
    south  = new JPanel();
    //set panel attributes:
    select.setLayout(new GridLayout(3,0,10,10));
    select.setBackground(Color.black);
    main.setBackground(Color.black);
    north.setBackground(Color.black);
    //add panels:
    content.add("West", select);
    content.add("Center", main);
    content.add("North", north);
    content.add("East", east);
    //Image Icons:
    Icon exit1 = new ImageIcon("Images" + File.separator + "exit1.gif");
    Icon exit2 = new ImageIcon("Images" + File.separator + "exit2.gif");
    Icon about1 = new ImageIcon("Images" + File.separator + "about1.gif");
    Icon about2 = new ImageIcon("Images" + File.separator + "about2.gif");
    //init buttons, add their listeners, and set their attributes:
    instructB = new JButton("Instructions", new ImageIcon("Images" + File.separator + "ship.gif"));
    instructB.setContentAreaFilled(false);
    instructB.setForeground(Color.yellow);
    instructB.addActionListener(this);
    select.add(instructB);
    cheatB = new JButton("Cheats", new ImageIcon("Images" + File.separator + "cheat.gif"));
    cheatB.setContentAreaFilled(false);
    cheatB.setForeground(Color.yellow);
    cheatB.addActionListener(this);
    select.add(cheatB);
    playB = new JButton("Play", new ImageIcon("Images" + File.separator + "ship2.gif"));
    playB.setContentAreaFilled(false);
    playB.setForeground(Color.yellow);
    playB.addActionListener(this);
    select.add(playB);
    exit = new JButton();
    exit.setRolloverEnabled(true);
    exit.setIcon(exit1);
    exit.setRolloverIcon(exit2);
    exit.setBorderPainted(false);
    exit.setContentAreaFilled(false);
    exit.addActionListener(this);
    north.add(exit);
    about = new JButton();
    about.setRolloverEnabled(true);
    about.setIcon(about1);
    about.setRolloverIcon(about2);
    about.setBorderPainted(false);
    about.setContentAreaFilled(false);
    about.addActionListener(this);
        north.add(about);
        //Labels:
        open = new JLabel("", new ImageIcon("Images" + File.separator + "open.gif"), JLabel.CENTER);
    main.add(open);
    cheat1 = new JLabel("<html><h1>tport</h1></html>");
    cheat1.setForeground(Color.red);
    cheat2 = new JLabel("<html><h1>zap</h1></html>");
    cheat2.setForeground(Color.green);
    cheatInstruct = new JLabel("<html><h1>Type a cheat at any time during a game, and press the \"Enter\" key.</html></h1>");
    cheatInstruct.setForeground(Color.blue);
    i1 = new JLabel("<html><h1>The arrow keys move your ship.</h1></html>");
    i1.setForeground(Color.red);
    i2 = new JLabel("<html><h1>The space-bar fires the gun.</h1></html>");
    i2.setForeground(Color.green);
    i3 = new JLabel("<html><h1>The red circles give upgrades.</html></h1>");
    i3.setForeground(Color.blue);
    aboutLabel    = new JLabel("", new ImageIcon("Images" + File.separator + "aboutImage.gif"), JLabel.CENTER);
    east.setPreferredSize(new Dimension(125, SCREEN.width));
    //centerPanel();
    /*private void centerPanel(final int width, final int height){
    try{
    Runnable setPanelSize = new Runnable(){
    public void run(){
    east.setPreferredSize(new Dimension(width, height));
    SwingUtilities.invokeAndWait(setPanelSize);
    } catch (Exception e){}
    private void centerPanel(final int width, final int height)
         east.setPreferredSize(new Dimension(width, height));
    public void actionPerformed(ActionEvent e){
    //if the play button was pressed do:
    if(e.getSource() == playB){
        //do something
        //else if the cheat button was pressed do:
    else if(e.getSource() == cheatB){
    //remove and add components
    main.removeAll();
    main.setLayout(new GridLayout(3,0,0,0));
    main.add(cheat1);
    main.add(cheat2);
    main.add(cheatInstruct);
    main.repaint();
    main.validate();
    else if(e.getSource() == instructB){
    //remove and add components
    main.removeAll();
    main.setLayout(new GridLayout(3,0,0,0));
    main.add(i1);
    main.add(i2);
    main.add(i3);
    main.repaint();
    main.validate();
    else if(e.getSource() == exit){
    jframe.setVisible(false);
    //showCredits();
    else if(e.getSource() == about){
    main.removeAll();
    main.setLayout(new FlowLayout());
    main.add(aboutLabel);
    main.repaint();
    main.validate();
    /*public void showCredits(){
    try{
    String[] args = {};
    Credits.main(args);
    }catch (Exception e){}
    public static void main(String args[]){
    jframe = new Space();
    //jframe.centerPanel(500, jframe.select.getHeight());
    jframe.setUndecorated(true);
    jframe.setBounds(0, 0, jframe.SCREENWIDTH, jframe.SCREENHEIGHT);
    jframe.setVisible(true);
            jframe.show();
            jframe.setResizable(false);
          jframe.setDefaultCloseOperation(EXIT_ON_CLOSE);
        //jframe.centerPanel(jframe.select.getWidth(), jframe.select.getHeight());
        jframe.run(); //start music
    }Sorry I lost all the indenting :) I guess you can take a look at the few lines I changed and copy those lines.

  • Why won't apple tv play some youtube videos it used to play?

    Why won't apple tv play some youtube videos it used to play?

    Ah I see what you mean. Do these specs help:
    Format : MPEG-4
    Format profile : Base Media / Version 2
    Codec ID : mp42
    File size : 525 MiB
    Duration : 20mn 59s
    Overall bit rate : 3 494 Kbps
    Encoded date : UTC 2009-08-19 08:38:05
    Tagged date : UTC 2009-08-19 08:38:35
    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : [email protected]
    Format settings, CABAC : Yes
    Format settings, ReFrames : 5 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 20mn 59s
    Bit rate mode : Variable
    Bit rate : 3 333 Kbps
    Width : 1 280 pixels
    Height : 720 pixels
    Display aspect ratio : 16/9
    Frame rate mode : Variable
    Frame rate : 23.976 fps
    Minimum frame rate : 23.810 fps
    Maximum frame rate : 24.390 fps
    Resolution : 24 bits
    Colorimetry : 4:2:0
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.151
    Stream size : 501 MiB (95%)
    Writing library : x264 core 66 r1114 a933a3e
    Encoding settings : cabac=1 / ref=5 / deblock=1:-1:-1 / analyse=0x3:0x113 / me=umh / subme=7 / psy_rd=1.0:0.0 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chromaqpoffset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=3333 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.10
    Language : English
    Encoded date : UTC 2009-08-19 08:38:03
    Tagged date : UTC 2009-08-19 08:38:35
    Audio
    ID : 2
    Format : AAC
    Format/Info : Advanced Audio Codec
    Format version : Version 4
    Format profile : LC
    Format settings, SBR : No
    Codec ID : 40
    Duration : 20mn 59s
    Bit rate mode : Constant
    Bit rate : 156 Kbps
    Nominal bit rate : 160 Kbps
    Channel(s) : 2 channels
    Channel positions : L R
    Sampling rate : 48.0 KHz
    Resolution : 16 bits
    Stream size : 23.4 MiB (4%)

  • Trying to move a list of form variables to session variables of the same name

    I am trying to move a list of form variables to session variables of the same name and I am having a lot of trouble.
    I have never had to post of this forum with a language question in all the 10 years I have been using ColdFusion. I was a qa Engineer @ Allaire/Macromedia back when it was going from one to the other. I have a pretty good grasp of the language.
    I have software that runs off a list. The fieldnames are variable and stored off in an array. It's survey software that runs off a "meta file". In this example; I have the number of fields in the survey set to 12 in the "metafile". I have each field declared in that file in array Session.SurveyField[1] and the above loop works fine. I include this "metafile" at the start of the process.
    I cfloop around a struct and it works wherever I have needed to use it; such as here - writing to the database for example;
    <CFQUERY NAME="InsertRec" DATASOURCE="Survey">
    INSERT into #variables.SurveyTableName#
    (EntryTime
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    ,#Session.SurveyField[arrayindex]#
    </cfloop>
    <!--- EXAMPLE OF WHAT THE ABOVE GENERATES
    ,q01_name,q02_AcadTechORNA,q03_Water,q04_FirstAid,q05_CPR,q06_LifeGuard,q07_AED
    ,q08_ProjAdv,q09_Color,q10_SantaClaus,q11_Supervisor,q12_SupervisorOpinion --->
       VALUES
        ('#EntryTime#'
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thisname = "Session." & Session.SurveyField[arrayindex]>
    ,'#evaluate(variables.thisname)#'
    </cfloop>
    <!--- EXAMPLE OF WHAT THE ABOVE GENERATES
    ,'#Session.q01_name#','#Session.q02_AcadTechORNA#','#Session.q03_Water#','#Session.q04_Fi rstAid#'
    ,'#Session.q05_CPR#','#Session.q06_LifeGuard#','#Session.q07_AED#','#Session.q08_ProjAdv# ',
    ,'#Session.q09_Color#','#Session.q10_SantaClaus#','#Session.q11_Supervisor#','#Session.q1 2_SupervisorOpinion#' --->
    </CFQUERY>
    NOW HERE'S THE PROBLEM: I am running into trouble when trying to move the form variables to session variables of the same name. It is the only part of the software that I still need the datanames hard coded and that is a roadblock for me.
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thissessionfield = "Session." & Session.SurveyField[arrayindex]>
    <cfset thisformfield = "Form." & Session.SurveyField[arrayindex]>
    <cfset #thissessionfield# = #evaluate(thisformfield)#>
    </cfloop>
    I have tried it with or without the "evaluate"; same result. It doesn't give an error; it just ignores them (session variables look as such in the next page in the chain)
    q01_name=
    q02_acadtechorna=
    q03_water=
    q04_firstaid=
    q05_cpr=
    q06_lifeguard=
    q07_aed=
    q08_projadv=
    q09_color=
    q10_santaclaus=
    q11_supervisor=
    q12_supervisoropinion=
    Note: they exist because I CFPARAM them in a loop like the above at the start of the procedure) - and this works just fine!
    <cflock scope="Session" type="EXCLUSIVE" timeout="30">
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset dataname = "Session." & Session.SurveyField[arrayindex]>
    <cfparam name="#variables.dataname#" default="">
    </cfloop>
    </cflock>
    I EVEN tried exploiting the Form.Fieldnames list using CFLoop over the list and the same sort of logic within and it still gives me nothing....
    Here's the FORM.FIELDNAMES value
    "Q01_NAME,Q02_ACADTECHORNA,Q03_WATER,Q04_FIRSTAID,Q05_CPR,Q06_LIFEGUARD,Q07_AED,Q08_PROJAD V,Q09_COLOR,
    Q10_SANTACLAUS,Q11_SUPERVISOR,Q12_SUPERVISOROPINION"
    Here's the logic; SAME RESULT - The session variables don't get set.
    <cfoutput>
    <cfloop list="#Form.FieldNames#" index="thisfield">
    <!--- <br>#thisfield# --->
    <cfscript>
    thisSESSIONfield = "Session." & thisfield;
    thisFORMfield = "Form." & thisfield;
    #thisSESSIONfield# = #thisFORMfield#;
    </cfscript>
    </cfloop>
    </cfoutput>
    The CFPARAM in a loop with variable output name works just fine; so does the post (which I included above) as does the SQL Create, Param Form Variables, Param Session Variables, etc.
    THIS even works for moving BLANK to each session variable, to zero them all out at the end of the process;
    <cflock scope="Session" type="EXCLUSIVE" timeout="30">
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thislocalfield = Session.SurveyField[arrayindex]>
    <cfscript>
    thissessionfield = "Session." & thislocalfield;
    </cfscript>
    <cfset #thissessionfield# = "">
    </cfloop>
    </cflock>
    Expanding on that code, you would think this would work, but it doesn't;
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thislocalfield = Session.SurveyField[arrayindex]>
    <cfscript>
    thissessionfield = "Session." & thislocalfield;
    thisformfield = "Form." & thislocalfield;
    </cfscript>
    <!--- debug --->
    <!--- <cfoutput>#thissessionfield# = "#evaluate(thisformfield)#"</cfoutput><br> --->
    <cfoutput>
    <cfset #thissessionfield# = "#evaluate(thisformfield)#">
    </cfoutput>
    </cfloop>
    And see that debug code in the middle? To add insult to injury... When I uncomment that it shows me this. So it certainly looks like this should work....
    Session.q01_name = "Me"
    Session.q02_AcadTechORNA = "N/A"
    Session.q03_Water = "Yes (certificate expired)"
    Session.q04_FirstAid = "Yes (certificate is current)"
    Session.q05_CPR = "No"
    Session.q06_LifeGuard = "Yes (certificate expired)"
    Session.q07_AED = "Yes (certificate expired)"
    Session.q08_ProjAdv = "Yes (certificate expired)"
    Session.q09_Color = "Gray"
    Session.q10_SantaClaus = "Yes"
    Session.q11_Supervisor = "Da Boss"
    Session.q12_SupervisorOpinion = "Not a bad thing"
    There must be some simpler way to do this. This way won't work against all odds even though it seems so much like it should.
    So I end up having to hardcode it; still looking for an automated way to set these #@%$*@!## session variables over the list from the form variables of the same @#@!$#%$%# name. Do I sound frustrated???
    No matter what I do, if I don't HARDCODE like this;
    <cfset Session.q01_name = Form.q01_name>
    <cfset Session.q02_AcadTechORNA = Form.q02_AcadTechORNA>
    <cfset Session.q03_Water = Form.q03_Water>
    <cfset Session.q04_FirstAid = Form.q04_FirstAid>
    <cfset Session.q05_CPR = Form.q05_CPR>
    <cfset Session.q06_LifeGuard = Form.q06_LifeGuard>
    <cfset Session.q07_AED = Form.q07_AED>
    <cfset Session.q08_ProjAdv = Form.q08_ProjAdv>
    <cfset Session.q09_Color = Form.q09_Color>
    <cfset Session.q10_SantaClaus = Form.q10_SantaClaus>
    <cfset Session.q11_Supervisor = Form.q11_Supervisor>
    <cfset Session.q12_SupervisorOpinion = Form.q12_SupervisorOpinion>
    I always get this from my next page because the session variables are empty;
    You must answer question 1.
    You must answer question 2.
    You must answer question 3.
    You must answer question 4.
    You must answer question 5.
    You must answer question 6.
    You must answer question 7.
    You must answer question 8.
    You must answer question 9.
    You must answer question 10.
    I tried duplicate as well, but I can not get the above to work...
    Can anyone help me do this thing that one would think is simple????

    I think if you use structure array syntax you should get the results you want.
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
          <cfset session[Session.SurveyField[arrayindex]] = Form[Session.SurveyField[arrayindex]]>
    </cfloop>
    Or probably even easier.
    <cfset session = duplicate(form)>

  • Default initialisation of member variables and local variables

    I don't understand why member variables are initialized with default values by Java.
    Objects are initialized with "null" and primitives with "0", except boolean, which is initialized with "false".
    If these variables are used locally they are not initialized. The compiler requires them to be initialized by the programer, for example "String s = null".
    Why? What is the use of that difference?
    And why are arrays always initialized with default values, no matter if they are member variables or local variables? For example String[] s = new String[10]; s[0] to s[9] are initialized with "null", no matter if "s" is a local or member variable.
    Can someone please explain that strange difference, why it is used? To me it has no sense.

    Most of the time I have to initialize a local variable
    with "String s = null" in order to use it because
    otherwise the compile would complain. This is a cheap
    little trick, but I think everyone uses it.
    I wouldn't agree with "most of the time". The only cases where it is almost necessary to do that is when the variable should be initialized in a loop or a try-catch statement, and that doesn't happen too often.
    If local variables were initiliazed automatically without a warning it would be a Bad Thing: the compiler could tell when there is a possibility that a variable hasn't been assigned to and prevent manymanymany NullPointerExceptions on run time.
    And you didn't answer me why this principle is not
    used with arrays if it is so useful as you think.
    Possibly it is much more difficult to analyse the situation in the case of arrays; what if values are assigned to the elements in an order that depends on run time properties such as values returned from a random number generator.
    The more special rules one has to remember, the more
    likely one makes errors.I agree, but what is the rule to remember in this case?

  • Error: Object variable or with variable not set while accessing BPC Excel

    Hi,
    I am working on BPC NW 7.5. When I am trying to access BPC for Excel I am getting the below error.
    'object variable or with variable not set'
    When I click on BPC for Excel it ask for the credentials, after entering it we encounter this error.
    Any idea why is this happening?
    Regards,
    Priyanka Singh

    Hi Renne,
    Could you share me the solution to resolve the issue?
    I am getting an error "object variable or with block variable not set" while trying to submit data through an Input schedule.
    I am working on SAP BPC 7.0 NW and using MS Excel 2003.
    I can log in to BPC Admin and excel with my user id and password.
    Only when i am trying to click esubmit --> send and refresh schedules i am getting this error.
    I checked my security profile and i have the submit data task in my task profile.
    Following couple existing SDN postings i tried to check the ADD-INs of the excel on my system. However it looks like the steps listed in the existing SDN posts are for MS EXCEL 2007.
    Please suggest me how do i resolve this issue. Please note I am working on SAP BPC 7.0 NW and using MS Excel 2003.
    Regards,
    Jagat

  • How to get a "char variable" with presentation variable???

    I want to pass a char variable with presentation variable, I don't have problems if I pass "int".
    For example in answers page I add a column that contains years of my dimension. 2000 until 2012 and prompted my presentation variable "year" (from my dashboard prompt) and when I go to dashboard if I choose in my prompt 2006 in my report appear 2006...any problem and easy. But my problem is if I would pass a char variable, in my prompt also I have months but not numbers else names: January, February, March...and a presentation variable that name is "month". If I do the same report but change column year to month (name) I don't have any results and I have an error.
    How can I solucionate this???
    Thank you!!

    Alex,
    Do you have separate columns for Year and Month Name. If Yes, Then why it is so confusing?
    1. create a dashboard prompt with month name column
    2. Assign it to monthname variable
    3. In your report use above variable any where.., but what ever you are doing should be logical and valid to get some data.
    In general above approach will work.
    You said, "No! I don't want to do a filter with month! I would like to pass this variable, in this example don't make sense but I need to pass a char variable with presentation variable to do another things..."
    what does that mean, what you are trying to do with the variable in your report. If you give a example that would be better.
    - Madan

  • Static Variable using Dynamic Variable

    I have a need to display different variations of the current date across multiple reports - for example: YYYYMM, MMYYYY, YYYYDD, etc.
    I thought I could create an initialization block that maps three variables containing - YYYY, MM and DD.
    In the Static Variable I was going to do the different concatenation of these variables. I see in the Static Variable it allows me to go in and select repository variables in the Expression Builder, so if had two Dyanmic Variables (VarYYYY and VarMM) I select these for my new Static Variable and concatenate them (Valueof(VarYYYY) || Valueof(VarMM).
    However, when I go to the report and display this variable it displays just the text above, treating it like a string value, so all I see in the report is:
    Valueof("VarYYYY") || Valueof("VarMM")
    I am referencing in the report with the syntax
    @{biServer.variables['StaticVarName']}
    Is there a reason why it does not display the variable values?
    Thanks

    mmm some solution could be to write the same insert with decode/case statement and put there the conditions that you want.
    maybe something like this:
    SQL> ed
    Wrote file afiedt.buf
      1  begin
      2    for i in 1..10 loop
      3      insert into t1 (col1,col2,col3)
      4        values (i,
      5                decode (mod (i,2),0,i,null),
      6                decode (mod (i,3),0,i,null));
      7    end loop;
      8* end;
    SQL> /
    PL/SQL procedure successfully completed.
    SQL> select * from t1;
          COL1       COL2       COL3
             1
             2          2
             3                     3
             4          4
             5
             6          6          6
             7
             8          8
             9                     9
            10         10
    10 rows selected.
    SQL> truncate table t1;
    Table truncated.
    SQL> insert into t1 (col1,col2,col3)
      2    select rownum,
      3           decode (mod (rownum,2),0,rownum,null),
      4           decode (mod (rownum,3),0,rownum,null)
      5    from dual
      6  connect by rownum <=10;
    10 rows created.
    SQL> select * from t1;
          COL1       COL2       COL3
             1
             2          2
             3                     3
             4          4
             5
             6          6          6
             7
             8          8
             9                     9
            10         10
    10 rows selected.forgot that you are not using anymore the loop :)
    Message was edited by:
    Delfino Nunez

  • How to auto create a global variable with specific variable name in a global vi ?

    how to auto create a global variable with specific variable name in a global vi using lv ? Because i need to add a lot of global variable in this global vi. But you know, if  i manually add them , it will be a much time-costing work. So i want to use someway to auto generate ? Can i ?? Thanks a lot !

    Hi
    what aartjan is saying is the way for you. but you can develop an utility which will actually help you create global variables. To get the details on this just have a look at VI Scripting section on LAVA forum.
    But i would like you to suggest few things
    1. If your programs have so many global variables (Thats why u want utility) then you should take out some time to read about LabVIEW design patterns. I think if programmer follows these practicess he dont need a single global variable.
    2. Their are some other ways to achieve similar functionality as of global variables (Uninitialized Shift Registers, Single Element Qs and so on) but they are much faster than global variables.
    I am Attaching Whatever Resources i am having I will also attach the template of the design pattern i generaly use in short duration
    Message Edited by Tushar Jambhekar on 10-06-2005 07:33 PM
    Message Edited by Tushar Jambhekar on 10-06-2005 07:36 PM
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog
    Attachments:
    LabVIEWDesignPatterns.zip ‏1505 KB
    Large_Code_Implementation.zip ‏522 KB
    Database Tests.zip ‏868 KB

  • What's the difference between global variables and instance variables?

    hi im just a biginner,
    but what is the difference between these two?
    both i declare them above the constructor right.
    and both can access by any method in the class but my teacher said
    global variables are not permitted in java....
    but i don't know what that means....and i got started to confuse these two types,,
    im confusing.......
    and why my teacher said declaring global variables is not permitted,,,,,,
    why.....

    instance variables are kindof like Global variables. I'm not surprised you are confused.
    The difference is not in how they are declared, but rather in how they are used.
    There are two different "styles" of programming
    - procedural programming.
    - object oriented programming.
    Global variables are a term from Procedural programming.
    In this style of programming, you have only one class, and one "main" procedure. You only create one instance of the class, and then "run" it.
    There is one thread of control, which goes through various methods/procedures to accomplish your task.
    In this style of programming instance variables ARE "global" variables. They are accessible to all methods. There is only one instance of the class, and thus only one instance of the variables.
    Global variables are "bad" BECAUSE you can change them in any method you like. Even from places that shouldn't have to. Also if you use the same name as a global variable and a local variable, you can cause great trouble. This can lead to very subtle bugs, as the procedures interact in ways you don't expect.
    The preferred method in procedural programming is to pass the values as parameters to the methods, and only refer to the parameters, and local variables. This means that you can track exactly what your method is doing, and what it affects. It makes it simpler to understand. If you use global variables in your methods, it becomes harder to understand.
    So when are instance variables not global variables?
    When you are actually using the class as an Object, rather than just a program to run. If you are creating multiple instances of an object, all with different values for their instance variables, then they are not global variables. For instance you declare a Person object with an attribute "firstname". Your "main" program then creates many instances of the Person object, each with their own "firstname"
    I guess at the end of all this, it comes down to definitions.
    Certainly you can write procedural code in java. You can treat your instance variables, for all intents and purposes like global variables.
    I can only think to show a sort of example
    public class Test1
       User[] users;
       public void printUsers(){
         // loop through and print all the users
         // uses a global variable
          for(int i=0; i<users.length; i++){
            users.printUser();
    public void printUsers(User[] users){
    // preferred method - pass it the info it needs to do the job
    for(int i=0; i<users.length; i++){
    users[i].printUser();
    public Test1(){
    User u1 = new User("Tom", 20);
    User u2 = new User("Dick", 42);
    User u3 = new User("Harry", 69);
    users = new User[3];
    users[0] = u1;
    users[1] = u2;
    users[2] = u3;
    printUsers();
    printUsers(users);
    public static void main(String[] args)
    new Test1();
    class User{
    String firstName;
    int age;
    public User(String name, int age){
    this.firstName = name;
    this.age = age;
    public void printUser(){
    // here they are used as instance variables and not global variables
    System.out.println(firstName + " Age: " + age);
    Shit thats a lot of typing, and I'm not even sure I've explained it any good.
    Hope you can make some sense out of this drivel.
    Cheers,
    evnafets

  • HT3702 I only download things that are free from App Store, but sometimes it doesn't let me download something saying there is a problem with a previous purchase?  So why won't it let me??

    Why won't the App Store let me download things that are free, just because I don't have money on my card sometimes, it's free so I just don't get it??

    You can try to make a new account on iTunes Store if you didnt have yet.
    I had the same problem with iTunes Store, the only thing you can do is to put some money on that credit card you are using with you account. iTunes Store already keeping some money for the last purchase you made you can see all info on the Account option and then Purchase history ...

  • I am a new iPhone 4s owner. I have a tone in iTunes that I downloaded from the web as a m4r file. Why won't it sync to my iPhone so I can set it as a ringtone.

    I am a new iPhone 4s owner. I have a tone in iTunes that I downloaded from the web as a m4r file. Why won't it sync to my iPhone so I can set it as a ringtone?
    Lois

    Yes, the tone is available and checked in iTunes under the Tones library.
    Yes, it is also listed under the Tones tab for my iPhone, but it is grayed out.
    Yes, tones are selected under "sources" in General Preferences, along with everything else.
    SyncTones was NOT selected under the Tones tab for my iPhone. I did so and it synced.
    Thanks for your help!
    Lois

  • Why won't Apple give out the unlock code for an iPhone 3Gs when the contract was honored and I am still an AT

    Why won't Apple give out the unlock code for an iPhone 3Gs when the 2  year contract was honored and I continued to be an AT&T customer with an iPhone 4. I wanted my old 3gs unlocked so my daughter could use it overseas when she is deployed. AT&T service over there *****, the international plan was not worth it. The individual SIM cards per country are much more reliable and cheaper. Teslestial in Iraq and Afghanistan, Telecom in Croatia,Vodafphone in Germany and Italy.  Why Apple will not unlock these phones for our military to utilize is incomprehensible to me.  These young men and women are fighting for these Apple people to go to work every day, safe, to live lives they have become accustom to yet releasing a phone to use on another network they can't do at least for the military.... WHY APPLE??  WHY?   A good excuse not some of the many lame excuses I have received on the phone many times. AT&T states it is Apple that will not allow them to unlock the phones...  Please tell me why?  All I want Is my daughter to have a phone I trust, to be able to call me when she is given the free time to do so and I trust the apple phone.
    Apple, please reconsider your stance on this issue.  I am having a hard time understanding why you will not unlock the iPhone. 
    A simple code could allow me to talk to my daughter while fighting for our country the Great USA.  Apple should be on the front line and enabling those fighting for our life, liberty and pursuit of happiness to use unlocked phones on reliable local GSM networks.
    I honestly hope that someone who has some sort of authority to begin allowing the release of unlock codes, and not forcing people to unlock their phones with some program produced by some hack just to be able to use your wonderful phone.  That is is in a nutshell, People love the iPhone so much that they want the ability to use it on the most reliable GSM carrier available to them.  That should be a major compliment. Even men and women on the front line want your phone. I agree, my service is not the best where I live either, love the GSM technology so stay with it, but if I had the ability to change to the other GSM network that has much better coverage in this area of the country I would change. To change now I would not have my iPhone and that I will not part with. 
    Apple, please reconsider opening up the lock code and allow your gem of a phone to be used by many more people in many more areas and most importantly overseas fighting for our country.  I know if this is really thought about Apple would understand and come to the conclusion to release the unlock codes, and stop the people from hacking in to use the iPhone on other networks.
    I would love for my daughter to be able to use my iPhone 3gs while fighting for our Free country.
    A response would be appreciated.
    Thank you.
    An Apple customer for 10 years, phones and computers.
    P

    Defiled:
    I did sign a two year contract and completed that contract. The 3gs is no longer in service. My daughter is going overseas to protect you and your family. I was attempting to find a way for her to have a reliable phone that could offer her some connection with home as she travels through the middle east.  She travels in missions all over.
    At&T unlocks other phones of theirs why not the iPhone?  AT&T says that Apple will not give them the code, it is not the carrier.  If I would have known this situation would have come up I would have bought and unlocked 3gs phone"Deggie" .  My main complaint is that Apple has not good excuse as to why they will not allow their phones to be unlocked from services well, AT&T .  I bought the phone full price, completed the contract terms, even went for and iPhone 4 with another2 year contract, along with owning an apple computer... I love the product.  My main issue is give me a good answer as to why you won't allow a phone to be unlocked. It doesn't hurt Apple, People still have to buy the phones from them, and use their App store and iTunes.
    Sorry, just upset about my daughter heading over there, boots on the ground, and just pray she will be safe. Would have liked to facetime her while she is in the airports and in specific areas allowed for that.
    Please don't come down on me for asking this question. I understand all the contracts etc.... but to single out the iPhone specifically to not unlock after contract is over does not seem fair.
    Thank you for your responses.

Maybe you are looking for