How do you call the same parameters from function to function

I need to create several functions to try and consolidate and clear up readability in my program and I need to call the same things in all the functions. How do I do that without writing everything I need to call in each function?

Yeah . . that's pretty much right on base. Except this is how I did it and it doesn't quite work the way I thought.
This first bit is what I wrote to replace the redundant code
class Header   // this class is all the declaration stuff for the events
    { public void Header()
           {  SerialRead s;
           String serialString;
           int newline1,newline2;
           String line1,line2,line3,linetmp;
           String spindle,torque1,torque2,torque3,angle1,angle2,angle3;
              int tval1 = Integer.parseInt(torque1);
              int tval2 = Integer.parseInt(torque2);
              int tval3 = Integer.parseInt(torque3);
              int aval1 = Integer.parseInt(angle1);
              int aval2 = Integer.parseInt(angle2);
              int aval3 = Integer.parseInt(angle3);
    }This is how I thought it should be implemented
class AcceptPass1 extends Header implements ActionListener{
  public void actionPerformed(ActionEvent e){
     s=new SerialRead();
     s.findPort();
     waitForSerial=true;
     s.openConnection();
     blank_l1.setText("Waiting for data from Pass #2");
     while(waitForSerial){
     blank_l1.setText("Data Received.  Please verify data!");
     s.closeConnection();
     serialString=serialBuffer.toString();
     line1=serialString.substring(0);
     linetmp=serialString.substring((serialString.indexOf("ZZZ") + 3));
     line2=linetmp.substring(0);
     line3=linetmp.substring(linetmp.indexOf("ZZZ") + 3);

Similar Messages

  • How do you call a java class from the main method in another class?

    Hi all,
    How do you call a java class from the main() method in another class? Assuming the two class are in the same package.
    Thanks
    SI
    Edited by: okun on May 16, 2010 8:40 PM
    Edited by: okun on May 16, 2010 8:41 PM
    Edited by: okun on May 16, 2010 8:47 PM

    georgemc wrote:
    To answer your impending question, either the method you're calling has to be static, or you need an instance of that other class to invoke it against. Prefer the latterAnd to your impending question after that: no, don't use the Singleton pattern.

  • When you have 1 itunes library.. and 2 ipods.. different names.. how can you share the same library???

    When you have 1 itunes library.. and 2 ipods.. different names.. how can you share the same library???  All of the songs that were put on there from a CD will sync, but the songs that were purchased.. "cannot be found"   How can we merge them?? or how can we share all songs.. purchased or not!

    When you have 1 itunes library.. and 2 ipods.. different names.. how can you share the same library???  All of the songs that were put on there from a CD will sync, but the songs that were purchased.. "cannot be found"   How can we merge them?? or how can we share all songs.. purchased or not!

  • How do i transfer the same video from my phone to my ipad with the same id account

    How do i transfer the same video from my phone to my ipad with the same Apple ID .

    Your question doesn't make a lot of sense without a little more information. You can't transfer a video from the phone to the iPad by connecting the devices. There are WiFi transfer apps that will let you send a video from one device to another one. I get the feeling that isn't what you are really asking though because that has absolutely nothing to do with your Apple ID.
    If you want to download the same purchased movie to the iPad that you downloaded to the phone, go to the purchased tab of the iTunes Store on the iPad. Tap the Movies Button. Tap Not on this iPad. Find the movie and tP the cloud icon next to the movie icon and start downloading.
    You must be signed into the same ID on the iPad that you bought the movie with on the iPhone.

  • When playing songs in iTunes playlist, How do you keep the next song from jumping to next song? I am working on song list updating other tracks info and then the next song starts and I lose my spot in song list?

    When playing songs in iTunes playlist, How do you keep the next song from jumping to next song? I am working on song list updating other tracks info and then the next song starts and I lose my spot in song list?

    Max OSX 10.6.8, iTunes 11.1
    I had a similar problem: I wanted to synch my playlist to my iphone. I like to have my playlist sorted by genre. But under each genre, albums are not sorted by the track numbers. This is a problem, especially when I am listening to club mixes when the DJ smoothly transitions from 1 track sequentially to the next one. Under the properties of each audio file, the Track Numbers and Disc Numbers are already there.
    My perfect solution was to turn On Sorting - Sort Album under View>Show View Options. Then, select all the songs in that album (Shift click, Cmd click, etc) , and Edit multiple item information (Cmd I). You will see Info-Video-Sorting-Options buttons. Click on Sorting. Then, under Sort Album, Enter the name of the album. Then OK.
    You should now have the playlist sorted by Genre, then each album individually sorted by track numbers. On your playlist you should see, if you scroll right, the column added called "Sort Album".
    Hope this helps.

  • How can you use the same e-mail address for multiple ipads?

    I have two iPads.. an iPad and an ipad 2.  I registared my new ipad 2 and now my old ipad is will not let me log on and is telling me that my e-mail address is already in use.  how can you use the same e-mail address for multiple ipads?

    And by using the same Apple ID you can also share purchases.  If you have a different Apple ID for each iPhone then you can't share purchases.

  • I just synced my iPhone and lost all the info in notes from my phone. It was replaced with whT was on my iMac how do you make the sync go from phone to desktop and not the other way around

    I Just synced my iPhone and lost all the info in notes I had on the phone. How do you have the info sync from phone to desktop and not the other way around as I usually make contact changes etc on my phone. I would then like to be able to sync that info from desktop to ipad thanks

    It does make sense.  The iPhone is a one-person device and just syncs to one computer.
    The way it should work is as follows:
    Old computer content ---> New computer
    New computer <---> syncs to iPhone
    But the way you are trying to operate sounds like:
    Old computer content ---> iPhone
    ... and ...
    New computer content <---> iPhone
    So simply move your old stuff (either directly from iTunes, or from a computer backup) to the new computer, have it all there, then sync your iPhone to the new machine.

  • How do you change the background color from black to another color on i movie

    How do you change the background color from black to another color on i movie

    You post your question in the iMovie forum.

  • HT4913 How do you download the entire library from match to a new computer?

    How do you download the entire library from iTunes Match to a new computer?

    Download each song individually.
    Or the faster method is to COPY the ENTIRE iTunes folder from the old computer or the backup of the old computer to the new computer.

  • How do you connects the same iPad to iTunes which is already synced with another computer

    How do you connects the same iPad to iTunes which is already synced with another computer

    You can only use one iTunes library at a time when you sync your devices. If you want to sync to a new computer now, look at this.
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive
    And here is another helpful article.
    http://www.howtogeek.com/104298/sync-your-ios-device-with-a-new-computer-without -losing-data/

  • How do you resize the pixel count from 4000  to 1600 in iPhoto

    How do you resize the pixel count from 4000 to 1600 in iphoto?

    In the Export Dialogue (File -> Export) note the options at Size. This will allow you to specify a maximum length or breadth for the shot.
    Regards
    TD

  • How do you keep the browser heading from showing?

    How do you keep the browser heading from showing in the
    output? I did this once but can't figure out how!
    Thanks in advance,
    Rosie

    You asked...
    quote:
    Is there a way to shrink the application you're capturing so it
    fits within a given capture window rather than requiring scrolling,
    or would I have to go back to the application developers for that?
    (I realize that would shrink the size of everything on the screen,
    but in some cases, that would be worth it to be able to show a
    window without scrolling.
    If, by "shrink" ... you mean by using the AppSizer, the
    answer is "not really". You can configure AppSizer to a defined
    size, then with the mouse pointer double-arrowed on the "edge" of a
    window, right-click and your window-size selections will appear in
    the AppSizer "list" (that you set up) and can be selected there.
    But there is no re-scaling of the window contents, if that is
    what you mean, so the smaller window may now require scrolling.
    But keep in mind that if you use the recording option for
    "Software Simulation" > "Custom Size", you can then snap the
    application window to that size...

  • How do you remove the SIM card from one iPhone 5 and place it in another?

    how do you remove the SIM card from one iPhone 5 and place it in another?

    With a paper clip?  Refer to the User Guide.

  • How do you remove the simm card from the iphone 4s with no side hole?

    How do you remove the simm card from the iphone 4s when it has no side hole.  The phone was purchased from Verizon so it not a clone or a demo to my knowledge.

    Verizon is a CDMA carrier.  I think your phone may be a 4, and not a 4s.  The CDMA iPhone 4 does not have a sim slot, because it doesn't use a sim.

  • How do you remove the blue dot from next to the podcasts.

    How do you remove the blue dot from next to the podcasts. I listen to 100s of podcasts on my ipod so the blue dot does not leave itunes. I use the blue dot to identify which podcasts are new. It used to be easy to remove the blue dot just play the podcasts for a second in more recent versions of itunes it is harder one has to play it for longer and half the dot is left. How do I select a dozen podcasts and mark them as used. I mean remove the blue dot.

    Hi,
    To Mark as Watched Right Click on the Podcast...
    To Select more than One Podcast... Shift Click...

Maybe you are looking for

  • Can't consolidate library (it disappeared in iTunes 8)

    I recently download iTunes 8 and I am completely satisfied with Genius. Thing is, now I can't consolidate my library to my external hard drive. Anybody know what happened? I would usually go to the top taskbar and use the consolidate library option i

  • Configure j2ee to support oracle9 database using jndi

    how to configure j2ee1.3.1 to support access to oracle9 data base using jndi i'm using a java bean to access an oracle9 data base,this snippet is written in the bean: public connexionBD() Throws SQLException{ String dbName "java:com/env/jdbc/connexio

  • Khols Charge Card Problem

    Applied online for Khols Charge Card. Got approved for $300 line. Got account number emailed and able to make first purchase. I wait til the next day and make a purchase online utilizing 80% of credit. Order goes through. The following morning get an

  • Unable to install Data Integrator Job Server

    When attempting to install Business Objects XI (R2) Data Integrator I am unable to check the 'Job Server' component to be installed. I have tried all the different licenses and options we have available but am unable to get around this. Has anyone el

  • JSF Directive

    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> URI in struts replaced with location of tag tld files.I heard tld files of Core and html tld file are in the jsf-impl.jar file. wh