A little help with this code?

I have a script that reads email in Outlook for Web, generates the folder structure by parsing the subject line, then downloads the file into the folder it just created.C#foreach (Item myItem in findResults.Items) { if (myItem is EmailMessage) { Console.WriteLine((myItem as EmailMessage).Subject); string strSubject = (myItem as EmailMessage).Subject; string[] strDelimiters = { " - ", " - " }; string []strTemp; string []strFolders; string strFileUrl; strTemp = strSubject.Split(strDelimiters, StringSplitOptions.None); strDelimiters[0] = " "; strDelimiters[1] = " "; strFolders = strTemp[1].Split(strDelimiters, 2, StringSplitOptions.None); strFolders[1] = strFolders[1].Replace('', '_'); //strFolderPath = preDownload(strFolders[0], strFolders[1]); // get message body PropertySet psPropset = new PropertySet(); psPropset.RequestedBodyType = ...
This topic first appeared in the Spiceworks Community

I have a script that reads email in Outlook for Web, generates the folder structure by parsing the subject line, then downloads the file into the folder it just created.C#foreach (Item myItem in findResults.Items) { if (myItem is EmailMessage) { Console.WriteLine((myItem as EmailMessage).Subject); string strSubject = (myItem as EmailMessage).Subject; string[] strDelimiters = { " - ", " - " }; string []strTemp; string []strFolders; string strFileUrl; strTemp = strSubject.Split(strDelimiters, StringSplitOptions.None); strDelimiters[0] = " "; strDelimiters[1] = " "; strFolders = strTemp[1].Split(strDelimiters, 2, StringSplitOptions.None); strFolders[1] = strFolders[1].Replace('', '_'); //strFolderPath = preDownload(strFolders[0], strFolders[1]); // get message body PropertySet psPropset = new PropertySet(); psPropset.RequestedBodyType = ...
This topic first appeared in the Spiceworks Community

Similar Messages

  • Need a little help with this code

    Hi,
    right now I'm going through the xmlmenu tutorial, which I've
    found at kirupa.com. It's pretty much clear to me. Then I decided
    to try to import a blur filter. And as soon as I wright the import
    flash.filter line, I get a syntax error. Where is the problem? How
    do I get button's blurx/y = 0 onRollover? I was thinking to apply
    the filter to menuitem mc (see the code)
    Here's the code

    yes, you are right - flash.filters. Another "syntax error"
    ;-). I did manage to get it work (the import line part). My next
    question is to which MC must I apply the blur filter to get next
    result:
    by default the buttons are blured. OnRollOver the button gets
    cleared of blur. Here's my blur code:
    var myBlur = new flash.filters.BlurFilter(20,20,2);
    var myTempFilters:Array = _root.mainmenu_mc.filters;
    ->which MC must be here to get the wanted result??????
    myTempFilters.push(myBlur);
    _root.mainmenu_mc.filters = myTempFilters;
    curr_item.onRollOut = function() {
    myBlur.blurX = 20;
    myBlur.blurY = 20;
    this.filters = new Array(myBlur);
    curr_item.onRollOver = function() {
    myBlur.blurX = 0;
    myBlur.blurY = 0;
    this.filters = new Array(myBlur);
    THX for your help

  • I need help with this code error "unreachable statement"

    the error_
    F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
    int index;
    ^
    F:\Java\Projects\Tools.java:71: missing return statement
    }//end delete method
    ^
    F:\Java\Projects\Tools.java:86: missing return statement
    }//end getrecod
    ^
    3 errors
    import java.util.*;
    import javax.swing.*;
    import java.awt.*;
    public class Tools//tool class
    private int numberOfToolItems;
    private ToolItems[] toolArray = new ToolItems[10];
    public Tools()//array of tool
    numberOfToolItems = 0;
    for(int i = 0; i < toolArray.length; i++)//for loop to create the array tools
    toolArray[i] = new ToolItems();
    }//end for loop
    }//end of array of tools
    public int search(int id)//search mehtod
    int index = 0;
    while (index < numberOfToolItems)//while and if loop search
    if(toolArray[index].getID() == id)
    return index;
    else
    index ++;
    }//en while and if loop
    return -1;
    }//end search method
    public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
    if(numberOfToolItems >= toolArray.length)
    return 0;
    int index;
    index = search(id); <-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------HERE
    if (index == -1)
    toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
    numberInStock ++;
    return 1;
    }//end if index
    }//end if toolitem array
    return -1;
    }//end insert method
    public int delete(/*int id*/)//delete method
    }//end delete method
    public void display()//display method
    for(int i = 0; i < numberOfToolItems; i++)
    //toolArray.display(g,y,x);
    }//end display method
    public String getRecord(int i)//get record method
    // return toolArray[i].getName()+ "ID: "+toolArray[i].getID()
    }//end getrecod
    }//end class
    Edited by: ladsoftware on Oct 9, 2009 6:08 AM
    Edited by: ladsoftware on Oct 9, 2009 6:09 AM
    Edited by: ladsoftware on Oct 9, 2009 6:10 AM
    Edited by: ladsoftware on Oct 9, 2009 6:11 AM

    ladsoftware wrote:
    Subject: Re: I need help with this code error "unreachable statement"
    F:\Java\Projects\Tools.java:51: unreachable statement <-----------------------------------------------------------------------------------------------------------------THIS
    int index;
    ^
    F:\Java\Projects\Tools.java:71: missing return statement
    }//end delete method
    ^
    F:\Java\Projects\Tools.java:86: missing return statement
    }//end getrecod
    ^
    3 errorsThe compiler is telling you exactly what the problems are:
    public int insert(int id, int numberInStock, int quality, double basePrice, String nm)//insert method
    if(numberOfToolItems >= toolArray.length)
    return 0; // <<== HERE you return, so everyting in the if block after this is unreachable
    int index;
    index = search(id);  //< -----------------------------------------------------------------------------------------------------------------HERE
    if (index == -1)
    toolArray[index].assign(id,numberInStock, quality, basePrice,nm);
    numberInStock ++;
    return 1;
    }//end if index
    }//end if toolitem array
    return -1;
    }//end insert method
    public int delete(/*int id*/)//delete method
    // <<== HERE where is the return statement?
    }//end delete method
    public String getRecord(int i)//get record method
    // return toolArray.getName()+ "ID: "+toolArray[i].getID() <<== HERE you commented out the return statement
    }//end getrecod
    }//end class

  • Can anyone help with this code

    i am trying to create a html5 video gallery for my website  I was wondering if anyone can help me with this code :  Am i missing something got this from the adobe widget browser i can get the button fuctions but i can not seem to get the video to play or work.. 

    This is the full page i am still working on it but the video code which i posted earlier is not working...    
    123456789101112131415
    Home
    Biography
    To Be Lead
    Gallery
    Videos
    Memorial Page
    Wallpaper
    Blog
    Forum
    Contact
    Randy Savage Bio
    Randy's Facts 101
    His Early Career
    Randy's Career in the WWF
    Randy's Career in WCW
    The Mega Powers  
    Mega powers Bio Mega Powers Facts 101 
    PM to fans and Elizabeth
    Randy's Radio interview
    His Death
    Elizabeth Hulette 
    Elizabeth Bio Elizabeth Facts 101 Her Career in the WWF Her Career in WCW Later Life Farewell to a Princess Elizabeth's Radio Interview Elizabeth Death 
    Sherri Martel
    Gorgeous George
    Team Madness
    Early Years
    ICW Gallery
    WWF Gallery
    WCW Gallery
    NWO Gallery
    Memorial Page for Randy
    Memorial Page for Elizabeth
                          Video of the Month    
    Site Disclaimer
    Macho-madness is in no way in contact with World Wrestling Entertainment. All photos are copyright to World Wrestling Entertainment or their respective owners and is being used under the fair copyright of Law 107.
    ©macho-madness.net All right's Reserved.  
            Affiliates
    Want to be an affiliate, elite, or partner site? Email: [email protected] with the list of things below.
    Place in the subject of email: “Randy Savage Online Affiliation”.
    Name: 
    Email: 
    Site Name: 
    Site URL: 
    When Will The Site Be Added?:
                        To see A List Click Here...
    ©macho-madness.net All right's Reserved.  
    Offical Links

  • Noob needs help with this code...

    Hi,
    I found this code in a nice tutorial and I wanna make slight
    adjustments to the code.
    Unfortunately my Action Script skills are very limited... ;)
    This is the code for a 'sliding menue', depending on which
    button u pressed it will 'slide' to the appropriate picture.
    Here's the code:
    var currentPosition:Number = large_pics.pic1._x;
    var startFlag:Boolean = false;
    menuSlide = function (input:MovieClip) {
    if (startFlag == false) {
    startFlag = true;
    var finalDestination:Number = input._x;
    var distanceMoved:Number = 0;
    var distanceToMove:Number =
    Math.abs(finalDestination-currentPosition);
    var finalSpeed:Number = .2;
    var currentSpeed:Number = 0;
    var dir:Number = 1;
    if (currentPosition<=finalDestination) {
    dir = -1;
    } else if (currentPosition>finalDestination) {
    dir = 1;
    this.onEnterFrame = function() {
    currentSpeed =
    Math.round((distanceToMove-distanceMoved+1)*finalSpeed);
    distanceMoved += currentSpeed;
    large_pics._x += dir*currentSpeed;
    if (Math.abs(distanceMoved-distanceToMove)<=1) {
    large_pics._x =
    mask_pics._x-currentPosition+dir*distanceToMove;
    currentPosition = input._x;
    startFlag = false;
    delete this.onEnterFrame;
    b1.onRelease = function() {
    menuSlide(large_pics.pic1);
    b2.onRelease = function() {
    menuSlide(large_pics.pic2);
    b3.onRelease = function() {
    menuSlide(large_pics.pic3);
    b4.onRelease = function() {
    menuSlide(large_pics.pic4);
    I need to adjust five things in this code...
    (1) I want this menue to slide vertically not horizontally.
    I changed the 'x' values in the code to 'y' which I thought
    would make it move vertically, but it doesn't work...
    (2) Is it possible that, whatever the distance is, the
    "sliding" time is always 2.2 sec ?
    (3) I need to implement code that after the final position is
    reached, the timeline jumps to a certain movieclip to a certain
    label - depending on what button was pressed of course...
    I tried to implement this code for button number two...
    b2.onRelease = function() {
    menuSlide(large_pics.pic2);
    if (currentPosition = finalDestination) {
    this.large_pics.pic2.gotoAndPlay("s1");
    --> sliding still works but it doesn't jump to the
    appropriate label...
    (4) I wanna add 'Next' & 'Previous' buttons to the slide
    show - what would be the code in this case scenario ?
    My first thought was something like that Flash checks which
    'pic' movieclip it is showing right now (pic1, pic2, pic3 etc.) and
    depending on what button u pressed u go to the y value of movieclip
    'picX + 1' (Next button) or 'picX - 1' (Previous button)...
    Is that possible ?
    (5) After implementing the Next & Previous buttons I need
    to make sure that when it reached the last pic movieclip it will
    not go further on the y value - because there is no more pic
    movieclip.
    Options are to either slide back to movieclip 'pic1' or
    simply do nothing any more on the next button...
    I know this is probably Kindergarten for you, but I have only
    slight ideas how to do this and no code knowledge to back it up...
    haha
    Thanx a lot for your help in advance !
    Always a pleasure to learn from u guys... ;)
    Mike

    Hi,
    I made some progress with the code thanx to the help of
    Simon, but there are still 2 things that need to be addressed...
    (1) I want the sliding time always to be 2.2 sec...
    here's my approach to it - just a theory but it might work:
    we need a speed that changes dynamically depending on the
    distance we have to travel...
    I don't know if that applies for Action Scrip but I recall
    from 6th grade, that...
    speed = distance / time
    --> we got the time (which is always 2.2 sec)
    --> we got the disctance
    (currentposition-finaldestination)
    --> this should automatically change the speed to the
    appropriate value
    Unfortunately I have no clue how the action script would look
    like (like I said my action script skills are very limited)...
    (2) Also, one other thing I need that is not implemented yet,
    is that when the final destination is reached it jumps to a certain
    label inside a certain movieclip - every time different for each
    button pressed - something like:
    if (currentPosition = finalDestination) {
    this.large_pics.pic2.gotoAndPlay("s1");
    that statement just doesn't work when I put it right under
    the function for each button...
    Thanx again for taking the time !!!
    Mike

  • Need a little help with this method

    this is what i need to do:
    Add a static method Account consolidate(Account acct1, Account acct2) to your Account class that creates a new
    account whose balance is the sum of the balances in acct1 and acct2 and closes acct1 and acct2. The new account should
    be returned. Two important rules of consolidation:
    ? Only accounts with the same name can be consolidated. The new account gets the name on the old accounts but a
    new account number (a random number).
    ? Two accounts with the same number cannot be consolidated. Otherwise this would be an easy way to double your
    money!
    right now i have this code but im not too positive i did it right (and i know its not done, but i just need some tips on what to do)
         public static Account AccountConsolidate(Account acct1, Account acct2)
              String name1 = acct1.getName();
              String name2 = acct2.getName();
              if(name1.equals(name2));
              newAccount = acct1.getBalance() + acct2.getBalance();
              newAccount = newAccount.getAcctNum();
              close acct2;
              return newAccount;
         }

    1. "close" is not a Java keyword.
    2. "newAccount" is being assigned twice.
    Not that there's anything wrong with that but what's
    the first assignment doing?
    3. "newAccount" seems to be an int but your
    method signature says to return an Account
    object.this is my entire code, and i made some changes in the consolidateAccount method
    // Account.java
    // A bank account class with methods to deposit to, withdraw from,
    // change the name on, and get a String representation
    // of the account.
    public class Account
         private double balance;
         private String name;
         private long acctNum;
         private static int numAccounts;
         private double newAccount;
    //Constructor -- initializes balance, owner, and account number
         public Account(double initBal, String owner, long number)
              balance = initBal;
              name = owner;
              acctNum = number;
              numAccounts++;
    // Checks to see if balance is sufficient for withdrawal.
    // If so, decrements balance by amount; if not, prints message.
         public void withdraw(double amount)
              if (balance >= amount)
              balance -= amount;
              else
              System.out.println("Insufficient funds");
    // Adds deposit amount to balance.
         public void deposit(double amount)
              balance += amount;
    // Returns balance.
         public double getBalance()
              return balance;
    //Returns number of accounts created
         public static int getNumAccounts()
              return numAccounts;
    // Returns name on the account
         public String getName()
              return name;
    // Returns account number
         public long getAcctNum()
              return acctNum;
    // Close the current account.
         public void close()
              if (balance == 0)
              numAccounts--;
              System.out.println("CLOSED");
    // Consolidates two accounts into one account.
         public static Account AccountConsolidate(Account acct1, Account acct2)
              String name1 = acct1.getName();
              String name2 = acct2.getName();
              if(name1.equals(name2));
              newAccount = acct1.getBalance() + acct2.getBalance();
              newAccount = newAccount.getAcctNum();
              Account consolidated = new Account(balance, name, newNumber);
              return consolidated;
    // Returns a string containing the name, account number, and balance.
         public String toString()
              return "Name:" + name +
              "\nAccount Number: " + acctNum +
              "\nBalance: " + balance;
         

  • I need help with this code

    Hello could any one tell me why this code is not writing to a file a i want to store what ever i enter in the applet a a file called applications.text
    Code:
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.applet.Applet.*;
    import javax.swing.border.*;
    public class ChinaTown5 extends JApplet
              implements ItemListener, ActionListener {
              private int foodIngrd1 = 0 ,foodIngrd2 = 0, foodIngrd3 = 0, foodIngrd4 = 0;
              private int foodIngrd5 = 0, foodIngrd6 = 0;                                    
              private JCheckBox hockey, football, swimming, golf, tennis, badminton;
              private String fName, lName, add, post_code, tel, url, datejoined,flag = "f1";
              private String value, converter, gender, sportType, show, sport, readData;
              private JRadioButton male, female;
              private JButton submit, clear, display;
              private DataInputStream receive;
              private DataOutputStream send;
              private String archive;
              Socket echoSocket = null;
    PrintWriter out = null;
    BufferedReader in = null;
              private JTextField joining_date;
              private JTextField textFName;
              private JTextField textLName;
              private JTextField telephone;
              private JTextField postcode;
              private JTextField address;
              private JTextField website;
              private JTextArea output,recieved;
              private double info = 0.0;
              private     ButtonGroup c;
              Socket Client ;
              public void init() {
                   JPanel main = new JPanel();     
                   JPanel info = new JPanel();
                   JPanel gender = new JPanel();
                   JPanel txt= new JPanel();
                   JPanel txtArea= new JPanel();
                   main.setLayout( new BorderLayout());
                   gender.setLayout(new GridLayout(1,2));
                   info.setLayout (new GridLayout(3,2 ));
                   txt.setLayout(new GridLayout(17,1));
                   txtArea.setLayout(new GridLayout(2,1));                                   
                   c = new ButtonGroup();
                   male = new JRadioButton("Male", false);
                   female = new JRadioButton("Female", false);
                   c.add(male);
                   c.add(female);
                   gender.add(male);
                   gender.add(female);
                   male.addItemListener(this);
                   female.addItemListener(this);
                   hockey = new JCheckBox ("Hockey");
                   info.add (hockey);
                   hockey.addItemListener (this);
                   football = new JCheckBox ("Football");
                   info.add (football);
                   football.addItemListener (this);
                   swimming = new JCheckBox ("Swimming");
                   info.add (swimming);
                   swimming.addItemListener (this);
                   tennis = new JCheckBox ("Tennis");
                   info.add (tennis);
                   tennis.addItemListener (this);
                   golf = new JCheckBox ("Golf");
                   info.add (golf);
                   golf.addItemListener (this);
                   badminton = new JCheckBox ("Badminton");
                   info.add (badminton);
                   badminton.addItemListener (this);
                   txt.add (new JLabel("First Name:"));
                   textFName = new JTextField(20);
                   txt.add("Center",textFName);
                   textFName.addActionListener (this);
                   txt.add (new JLabel("Last Name:"));
                   textLName = new JTextField(20);
                   txt.add("Center",textLName);
                   textLName.addActionListener (this);
                   txt.add (new JLabel("Telephone:"));
                   telephone = new JTextField(15);
                   txt.add("Center",telephone);
                   telephone.addActionListener (this);
                   txt.add (new JLabel("Date Joined:"));
                   joining_date = new JTextField(10);
                   txt.add("Center",joining_date);
                   joining_date.addActionListener (this);
                   txt.add (new JLabel("Address:"));
                   address = new JTextField(40);
                   txt.add("Center",address);
                   address.addActionListener (this);
                   txt.add (new JLabel("Postcode:"));
                   postcode = new JTextField(15);
                   txt.add("Center",postcode);
                   postcode.addActionListener (this);
                   txt.add (new JLabel("URL Address:"));
                   website = new JTextField(25);
                   txt.add("Center",website);
                   website.addActionListener (this);
                   output = new JTextArea( 15, 45);
                   output.setEditable( false );
                   output.setFont( new Font( "Arial", Font.BOLD, 12));
                   recieved = new JTextArea( 10, 40);
                   recieved .setEditable( false );
                   recieved .setFont( new Font( "Arial", Font.BOLD, 12));
                   txtArea.add(output);
                   txtArea.add(recieved);
                   submit = new JButton ("Submit Details");
                   submit.setEnabled(false);
                   info.add (submit);
                   submit.addActionListener(this);
                   clear = new JButton ("Clear Form");
                   clear.addActionListener(this);
                   info.add (clear);
                   display = new JButton ("Display");
                   display.addActionListener(this);
                   info.add (display);
                   EtchedBorder border = new EtchedBorder();
                   gender.setBorder(new TitledBorder(border,"Sex" ));
                   main.setBorder(new TitledBorder(border,"Computer Programmers Sports Club" ));
                   EtchedBorder border_sport = new EtchedBorder();
                   info.setBorder(new TitledBorder(border_sport," Select Preferred Sport(s)" ));
                   EtchedBorder border_info = new EtchedBorder();
                   txt.setBorder(new TitledBorder(border_info ," Personal Information" ));
                   EtchedBorder border_txtArea= new EtchedBorder();
                   txtArea.setBorder(new TitledBorder(border_info ," Registration Details" ));
                   main.add("North",txt);
                   main.add("West",gender);
                   main.add("East",info);
                   main.add("South",txtArea);
                   setContentPane(main);
              public void itemStateChanged (ItemEvent event) {
                   if (event.getItemSelectable() == male) {
                        gender = "Male";
                   else if (event.getItemSelectable() == female) {
                        gender = "Female";
                   if (event.getSource() == hockey) {
                             if (event.getStateChange() == ItemEvent.SELECTED) {
                                  sport = sport + hockey.getLabel() + " ";
                   else if (event.getSource() == golf) {
                             if (event.getStateChange() == ItemEvent.SELECTED) {
                                  sport = sport + golf.getLabel() + " ";
                   else if (event.getSource() == badminton) {
                             if (event.getStateChange() == ItemEvent.SELECTED) {
                                  sport = sport + badminton.getLabel() + " ";
                   else if (event.getSource() == swimming) {
                             if (event.getStateChange() == ItemEvent.SELECTED) {
                                  sport = sport + swimming.getLabel() + " ";
                   else if (event.getSource() == tennis) {
                             if (event.getStateChange() == ItemEvent.SELECTED) {
                                  sport = sport + tennis.getLabel() + " ";
                   else if (event.getSource() == football) {
                             if (event.getStateChange() == ItemEvent.SELECTED) {
                                  sport = sport + football.getLabel() + " ";
                   chkError();
                   repaint();
              public void chkError() {
                   if (gender != " " && sport != " " && fName != " " && lName != " "
                        && add != " " && post_code != " " && datejoined != " " ) {
                        submit.setEnabled(true);
              public void errMsg() {
                        JOptionPane.showMessageDialog( null, "Please Enter your Name and address and date joined and your sex");
                        show = (      "\n\t\t **************************************************" +
                                       "\n\t\t\t Error" +
                                       "\n\t\t **************************************************" +
                                       "\n\n\t Please Enter your Name and address and date joined and your sex");
                        output.setText( show );               
              public void displayDetails() {          
                   show = ( "\n\t\t **************************************************" +
                             "\n\t\t\t Registration Details" +
                             "\n\t\t **************************************************" +
                             "\n\t First Name:" + "\t" + fName +
                             "\n\t Last name: " + "\t" + lName +
                             "\n\t Sex:" + "\t" + gender +
                             "\n\t Tel No:" + "\t" + tel +
                             "\n\t Url Address:" + "\t" + url +
                             "\n\t Address:" + "\t" + add +
                             "\n\t Postcode:" + "\t" + post_code +
                             "\n\t Sport:" + "\t" + sport +
                             "\n\n\t\t\t Thank You For Registering" );
                   output.setText( show );
              public void LogFile() {
                   archive = ("\n\t First Name:" + "\t" + fName +
                             "\n\t Last name: " + "\t" + lName +
                             "\n\t Sex:" + "\t" + gender +
                             "\n\t Tel No:" + "\t" + tel +
                             "\n\t Url Address:" + "\t" + url +
                             "\n\t Address:" + "\t" + add +
                             "\n\t Postcode:" + "\t" + post_code +
                             "\n\t Sport:" + "\t" + sport);
                   try {
              BufferedWriter out = new BufferedWriter(new FileWriter("applications.txt"));
              out.write(archive);
              out.close();
              catch ( IOException e) {System.out.println("Exception: File Not Found");}
              public void actionPerformed (ActionEvent e){
                   if ( e.getSource() == submit) {
                        datejoined = joining_date.getText();
                        post_code = postcode.getText();
                        fName = textFName.getText();
                        lName = textLName.getText();
                        add = address.getText();
                        tel = telephone.getText();
                        url = website.getText();
                        if ( gender != " " && sport != " " && fName != " " && lName != " "
                        && add != " " && post_code != " " && datejoined != " " ) {     
                        LogFile();
                        displayDetails();
                        else { errMsg(); }
                   if (e.getSource() == display) {
                        try {
                             BufferedReader reader = new BufferedReader(new FileReader(new File("applications.txt")));
                             String readData;
                             while( (readData = reader.readLine()) != null ){     
                                  out.println(readData);
                                  recieved.setText(readData);
                        catch (IOException err) {System.err.println("Error: " + err);}          
                   if ( e.getSource() == clear ) {
                        badminton.setSelected(false);
                        swimming.setSelected(false);
                        football.setSelected(false);
                        tennis.setSelected(false);
                        hockey.setSelected(false);
                        golf.setSelected(false);
                        female.setSelected(false);
                        male.setSelected(false);
         textFName.setText(" ");
                        textLName.setText(" ");
                        address.setText(" ");
                        postcode.setText(" ");
                        telephone.setText(" ");
                        website.setText(" ");
                        joining_date.setText(" ");
                        output.setText(" ");
                        gender = " ";
                        sport = " ";
              repaint ();
    }

    Why isn't it writing to a file? Most likely because it's an applet and you haven't signed it. Applets are not allowed to access data on the client system like that.

  • A little help with some code and theory

    Hey guys, I'm kinda new to this whole programming thing so
    bare with me please. I have a little problem that I just can't seem
    to get my hear around. I have a working on an inventory management
    page. It keeps track of what software is installed where and how
    many copies we have, and serials and such. Well, this page was set
    up long before I started here and it wasn't too friendly. So I'm
    editing it and adding some new features. Well one of them is
    displaying the “available installs count” with the
    search results.
    Here is my problem. The way the system keeps track of what
    software is installed where is by adding taking the appId from the
    table it with all the app's information on it (the sn, name, max
    installs, etc) and creating a new entry in another table that
    indexs that appId and the workstation it is installed on. (along
    with an Install id) well the only way to check to see how many
    copies is installed is to get the record count for a particular
    appId.
    This is where I run into trouble. When a user searches for
    apps the results page displays the apps that still have installs
    available. So where the record count of getInstallCount for
    whatever appId is less than the max installs. Well what is the best
    way to do this since to get the record count of getInstallCount I
    need an appID and the appID isn't found until I do the search
    query. What I'm using now is this but it always returns 0 for
    current Install Count. See the attached Snippet of code:
    I see what it is doing. It is getting the isntallCount for
    all appIds, but I dont' know how to narrow it down without doing
    the search first, and I don't know how to do the search with out
    getting the install count first. Any ideas or advice would rock
    guys. Like I said I'm kinda new to this programming stuff but it is
    awesome! Thanks!
    Kevin

    The w and wi are just table aliases that make it easier to
    referrence those tables by column when joining multiple tables
    (avoids having to prefix column names with the entire table name,
    etc.) When doing a self-join (joining a table to itself), the use
    of table aliases is
    required, otherwise you would have no other way to tell
    which column belonged to which "instance" of table.
    The query itself is pretty simple. It is just using a
    correlated subquery to select only those instances of
    workstationApps where the count of appID instances in
    workstationAppIndex is less than the amount specified in the
    maxConcurrentInstalls for the same appID.
    Also, I do see what you are doing with #form.searchType#, I
    was just making sure that it was what you really intended to do.
    Phil

  • Need Help with this code

    I am very new to java (just started today), and I am trying to do a mortgage calculator in java. I have a class file which I am using but when I try to compile it, I get the error message "Exception in thread "main" java.lang.NoClassDefFoundError: Mortgage Loan". I realize that this means I am missing a public static void somewhere (sounds like I know what I am talking about huh?) The problem is I don't know where to put it or even what to put in it. I got the code from another site and it seems to work fine there. Here is the code for the class file....any help anyone can offer will be greatly appreciated. thx
    import KJEgraph.*;
    import KJEgui.*;
    import java.applet.Applet;
    import java.awt.*;
    import java.io.PrintStream;
    public class MortgageLoan extends CalculatorApplet
    public MortgageLoan()
    RC = new MortgageLoanCalculation();
    cmbPREPAY_TYPE = new KJEChoice();
    lbLOAN_AMOUNT = new Label("");
    lbINTEREST_PAID = new Label("");
    lbTOTAL_OF_PAYMENTS = new Label("");
    lbMONTHLY_PI = new Label("");
    lbMONTHLY_PITI = new Label("");
    lbPREPAY_INTEREST_SAVINGS = new Label("");
    public double getPayment()
    calculate();
    return RC.MONTHLY_PI;
    public void initCalculatorApplet()
    tfINTEREST_RATE = new Nbr("INTEREST_RATE", "Interest rate", 1.0D, 25D, 3, 4, this);
    tfTERM = new Nbr("TERM", "Term", 0.0D, 30D, 0, 5, this);
    tfLOAN_AMOUNT = new Nbr("LOAN_AMOUNT", "Mortgage amount", 100D, 100000000D, 0, 3, this);
    tfPREPAY_STARTS_WITH = new Nbr("PREPAY_STARTS_WITH", "Start with payment", 0.0D, 360D, 0, 5, this);
    tfPREPAY_AMOUNT = new Nbr("PREPAY_AMOUNT", "Amount", 0.0D, 1000000D, 0, 3, this);
    if(getParameter("PAYMENT_PI") == null)
    tfPAYMENT_PI = new Nbr(0.0D, getParameter("MSG_PAYMENT_PI", "Payment"), 0.0D, 10000D, 0, 3);
    else
    tfPAYMENT_PI = new Nbr("PAYMENT_PI", "Payment", 0.0D, 10000D, 0, 3, this);
    tfYEARLY_PROPERTY_TAXES = new Nbr("YEARLY_PROPERTY_TAXES", "Annual property taxes", 0.0D, 100000D, 0, 3, this);
    tfYEARLY_HOME_INSURANCE = new Nbr("YEARLY_HOME_INSURANCE", "Annual home insurance", 0.0D, 100000D, 0, 3, this);
    super.nStack = 1;
    super.bUseNorth = false;
    super.bUseSouth = true;
    super.bUseWest = true;
    super.bUseEast = false;
    RC.PREPAY_NONE = getParameter("MSG_PREPAY_NONE", RC.PREPAY_NONE);
    RC.PREPAY_MONTHLY = getParameter("MSG_PREPAY_MONTHLY", RC.PREPAY_MONTHLY);
    RC.PREPAY_YEARLY = getParameter("MSG_PREPAY_YEARLY", RC.PREPAY_YEARLY);
    RC.PREPAY_ONETIME = getParameter("MSG_PREPAY_ONETIME", RC.PREPAY_ONETIME);
    RC.MSG_YEAR_NUMBER = getParameter("MSG_YEAR_NUMBER", RC.MSG_YEAR_NUMBER);
    RC.MSG_PRINCIPAL = getParameter("MSG_PRINCIPAL", RC.MSG_PRINCIPAL);
    RC.MSG_INTEREST = getParameter("MSG_INTEREST", RC.MSG_INTEREST);
    RC.MSG_PAYMENT_NUMBER = getParameter("MSG_PAYMENT_NUMBER", RC.MSG_PAYMENT_NUMBER);
    RC.MSG_PRINCIPAL_BALANCE = getParameter("MSG_PRINCIPAL_BALANCE", RC.MSG_PRINCIPAL_BALANCE);
    RC.MSG_PREPAYMENTS = getParameter("MSG_PREPAYMENTS", RC.MSG_PREPAYMENTS);
    RC.MSG_NORMAL_PAYMENTS = getParameter("MSG_NORMAL_PAYMENTS", RC.MSG_NORMAL_PAYMENTS);
    RC.MSG_PREPAY_MESSAGE = getParameter("MSG_PREPAY_MESSAGE", RC.MSG_PREPAY_MESSAGE);
    RC.MSG_RETURN_AMOUNT = getParameter("MSG_RETURN_AMOUNT", RC.MSG_RETURN_AMOUNT);
    RC.MSG_RETURN_PAYMENT = getParameter("MSG_RETURN_PAYMENT", RC.MSG_RETURN_PAYMENT);
    RC.MSG_GRAPH_COL1 = getParameter("MSG_GRAPH_COL1", RC.MSG_GRAPH_COL1);
    RC.MSG_GRAPH_COL2 = getParameter("MSG_GRAPH_COL2", RC.MSG_GRAPH_COL2);
    cmbPREPAY_TYPE.addItem(RC.PREPAY_NONE);
    cmbPREPAY_TYPE.addItem(RC.PREPAY_MONTHLY);
    cmbPREPAY_TYPE.addItem(RC.PREPAY_YEARLY);
    cmbPREPAY_TYPE.addItem(RC.PREPAY_ONETIME);
    cmbPREPAY_TYPE.select(getParameter("PREPAY_TYPE", RC.PREPAY_NONE));
    CheckboxGroup checkboxgroup = new CheckboxGroup();
    cbPRINCIPAL = new Checkbox(getParameter("MSG_CHKBOX_PRINCIPAL_BAL", "Principal balances"), checkboxgroup, true);
    cbAMTS_PAID = new Checkbox(getParameter("MSG_CHKBOX_TOTAL_PAYMENTS", "Total payments"), checkboxgroup, false);
    CheckboxGroup checkboxgroup1 = new CheckboxGroup();
    cbYEAR = new Checkbox(getParameter("MSG_CHKBOX_BY_YEAR", "Report amortization schedule by year"), checkboxgroup1, true);
    cbMONTH = new Checkbox(getParameter("MSG_CHKBOX_BY_MONTH", "Report amortization schedule by Month"), checkboxgroup1, false);
    cbYEAR.setBackground(getBackground());
    cbMONTH.setBackground(getBackground());
    setCalculation(RC);
    cmbTERM = getMortgageTermChoice(getParameter("TERM", 30));
    public void initPanels()
    DataPanel datapanel = new DataPanel();
    DataPanel datapanel1 = new DataPanel();
    DataPanel datapanel2 = new DataPanel();
    int i = 1;
    datapanel.setBackground(getColor(1));
    boolean flag = getParameter("SHOW_PITI", false);
    boolean flag1 = getParameter("SHOW_PREPAY", true);
    datapanel.addRow(new Label(" " + getParameter("MSG_LOAN_INFORMATION", "Loan Information") + super._COLON), getBoldFont(), i++);
    datapanel.addRow(tfLOAN_AMOUNT, getPlainFont(), i++);
    bAllTerms = getParameter("SHOW_ALLTERMS", false);
    if(bAllTerms)
    datapanel.addRow(tfTERM, getPlainFont(), i++);
    else
    datapanel.addRow(getParameter("MSG_TERM", "Term") + super._COLON, cmbTERM, getPlainFont(), i++);
    datapanel.addRow(tfINTEREST_RATE, getPlainFont(), i++);
    if(flag)
    datapanel.addRow(tfYEARLY_PROPERTY_TAXES, getPlainFont(), i++);
    datapanel.addRow(tfYEARLY_HOME_INSURANCE, getPlainFont(), i++);
    if(flag)
    datapanel.addRow(getParameter("MSG_MONTHLY_PAYMENT", "Monthly payment (PI)") + " " + super._COLON, lbMONTHLY_PI, getPlainFont(), i++);
    datapanel.addRow(getParameter("MSG_PITI", "Monthly payment (PITI)") + " " + super._COLON, lbMONTHLY_PITI, getPlainFont(), i++);
    } else
    datapanel.addRow(getParameter("MSG_MONTHLY_PAYMENT", "Monthly payment") + " " + super._COLON, lbMONTHLY_PI, getPlainFont(), i++);
    if(!flag || !flag1)
    datapanel.addRow(getParameter("MSG_TOTAL_PAYMENTS", "Total payments") + " " + super._COLON, lbTOTAL_OF_PAYMENTS, getPlainFont(), i++);
    datapanel.addRow(getParameter("MSG_TOTAL_INTEREST", "Total interest") + " " + super._COLON, lbINTEREST_PAID, getPlainFont(), i++);
    datapanel.addRow("", new Label(""), getTinyFont(), i++);
    if(flag1)
    datapanel.addRow(new Label(" " + getParameter("MSG_PREPAYMENTS", "Prepayments") + " " + super._COLON), getBoldFont(), i++);
    datapanel.addRow(getParameter("MSG_PREPAYMENT_TYPE", "Type") + " " + super._COLON, cmbPREPAY_TYPE, getPlainFont(), i++);
    datapanel.addRow(tfPREPAY_AMOUNT, getPlainFont(), i++);
    datapanel.addRow(tfPREPAY_STARTS_WITH, getPlainFont(), i++);
    datapanel.addRow(getParameter("MSG_PREPAYMENT_SAVINGS", "Savings") + " " + super._COLON, lbPREPAY_INTEREST_SAVINGS, getPlainFont(), i++);
    Panel panel = new Panel();
    panel.setBackground(getColor(1));
    panel.setLayout(new BorderLayout());
    panel.add("Center", datapanel);
    panel.add("East", new Label(""));
    cbPRINCIPAL.setBackground(getColor(2));
    cbAMTS_PAID.setBackground(getColor(2));
    datapanel2.setBackground(getColor(2));
    datapanel1.addRow("", cbYEAR, "", cbMONTH, getPlainFont(), 1);
    datapanel2.addRow("", cbPRINCIPAL, "", cbAMTS_PAID, getPlainFont(), 1);
    gGraph = new Graph(new GraphLine(), imageBackground());
    gGraph.FONT_TITLE = getGraphTitleFont();
    gGraph.FONT_BOLD = getBoldFont();
    gGraph.FONT_PLAIN = getPlainFont();
    gGraph.setBackground(getColor(2));
    gGraph.setForeground(getForeground());
    Panel panel1 = new Panel();
    panel1.setLayout(new BorderLayout());
    panel1.add("North", datapanel2);
    panel1.add("Center", gGraph);
    panel1.setBackground(getColor(2));
    addPanel(panel);
    addDataPanel(datapanel1);
    addPanel(panel1);
    public void refresh()
    gGraph._bUseTextImages = false;
    if(cbAMTS_PAID.getState())
    gGraph.setBackground(getColor(2));
    gGraph.removeAll();
    gGraph._legend.setVisible(true);
    gGraph._legend.setOrientation(14);
    gGraph._titleXAxis.setText("");
    gGraph._titleGraph.setText("");
    gGraph._axisX.setVisible(true);
    gGraph._axisY.setVisible(true);
    gGraph.setGraphType(new GraphStacked());
    gGraph.setGraphCatagories(RC.getAmountPaidCatagories());
    try
    gGraph.add(new GraphDataSeries(RC.DS_PRINCIPAL, RC.MSG_PRINCIPAL, getGraphColor(1)));
    gGraph.add(new GraphDataSeries(RC.DS_INTEREST, RC.MSG_INTEREST, getGraphColor(2)));
    gGraph._axisY._bAutoMinimum = false;
    gGraph._axisY._axisMinimum = 0.0F;
    gGraph._axisY._bAutoMaximum = false;
    gGraph._axisY._axisMaximum = (float)(RC.TOTAL_OF_PAYMENTS / (double)RC.iFactor2);
    catch(Exception _ex)
    System.out.println("Huh?");
    gGraph._titleYAxis.setText("");
    gGraph._titleGraph.setText(RC.getAmountLabel2());
    gGraph.dataChanged(true);
    } else
    gGraph.setBackground(getColor(2));
    gGraph.removeAll();
    gGraph._legend.setVisible(true);
    gGraph._legend.setOrientation(4);
    gGraph._titleXAxis.setText(RC.MSG_PAYMENT_NUMBER);
    gGraph._titleGraph.setText("");
    gGraph._titleYAxis.setText(RC.MSG_PRINCIPAL_BALANCE);
    gGraph._axisX.setVisible(true);
    gGraph._axisY.setVisible(true);
    gGraph.setGraphType(new GraphLine());
    gGraph.setGraphCatagories(RC.getCatagories());
    try
    if(cmbPREPAY_TYPE.getSelectedItem().equals(RC.PREPAY_NONE))
    gGraph.add(new GraphDataSeries(RC.DS_PRINCIPAL_BAL, RC.MSG_NORMAL_PAYMENTS, getGraphColor(1)));
    } else
    gGraph.add(new GraphDataSeries(RC.DS_PREPAY_PRINCIPAL_BAL, RC.MSG_PREPAYMENTS, getGraphColor(2)));
    gGraph.add(new GraphDataSeries(RC.DS_PRINCIPAL_BAL, RC.MSG_NORMAL_PAYMENTS, getGraphColor(1)));
    gGraph._axisY._bAutoMinimum = false;
    gGraph._axisY._bAutoMaximum = true;
    gGraph._axisY._axisMinimum = 0.0F;
    catch(Exception _ex)
    System.out.println("Huh?");
    gGraph._titleYAxis.setText(RC.getAmountLabel());
    gGraph._titleGraph.setText("");
    gGraph.dataChanged(true);
    gGraph._titleXAxis.setText(RC.MSG_YEAR_NUMBER);
    lbMONTHLY_PITI.setText(Fmt.dollars(RC.MONTHLY_PITI, 2));
    lbMONTHLY_PI.setText(Fmt.dollars(RC.MONTHLY_PI, 2));
    lbLOAN_AMOUNT.setText(Fmt.dollars(RC.LOAN_AMOUNT));
    lbTOTAL_OF_PAYMENTS.setText(Fmt.dollars(RC.PREPAY_TOTAL_OF_PAYMENTS, 2));
    lbINTEREST_PAID.setText(Fmt.dollars(RC.PREPAY_INTEREST_PAID, 2));
    lbPREPAY_INTEREST_SAVINGS.setText(Fmt.dollars(RC.PREPAY_INTEREST_SAVINGS, 2));
    setTitle("Fixed Mortgage Loan Calculator");
    public void setValues()
    throws NumberFormatException
    RC.PREPAY_TYPE = cmbPREPAY_TYPE.getSelectedItem();
    RC.PREPAY_AMOUNT = tfPREPAY_AMOUNT.toDouble();
    RC.PREPAY_STARTS_WITH = tfPREPAY_STARTS_WITH.toDouble();
    RC.INTEREST_RATE = tfINTEREST_RATE.toDouble();
    RC.YEARLY_PROPERTY_TAXES = tfYEARLY_PROPERTY_TAXES.toDouble();
    RC.YEARLY_HOME_INSURANCE = tfYEARLY_HOME_INSURANCE.toDouble();
    if(bAllTerms)
    RC.TERM = (int)tfTERM.toDouble();
    else
    RC.TERM = getMortgageTerm(cmbTERM);
    RC.LOAN_AMOUNT = tfLOAN_AMOUNT.toDouble();
    if(cbYEAR.getState())
    RC.BY_YEAR = 1;
    else
    RC.BY_YEAR = 0;
    RC.MONTHLY_PI = tfPAYMENT_PI.toDouble();
    if(RC.MONTHLY_PI > 0.0D)
    RC.PAYMENT_CALC = 0;
    else
    RC.PAYMENT_CALC = 1;
    MortgageLoanCalculation RC;
    Nbr tfINTEREST_RATE;
    Choice cmbTERM;
    Nbr tfTERM;
    boolean bAllTerms;
    Nbr tfLOAN_AMOUNT;
    Nbr tfPREPAY_AMOUNT;
    Nbr tfPREPAY_STARTS_WITH;
    Nbr tfPAYMENT_PI;
    Nbr tfYEARLY_PROPERTY_TAXES;
    Nbr tfYEARLY_HOME_INSURANCE;
    KJEChoice cmbPREPAY_TYPE;
    Label lbLOAN_AMOUNT;
    Label lbINTEREST_PAID;
    Label lbTOTAL_OF_PAYMENTS;
    Label lbMONTHLY_PI;
    Label lbMONTHLY_PITI;
    Label lbPREPAY_INTEREST_SAVINGS;
    Checkbox cbPRINCIPAL;
    Checkbox cbAMTS_PAID;
    Graph gGraph;
    Checkbox cbYEAR;
    Checkbox cbMONTH;
    }

    There are imports that aren't available to us, so no. nobody probaly can. Of course maybe someon could be bothered going through all of your code, and may spot some mistake. But I doubt they will since you didn't bother to use [c[b]ode] tags.

  • Please help with this code....

    I create a button with ActionListner and a writeCd method. Now I want everytime i push the button, it will read the writeCd method. I dont' know how to make it work. Please help me out as soon as possible. Thanks a lot. Below are the codes of the button and writeCd method.
    class findCD implements ActionListener
    public void actionPerformed(ActionEvent event)
    //what do I need to put here to make the button work
    //with method writeCD() below
    public void writeCd() throws Exception
    String outputFileName;
    PrintWriter outputFile;
    outputFileName = "D:\\cdoutput.txt";
    outputFile = new PrintWriter(new FileWriter(outputFileName,true));
    int loopTest;
    do
    String numStr = JOptionPane.showInputDialog("Please enter Index number");
    int number = Integer.parseInt(numStr);
    cC.setIndexNumber(number);
    numStr = JOptionPane.showInputDialog("Please enter cd name");
    number = Integer.parseInt(numStr);
    cC.setCdName(number);
    String message = cC.toString() +
    "\nYour input is: ";
    JOptionPane.showMessageDialog(null, message);
    outputFile.println(numStr + "");
    loopTest = JOptionPane.showConfirmDialog(null,"Do another?","",0,1);
    while (loopTest == 0);
    outputFile.close();

    class findCD implements ActionListener
           public void actionPerformed(ActionEvent event)
                try
                     writeCd();
                } catch(Exception e){
                                        e.printStackTrace();
      public void writeCd() throws Exception
          String outputFileName;
          PrintWriter outputFile;
          outputFileName = "D:\\cdoutput.txt";
    outputFile = new PrintWriter(new
    (new FileWriter(outputFileName,true));
             int loopTest;
             do
    String numStr =
    umStr = JOptionPane.showInputDialog("Please enter
    Index number");
             int number = Integer.parseInt(numStr);
             cC.setIndexNumber(number);
    numStr = JOptionPane.showInputDialog("Please
    "Please enter cd name");
             number = Integer.parseInt(numStr);
             cC.setCdName(number);
             String message = cC.toString() +
                              "\nYour input is: ";
             JOptionPane.showMessageDialog(null, message);
            outputFile.println(numStr + "");
    loopTest =
    pTest = JOptionPane.showConfirmDialog(null,"Do
    another?","",0,1);
             while (loopTest == 0);
           outputFile.close();
        }That should work. This also assumes that the method writeCd is in the class findCD.

  • Need some help with this code.

    var myDoc = app.documents[0]
    var mySel = app.selection[0]
    var myStory = mySel.parentStory; // Now we are pointing to the entire story
    var myHolidayStyle1 = "Holiday-Header" // Header 'day of the week'
    var myHolidayStyle2 = "Holiday-Sub-Heading-Date" // Header 'month and day'
    var myHolidayStyle3 = "Holiday-Header-Body" // Lead Paragraph 'default paragraph style'
    if (mystory = "Monday" ) {
        paragraphs(0).appliedparagraphstyles = myHolidayStyle1;
    else if (mystory = "Tuesday") {
        mystory.paragraphs(0). appliedparagraphstyles = myHoldiayStyle1;
    else if (mystory = "Wednesday") {
        mystory.papragraph(0).appliedparagraphstyles = myHolidayStyle1;
    else if (mystory = "Thursday") {
        mystory.paragraphs(0).appliedparagraphstyles = myHolidayStyle1;
    else if (mystory = "Friday")  {
        mystory.paragraphs(0).appliedparagraphstyle = myHolidayStyle1;
    else if (mystory = "Saturday") {
        mystory.paragraphs(0).appliedparagrahstyles = myHolidayStyle1;
    else if (mystory = "Sunday") {
        mystory.paragraphs(0).appliedparagraphstyles = myHolidayStyle1;
    // it finds if in the selection of the month and day if they equal for example Decmeber 15 then applies the HolidaySub-Heading-Date
    if   (mystory = "December 15") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 15") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 16") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 17") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 18") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 19") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 20") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 21") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 22") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 23") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 24") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    else if (mystory = "December 25") {
        mystory. paragraphs(1).appliedparagraphstyles = myHolidayStyle2;
    // If text doesn't  equal Day of the week like Monday and doesn't equal month and date like Decmber 14
    // then the document loops into doing the the rest of the document in Holiday-Header-Body
    // not sure if this loop will stop once it reaches another day of the week and then repeat the above tasks again.
    if (mystory =!  [myHolidayStyle0], [myHolidayStyle1]) { // not sure if I did this IF selection not equal Holidaystyle 0 and style 1 then perform loop, correctly???
        for (loop=0; loop<myStory.paragraphs.length; loop++)
      myStory.paragraphs[loop].appliedParagraphStyle = myHolidayStyle3;
    =============================
    ==========================
    I'm getting a error saying Paragraph is not a function, but nor is mystory.paragraph(0) , so i'm just trying to figure out what synax goes before that.
    =============================
    The text that is bold is the prolbem i'm having. I just got  a Javascript bible on how to program in javascript. How would i make that function work. I'm sure its simple. I'm just hoping I have If some Then ({) command follow by what I want it to do is correct. And I'm understanding this. there is so many different syntax's to choose from, any help would be appreciated. I work for a Newspaper company, and Indesign CS3 Javascript coding is a bit diffrent from normal javascript.

    Okie, I'm making progress now. Because well it didnt crash, but then again, LOL the script didnt apply the paragraph styles when I selected the text!
    any suggestions?
    I'm also getting a weird error now with the loop, but I also dont think its working because maybe the myStyle and myStle1 aren't applying themselves correctly, in the first part of the script.
    this is the Error Message:
    Error Number : 30477
    Error String: Invalid value of set propert 'appliedParagraphStyle'. Expected ParagraphStyle or String, but Recieved nothing.
    Line: 110
    Source: myStory.paragraphs[loop].appliedParagraphStyle = myStyle3;
    //var myDoc = app.documents[0]
    var mySel = app.selection[0];
    var myStory = mySel.parentStory; // Now we are pointing to the entire story
    var myStyle = app.activeDocument.paragraphStyles.item ( "Holiday-Header" ) ;
    var myStyle1 = app.activeDocument.paragraphStyles.item ( "Holiday-Sub-Heading-Date" ) ;
    var myStyle3 = app.activeDocument.paragraphStyles.item ( "Holiday-Header-Body" ) ;
    if (myStory.contents == "Monday" ) {
        myStory.paragraphs.appliedParagraphStyle = myStyle;
    else if  (myStory.contents == "Tuesday") {
        myStory.paragraphs[0]. appliedParagraphStyle = myStyle;
    if  (myStory.contents == "Wednesday") {
        myStory.papragraph[0].appliedparagraphstyle = myStyle;
    else if (myStory.contents == "Thursday") {
        myStory.paragraphs[0].appliedparagraphstyle = myStyle;
    if  (myStory.contents == "Friday")  {
        myStory.paragraphs[0].appliedparagraphstyle = myStyle;
    else if (myStory.contents == "Saturday") {
        myStory.paragraphs[0].appliedparagrahstyle = myStyle;
    if  (myStory.contents == "Sunday") {
        myStory.paragraphs[0].appliedparagraphstyle = myStyle;
    // it finds if in the selection of the month and day if they equal for example Decmeber 15 then applies the HolidaySub-Heading-Date
    if   (myStory.contents == "December 2") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 3") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if   (myStory.contents == "December 4") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 5") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if   (myStory.contents == "December 6") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 7") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if   (myStory.contents == "December 8") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 9") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if   (myStory.contents == "December 10") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 11") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if   (myStory.contents == "December 12") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 13") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if   (myStory.contents == "December 14") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 15") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if  (myStory.contents == "December 16") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 17") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if  (myStory.contents == "December 18") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else  if (myStory.contents == "December 19") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if  (myStory.contents == "December 20") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 21") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if  (myStory.contents == "December 22") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 23") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    if  (myStory.contents == "December 24") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    else if (myStory.contents == "December 25") {
        myStory. paragraphs[1].appliedparagraphstyle = myStyle1;
    // If text doesn't  equal Day of the week like Monday and doesn't equal month and date like Decmber 14
    // then the document loops into doing the the rest of the document in Holiday-Header-Body
    // not sure if this loop will stop once it reaches another day of the week and then repeat the above tasks again.
    // not sure if I did this IF selection not equal mystyle and mystyle1 then perform loop, is done correctly???
    if (myStory.contents !=  (myStyle && myStyle1)) {
       for (loop=0; loop<myStory.paragraphs.length; loop++)
      myStory.paragraphs[loop].appliedParagraphStyle = myStyle3;
        I'm truly grateful for the Support and Assistance everyone has been providing me, I'm learning, and I thank you all for your help.

  • Need little help with JPA code and displaying database data into tables

    Hello Everyone,
    I am using java6 and Netbeans 6.1 on Windows XP platform.
    This is probably very simple but have'nt been able to figure it out yet. I am using the Travel Java Databse included in NB6 as a learning tool.
    I have a JComboBox connected to Person Table and want to display a Trip table from using the selected item from theJcombobox. In other words, Trip table shows only the Person selected from the Jcombobox.
    If someone could point me on the right direction how to code JPA code or how to use NB6 GUI to accomplish this.
    Thanks

    The w and wi are just table aliases that make it easier to
    referrence those tables by column when joining multiple tables
    (avoids having to prefix column names with the entire table name,
    etc.) When doing a self-join (joining a table to itself), the use
    of table aliases is
    required, otherwise you would have no other way to tell
    which column belonged to which "instance" of table.
    The query itself is pretty simple. It is just using a
    correlated subquery to select only those instances of
    workstationApps where the count of appID instances in
    workstationAppIndex is less than the amount specified in the
    maxConcurrentInstalls for the same appID.
    Also, I do see what you are doing with #form.searchType#, I
    was just making sure that it was what you really intended to do.
    Phil

  • Adding values to insert query [was: Plz help with this code]

    I have created a comments section in which there is only one field comment here is the code of the form:
    <form id="frmComment" name="frmComment" method="POST" action="<?php echo $editFormAction; ?>">
        <h3>
          <label for="namegd"></label>Comment:</h3>
        <p>
          <label for="comment2"></label>
          <textarea name="comment" id="comment2" cols="60" rows="10" ></textarea>
        </p>
        <p>
          <label for="submit">
          </label>
          <input type="submit" name="submit" id="submit" value="Submit" />
          <label for="reset"></label>
          <input type="reset" name="reset" id="reset" value="Clear" />
        </p>
    <input type="hidden" name="MM_insert" value="frmComment" />
    </form>
    and the insert into code applied to the form is this
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmComment")) {
      $insertSQL = sprintf("INSERT INTO comments (`comment`, ) VALUES (%s)",
                           GetSQLValueString($_POST['comment'], "text"));
      mysql_select_db($database_my_connection, $my_connection);
      $Result1 = mysql_query($insertSQL, $my_connection) or die(mysql_error());
    But I want the form to insert two more values to the database one will be the commented_by and the other will be post_id where commented_by = ($_SESSION['Username']) and post_id = $row_Recordset1['id'] can some one plz let me know what will be the modified code and ya commented_by is a text field and post_id is an int field.
    Plz guys help me Thanks in advance

    Adding the extra values to the insert query is easy:
    $insertSQL = sprintf("INSERT INTO comments (`comment`, commented_by, post_id) VALUES (%s, %s, %s)",
             GetSQLValueString($_POST['comment'], "text"),
             GetSQLValueString($_SESSION['Username'], "text"),
             GetSQLValueString($row_recordset1['id'], "int"));
    You need to make sure that the code for recordset1 comes before the insert query. By default, Dreamweaver places recordset code immediately above the DOCTYPE declaration, and below other server behaviors. So, you need to move the code. Otherwise, this insert query won't work.

  • Need a little help with this factory pattern thing..

    Evening all,
    I have an assignment to do over easter, before i start i will say i dont want any code or anything so this isnt 'cheating' or whatever..
    This was the brief:
    A vending machine dispenses tea and coffee, to which may be added milk, and 0, 1 or 2 doses of sugar. When the machine is loaded it initially contains 100 doses of tea, 100 doses of coffee 50 doses of milk and 70 doses of sugar. After it has been in use for a while it may run out one or more items. For example, it may run out of sugar, in which case it would continue to vend tea, coffee, tea with milk, and coffee with milk. Periodically, an attendant recharges the machine to full capacity with doses of coffee, tea, milk and sugar. A user selects the required beverage, selects the required amount of sugar, and selects milk if required. The machine responds with a message telling the user the cost of the drink (coffee is 30P, tea 20P, milk 10P, and sugar 5P per dose). The user inserts coins (the machine accepts 10P and 5P coins), and when the required sum or more has been inserted, the machine dispenses the beverage, and possibly some change.
    You are to write a program that simulates the above vending machine. Your solution must use the class factory pattern, and make use of the code templates provided. The user interface should be constructed with a Swing JFrame object.
    We were suppled with code for all of the classes required except for the JFrame.. They are as follows:
    public abstract class Beverage
      int sugar;
      boolean milk;
      public String getMessage()
        String name = this.getClass().getName();
        String sugarMessage = "";
        if (sugar == 1) sugarMessage = "one sugar";
        if (sugar == 2) sugarMessage = "two sugars";
        if (sugar == 0) sugarMessage = "";
        return  "Vended 1 " + name  +  (milk ? " with milk " : "") + (sugar==1 || sugar == 2 ? (milk ? "and " + sugarMessage : " with " + sugarMessage) : "");
    public class Coffee extends Beverage
      public Coffee( int sugar, boolean milk)
        this.sugar = sugar;
        this.milk = milk;
    public class Tea extends Beverage
      public Tea(int sugar, boolean milk)
        this.sugar = sugar;
        this.milk = milk;
    public class SugarButtonsGroup
      private JRadioButton jRadioButton0Sugar = new JRadioButton();
      private JRadioButton jRadioButton1Sugar = new JRadioButton();
      private JRadioButton jRadioButton2Sugar = new JRadioButton();
      private ButtonGroup sugarButtons = new ButtonGroup();
      public SugarButtonsGroup()
        jRadioButton0Sugar.setText("No sugar");
        jRadioButton1Sugar.setText("1 sugar");
        jRadioButton2Sugar.setText("2 sugars");
        sugarButtons.add(this.jRadioButton0Sugar);
        sugarButtons.add(this.jRadioButton1Sugar);
        sugarButtons.add(this.jRadioButton2Sugar);
      public int numberOfSugars()
        if (this.jRadioButton1Sugar.isSelected()) return 1;
        if (this.jRadioButton2Sugar.isSelected()) return 2;
        return 0;
      public ButtonGroup getButtonGroup()
        return sugarButtons;
      public JRadioButton getJRadioButton0Sugar()
        return jRadioButton0Sugar;
      public JRadioButton getJRadioButton1Sugar()
        return jRadioButton1Sugar;
      public JRadioButton getJRadioButton2Sugar()
        return jRadioButton2Sugar;
    public class BeverageButtonsGroup
      private JRadioButton jRadioButtonTea = new JRadioButton();
      private JRadioButton jRadioButtonCoffee = new JRadioButton();
      private ButtonGroup buttonGroup = new ButtonGroup();
      public BeverageButtonsGroup()
        buttonGroup.add(jRadioButtonTea);
        buttonGroup.add(jRadioButtonCoffee);
        jRadioButtonTea.setText("Tea");
        jRadioButtonCoffee.setText("Coffee");
        jRadioButtonCoffee.setSelected(true);
      public String getBeverageName()
        if (jRadioButtonTea.isSelected()) return "tea";
        if (jRadioButtonCoffee.isSelected()) return "coffee";
        return "";
      public ButtonGroup getBeverageButtonGroup()
        return buttonGroup;
      public JRadioButton getJRadioButtonTea()
        return jRadioButtonTea;
       public JRadioButton getJRadioButtonCoffee()
        return jRadioButtonCoffee;
    public class MilkCheck
      private JCheckBox jCheckBoxMilk = new JCheckBox();
      public MilkCheck()
        this.jCheckBoxMilk.setText("Milk");
      public JCheckBox getJCheckBoxMilk()
        return jCheckBoxMilk;
      public boolean withMilk()
        return this.jCheckBoxMilk.isSelected();
    public class CoinMechanism
      private JButton jButton5P = new JButton();
      private JButton jButton10P = new JButton();
      private JTextField jTextFieldTotal = new JTextField();
      private BeverageFactory b;
      public CoinMechanism (BeverageFactory b)
        this.b = b;
        reset();
        jTextFieldTotal.setEditable(false);
        jButton5P.setText("Insert 5 pence");
        jButton5P.addActionListener(new ActionListener()
            public void actionPerformed(ActionEvent e)
              jButton5P_actionPerformed(e);
        jButton10P.setText("Insert 10 pence");
        jButton10P.addActionListener(new ActionListener()
            public void actionPerformed(ActionEvent e)
              jButton10P_actionPerformed(e);
      private void jButton5P_actionPerformed(ActionEvent e)
        // to be completed
      private void jButton10P_actionPerformed(ActionEvent e)
        // to be completed
      private void notifyVend()
        b.getCoinCurrentTotal(jTextFieldTotal.getText());
      public void reset()
         this.jTextFieldTotal.setText("0");
      public JButton getJButton5P()
        return this.jButton5P;
      public JButton getJButton10P()
        return this.jButton10P;
      public JTextField getJTextFieldTotal()
        return this.jTextFieldTotal;
    public class BeverageFactory
      private int coffees;
      private int teas;
      private int milks;
      private int sugars;
      public BeverageButtonsGroup beverageButtons = new BeverageButtonsGroup();
      public SugarButtonsGroup sugarButtons = new SugarButtonsGroup();
      public MilkCheck milkCheck = new MilkCheck();
      public CoinMechanism slots = new CoinMechanism(this);
      public void setUIState()
        // sets the states of the widgets on the frame accoording to the
        // quantities of supplies in the machine
        // to be finished
      public void getCoinCurrentTotal (String o)
        // this is should be executed whenever a user puts a coin into the machine
        int foo = Integer.parseInt(o);
        // to be finished
      private int cost()
        // returns the cost of the currently selected beverage
        // to be finished
      public BeverageFactory( int coffees, int teas, int milks, int sugars)
        this.coffees = coffees;
        this.teas = teas;
        this.milks = milks;
        this.sugars = sugars;
      public void refill(int coffees, int teas, int milks, int sugars)
        // to be completed
      public Beverage makeBeverage(String name, boolean milk, int sugar)
        if (name.compareTo("coffee") == 0)
          coffees--;
          if (milk) milks--;
          sugars = sugars - sugar;
          return new Coffee(sugar,milk);
        if (name.compareTo("tea") == 0)
          teas--;
          if (milk) milks--;
          sugars = sugars - sugar;
          return new Tea(sugar, milk);
        return null;
    }Okay, well if you read through all that, blimey thanks a lot!.
    My question relates to this method in the BeverageFactory class:
    public void getCoinCurrentTotal (String o)
        // this is should be executed whenever a user puts a coin into the machine
        int foo = Integer.parseInt(o);
        // to be finished
      }I don't understand what the heck its supposed to be for..
    I can obtain the current amount of coins inserted from the textbox in the CoinMechanism class. The only thing i could think of, would be for this to enable the 'Vend' button, but it doesnt have access anyway..
    Any suggestions would be hugely appreciated, I have tried to contact the lecturer but he isnt around over easter i guess..
    Many thanks.

    I'm not going to read all that, and I don't do GUIs, so this is just a guess, but it looks like the CoinMechanism class is intended to be just a dumb processor to accept coins and determine what each coin's value is, but no to keep a running total.
    That in itself is an arguably acceptable design--one class, one job and all that. But I don't know that it makes sense to have the BeverageFactory keep the running total.
    Overall, I gotta say, I'm not impressed with your instructor's framework. Maybe it's just because I didn't look at it closely enough, or maybe it's more of a naming problem than a design problem, but it seems to me he's mixing up GUI code with business logic.
    Good luck.

  • I need a little help with this MS-6380E

    Hi my name is AttA.  Im trying to help out a friend get hism PC back up and running.  He is a new user type and has generaly screwd his pc up just being a newbie.  He asked me to Format his PC And reinstall his OS, and now here i am wonering what the heck is going on.  
    I first tried to install Win XP pro on his PC with all the hardware in it, just like it came to him when he got it.
    When the XP pro setup gets to the Copying files section it locks up.  There is no specific file it locks on up, sometimes it will do it at 3% sometimes at 17%.  It has never made it through coping the files.  At this point i decided to return the PC to minimum spec and try it out.  Ive removed all of the expansion cards, replaced the AGP GEforce TI 4600 with an old 8 meg PCI card, removed the front USB from the board, ive taken out all but 1 stick of RAM that i know to be good.  Ive also loaded Bios Defaults.
    At this point the Specs on the PC are as follows.
    Athalon 1150 CPU  (As reported by the Bios)
    MSI MS-6380E  (although the pic of the board contained in the instruction manual looks nothing like the real thing,)
    IBM Deskstar 40 Gb
    Floppy Drive
    1 Yamaha CD-RW 20/10/40  (yes ive tried other known working non writing drives.)
    1 stick DDR 2700 256mb
    Keyboard and mouse ive tried 4 sets both USB and PS/2
    Alliedc Pwr Supply  300W
    I have scanned for Viri as well as tried the drive on both busses.
    Im hoping some1 can give me a clue as to what is happening.
    Thanx for your help in advance.
    AttA
    PS pls excuse typos my keyboard at work is not the natural im used too.

    Ok so ive done more.  mabey this will help.
    Ive tried changing the RAM.  
    Ive tried A CMOS reset.
    Ive tried A new CD-ROM as CS on the secondary and slave to the HDD on the primary
    Here is the one i dont get.  Ive tried installing Win98.  and it worked.  the disk my frind has is near pristine one scratch and not nearly enough to account for multiple lockups while dealing with random files.  i suppose is possible, so im gonna try XP with a different disk if i can find one.
    I even thought well mabey its got some kind of strange super virus and its surving the format fdisk and fdisk /mbr.  So i put the HDD in a G4, knowing that a mac would erase the complete drive with out any care for boot records or any other PC crap.  nothing still locked up, although that time i copied 56% of the files before it locked up.  thats the best run yet ;(
    Thank you for the reply Mrplow that is one thing i definatly did not try that one.  Ill make sure to do that tomorrow and see what happens.  When your FSB reverts to 100, do you have problems like this?
    AttA

Maybe you are looking for

  • Getting an error when i am execution a BI query using ABAP.

    Hi Expert, I am getting an error when i am execution a BI query using ABAP. Its Giving me this Error "The Info Provider properties for GHRGPDM12 are not the same as the system default" and in the error analysis it saying as bellow. Property Data Inte

  • PVCS/Headstart revision substitution not working

    We've been following the instructions on p95 of the Headstart documentation, using a string of $Revision::xxxxxxxxxxx$ to get PVCS revision number substitution on our modules. This doesn't seem to be working correctly - sometimes the substitution tak

  • F-27 customer statement For progremme the default form set is missing

    Hi all,                Can anybody solve me the error while running customer statement F-27 iam getting the error is for "program default form set is missing".I have checked all the configuration settings in correspondence,But i am able to identify t

  • Problem in installing P6 V8 on windows 7

    i have successfully installed P6 V8 on windows XP First i installed SQL Server 2008 R2 then i configured a new database automatically by using dbsetup.bat then i installed p6 v8 successfully BUT when i had tried to install P6V8 on windows 7 i faced a

  • Youtube and Netflix must verify license

    Hello, I was on my ps4 today and when I turned it on, I went to play Cod AW when all my dlcs and other items had not been there. I went to Playstation store and everything was not downloaded anymore. Now that is fine, but my Youtube and Netflix were