Accessing Classes From the Main Program:

Hey Guys if you want to take a crack at this: I'm not sure how to exaclty get the classes read into my program and stuff. So I dunno if not don't worry. And Also ther'es no need to insult me.
* just copy this into any editor
import java.io.*;
import java.text.*;
class Liststuff
public class Node
char info;
Node next;
public class listException extends Exception
public listException(String message)
super(message);
class Queue
private Liststuff.Node front;
private Liststuff.Node rear;
public Queue()
front = null;
rear = null;
public boolean isEmpty()
return (front == null);
public void insert(char v)
Liststuff.Node n = new Liststuff.Node();
n.info = v;
n.next = front;
if (rear == null)
front = n;
else
rear.next = n;
public char Remove() throws Liststuff.listException
char v;
if (isEmpty())
throw new Liststuff.listException("Nothing in OrigQue.");
else
v = rear.info;
rear = rear.next;
return (v);
class Stack
Liststuff.Node top = new Liststuff.Node();
public Stack()
top = null;
public void push(char v)
Liststuff.Node n = new Liststuff.Node();
n.info = v;
n.next = top;
top = n;
public char pop() throws Liststuff.listException
char v;
if (isEmpty())
throw new Liststuff.listException("Stack underflow.");
else
v = top.info;
top = top.next;
return (v);
public boolean isEmpty()
return (top == null);
class Deque
private Liststuff.Node front = new Liststuff.Node();
private Liststuff.Node rear = new Liststuff.Node();
private Liststuff.Node f = new Liststuff.Node();
public Deque()
front = null;
f = null;
rear = null;
public void insert(char v)
Liststuff.Node n = new Liststuff.Node();
n.info = v;
n.next = front;
if (rear == null)
front = n;
else
rear.next = n;
public char remove(char side) throws Liststuff.listException
char v;
if (isEmpty())
throw new Liststuff.listException("Nothing in OrigQue.");
else
f = rear;
if (side == 'R')
while (f.next != front)
f = f.next;
v = front.info;
front = f;
else
v = rear.info;
rear = rear.next;
return (v);
public boolean isEmpty()
return (front == rear);
public class Prog8
public static void main(String args[]) throws IOException, Liststuff.listException
String line;
int i;
char t;
Liststuff s = new Liststuff();
BufferedReader br = new BufferedReader(new FileReader("numbers.txt"));
line = br.readLine();
StringCharacterIterator c = new StringCharacterIterator(line);
while (line != null)
for (i = 0; i <= c.getEndIndex(); i++)
Liststuff.Queue Orig = new Liststuff.Queue();
Liststuff.Stack Evenstk = new Liststuff.Stack();
               Liststuff.Deque Oddque = new Liststuff.Deque();
               Liststuff.Queue Final = new Liststuff.Queue();
t = c.current();
char v = (t);
c.next();
Orig.insert(v);
line = br.readLine();
if ((v % 2) == 0)
Evenstk.push(v);
else
Oddque.insert(v);
Final.insert(Evenstk.pop());
while (!Oddque.isEmpty())
Final.insert(Oddque.remove('R'));
Final.insert(Oddque.remove('L'));
System.out.print("Original Sequence: ");
while (!Orig.isEmpty())
System.out.print(Orig.Remove());
System.out.print("New Sequence: ");
while (!Final.isEmpty())
System.out.print(Final.Remove());
}

hi mate
System.out.print("Original Sequence: ");
while (!Orig.isEmpty())
System.out.print(Orig.Remove());
System.out.print("New Sequence: ");
while (!Final.isEmpty())
System.out.print(Final.Remove());
thats you wacky code remember its insult free comments
well here the best way to do it
for Final.insert(Oddque.remove('R'));
System.out.print("Original Sequence: ");
while (!Orig.isEmpty())
System.out.print(Orig.Remove());
while Final.insert(Oddque.remove('L'));
System.out.print("New Sequence: ");
while (!Final.isEmpty())
System.out.print(Final.Remove());
else bla bla bla
hope it cann hep though i dont whats is the problem
and be clear you question.

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.

  • How to call a function in a class from the main timeline?

    Hey Guys
    I have a project in Flash with four external AS files, which are linked to items in the library using AS linkage.
    What I want to do is call a function in one of these files from the main timeline, how would I go about doing this? I'm not currently using a document class, most of the code is in Frame 1 of the main timeline.
    Thanks

    // change type to the class name from the instance
    ClassNameHere(this.getChildByName('instance_name')).SomeFunction();

  • Do we write classes in abap seperately from the main program

    For instance following class is designed to capture the click of hotspot and double clicks from a screen layout.  immediately I need it.Thanks everyone.
    Where should I put such a code?
    CLASS lcl_event_handler DEFINITION .
    PUBLIC SECTION .
    METHODS:
    *--Hotspot click control
    handle_hotspot_click
    FOR EVENT hotspot_click OF cl_gui_alv_grid
    IMPORTING e_row_id e_column_id es_row_no ,
    *--Double-click control
    handle_double_click
    FOR EVENT double_click OF cl_gui_alv_grid
    IMPORTING e_row e_column es_row_no.
    PRIVATE SECTION.
    ENDCLASS.
    CLASS lcl_event_handler IMPLEMENTATION .
    *--Handle Hotspot Click
    METHOD handle_hotspot_click .
    PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .
    ENDMETHOD .
    *--Handle Double Click
    METHOD handle_double_click .
    PERFORM handle_double_click USING e_row e_column es_row_no  .
    ENDMETHOD .
    ENDCLASS .
    FORM CREATEOBJECT.
    DATA gr_event_handler TYPE REF TO lcl_event_handler .
    *--Creating an instance for the event handler
    CREATE OBJECT gr_event_handler .
    SET HANDLER gr_event_handler->handle_double_click FOR gr_alvgrid .
    SET HANDLER gr_event_handler->handle_hotspot_click FOR gr_alvgrid .
    ENDFORM.
    FORM handle_hotspot_click USING i_row_id TYPE lvc_s_row
    i_column_id TYPE lvc_s_col
    is_row_no TYPE lvc_s_roid.
    READ TABLE zbficheentry_list2 INDEX is_row_no-row_id .
    IF sy-subrc = 0." AND i_column_id-fieldname = 'SEATSOCC'.
    CALL SCREEN 200 . "Details about passenger-seat matching
    ENDIF .
    ENDFORM .
    FORM handle_double_click USING i_row TYPE lvc_s_row
    i_column TYPE lvc_s_col
    is_row_no TYPE lvc_s_roid.
    READ TABLE zbficheentry_list2 INDEX is_row_no-row_id .
    IF sy-subrc = 0." AND i_column-fieldname = 'SEATSOCC' .
    CALL SCREEN 120 . "Details about passenger-seat matching
    ENDIF .
    ENDFORM .

    Hi,
    Check the link,
    Re: hotspot
    Regards,
    Azaz Ali.

  • When I try to access stories from the main page of yahoo news...this is what I get...Sorry, Bad Request. Your browser sent a request that this server could not understand. Size of a request header field exceeds server limit.

    Very infrequently it will allow the page to open but 90% of the time I get the error message. It also happens if I click on a link to a yahoo news story from another web site. I had tried Firefox 4, but it was giving me all kinds of errors so I reverted back to 3.6

    This issue can be caused by corrupted cookies.
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"

  • Calling another class from a java program

    I tried to call the Server1.class from the password program, but I failed. The password program source code is as follows:
    class PasswordDialog extends java.awt.Dialog implements java.awt.event.ActionListener
         * Constructor. Create this visual dialog component.
         public PasswordDialog(java.awt.Frame parent, PasswordVerifier verifier)
              super(parent);
              addWindowListener(new WindowEventHandler());
              setLayout(new java.awt.FlowLayout());
              setSize(500, 100);
              this.verifier = verifier;
              add(useridField = new java.awt.TextField(10));
              add(passwordField = new java.awt.TextField(10));
              add(okButton = new java.awt.Button("Submit"));
              add(cancelButton = new java.awt.Button("Cancel"));
              okButton.addActionListener(this);
              cancelButton.addActionListener(this);
              passwordField.setEchoChar('*');
              useridField.requestFocus();
         public void actionPerformed(java.awt.event.ActionEvent e)
              if (e.getSource() == okButton)
                   // Invoke password verification callback
                   try
                        boolean result = verifier.verifyPassword(
                             useridField.getText(), passwordField.getText());
                        if (! result) return;     // verification failed; don't close this dialog
                   catch (Exception ex)
                        ex.printStackTrace();
                   // Close this dialog
                   System.out.println("I still can't call the Server1 class");
                   dispose();
              else if (e.getSource() == cancelButton)
                   dispose();
         class WindowEventHandler extends java.awt.event.WindowAdapter
              public void windowClosing(java.awt.event.WindowEvent e)
                   System.exit(0);
         // Private objects
         private PasswordVerifier verifier;
         private java.awt.TextField useridField;
         private java.awt.TextField passwordField;
         private java.awt.Button okButton;
         private java.awt.Button cancelButton;
    interface PasswordVerifier
         public boolean verifyPassword(String userid, String password) throws Exception;
    public class password implements PasswordVerifier
         * Main routine for testing only.
         public static void main(String[] args)
              password verifier = new password();
              java.awt.Frame f = new java.awt.Frame("Password Verifier");
              f.setSize(100, 100);
              f.show();
              PasswordDialog d = new PasswordDialog(f, verifier);
              d.show();
         public boolean verifyPassword(String userid, String password) throws Exception
              return (userid.equals("Albert") && password.equals("Einstein"));
    and the Server1.java is as follows:
    //Server Application
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    public class Server1 extends Frame implements ActionListener,Runnable,KeyListener
    ServerSocket s;
    Socket s1;
    BufferedReader br;
    BufferedWriter bw;
    TextField text;
    TextField name;
    Button exit,clear;
    Label label;
    List list;
    Panel p1=null;
    Panel p2=null;
    Panel sp21=null;
    Panel sp22=null;
    Panel jp=null;
    public void run()
              try{s1.setSoTimeout(1);}catch(Exception e){}
              while (true)
                   try{
    list.add(br.readLine());
                   }catch (Exception h){}
    if(list.getItemCount()==7)
    list.remove(0);
    public Server1(String m)
    {       super(m);
    jp=new Panel();
    p1=new Panel();
    p2=new Panel();
    sp21=new Panel();
    sp22=new Panel();
    jp.setLayout(new GridLayout(2,1));
    p1.setLayout(new GridLayout(1,1));
    p2.setLayout(new GridLayout(2,1));
    sp21.setLayout(new FlowLayout());
    sp22.setLayout(new FlowLayout());
    exit = new Button("Exit");
    clear = new Button("Clear");
    exit.addActionListener(this);
    clear.addActionListener(this);
    list = new List(50);
    text = new TextField(43);
    name = new TextField(10);
    label = new Label("Enter your name");
    name.addKeyListener(this);
    text.addKeyListener(this);
    p1.add(list);
    sp21.add(text);
    sp21.add(exit);
    sp22.add(label);
    sp22.add(name);
    sp22.add(clear);
    p2.add(sp21);
    p2.add(sp22);
    jp.add(p1);
    jp.add(p2);
    this.add(jp);
    setBackground(Color.orange);
    setSize(380,300);
    setLocation(0,0);
    setVisible(true);
    setResizable(false);
    name.requestFocus();
    try{
    s = new ServerSocket(786);
                   s1=s.accept();
                   br = new BufferedReader(new InputStreamReader(
                             s1.getInputStream()));
                   bw = new BufferedWriter(new OutputStreamWriter(
                             s1.getOutputStream()));
    bw.write("Welcome");bw.newLine();bw.flush();
                   Thread th;
                   th = new Thread(this);
                   th.start();
              }catch(Exception e){}
    public static void main(String args[])
    new Server1("Server");
         public void actionPerformed ( ActionEvent e)
    if (e.getSource().equals(exit))
                   System.exit(0);
    else if (e.getSource().equals(clear))
    { name.setText(" ");
    name.setEditable(true);
    public void keyPressed(KeyEvent ke) {
    if(text.equals(ke.getSource()))
    if(ke.getKeyCode()==KeyEvent.VK_ENTER)
    try{
    bw.write(name.getText()+">>"+text.getText());
                   bw.newLine();bw.flush();
                   }catch(Exception m){}
    list.add(name.getText()+">>"+text.getText());
    text.setText("");
    else if(name.equals(ke.getSource())) {
    if(ke.getKeyCode()==KeyEvent.VK_ENTER)
    name.setEditable(false);
    text.requestFocus();
    public void keyReleased(KeyEvent ke)
    //something
    public void keyTyped(KeyEvent ke)
    //something
    I tried to create a new object by typing:
    Server1 s = new Server1();
    then call the main function
    new Server1("Server");
    but it doesn't work. Anybody can help me with this?

    try
    Server1 s = new Server1();
    s.Server1("Server");
    or
    new Server1().Server1("Server");

  • Accessing object of the main class from the thread

    Hi, I'm having problem accessing object of the main class from the thread. I have only one Thread and I'm calling log.append() from the Thread. Object log is defined and inicialized in the main class like this:
    public Text log;  // Text is SWT component
    log = new Text(...);Here is a Thread code:
    ...while((line = br.readLine())!=null) {
         try {
              log.append(line + "\r\n");
         } catch (SWTException swte) {
              ErrorMsg("SWT error: "+swte.getMessage());
    }Error is: org.eclipse.swt.SWTException: Invalid thread access
    When I replace log.append(...) with System.out.println(..) it works just fine, so my question is do the log.append(..) the right way.

    This is NOT a Java problem but a SWT specific issue.
    It is listed on the SWT FAQ page http://www.eclipse.org/swt/faq.php#uithread
    For more help with this you need to ask your question on a SWT specific forum, there is not a thing in these forums. This advice isn't just about SWT by the way but for all specific API exceptions/problems. You should take those questions to the forum or mailing list for that API. This forum is for general problems and exceptions arising from using the "core" Java libraries.

  • I have the latest version of Itunes downloaded and installed to my computer.  I have a music library already created for my replaced Ipod Nano.  I've just purchased a new Nano.  When I try to access the Itunes store from the Itunes program, it gets hung u

    I have tried uninstalling and reinstalling Itunes, but it still gets hung up when trying to access the Itunes Store from the Itunes program.
    I've been unable to register the new Nano or sync it with my library.

    Many thanks.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • When I tgry to drop a video from the main screen to a time line with no secuence i receive an error with no number, just tell me the progran stop working and the program closes can you help me please

    please someone who help me please
    when I tgry to drop a video from the main screen to a time line with no secuence i receive an error with no number, just tell me the progran stop working and the program closes

    You need to help us first ...
    Computer specs:
    OS, CPU, RAM, GPU, vRAM ... and also disc layout & connections can be useful (as in, "2 internal hard-drives and an external on Thunderbolt connection for exports")
    Program specs:
    Specific build of Premier Pro from the bottom of the "About" splash screen off the "Help" menu is best.
    Footage file type: MXF, AVCHD, MOV, m2s, what?
    Even the camera it was shot on can be of interest at times.
    And did you use media browser to import, then project panel to drag & drop?
    Neil

  • Access a nested symbol timeline from the main stage

    Hi all,
    Would love some help on accessing a nested symbol from the main stage please.
    To set the scene.....
    "Its an autumn day..
    no sorry...just joking...
    So i have a symbol called "NormalAnatomy" - its not on the main stage, but when a button is clicked it appears in the 'content' box which is just a rectangle on the main stage.
    Inside "NormalAnatomy" symbol is another symbol called "Scrub_all" which is an animation
    For users to view the animation they use a scrub bar like this lovely lady has invented:
    Create Click and Touch Draggable Scrubbers with Edge Animate CC | sarahjustine.com
    So for Sarah Justines scrubber to work - the main stage has a lot of actions added to it. Also the "timelinePlay" symbol is on the main stage
    Its starts:
    var symDur = sym.getSymbol("timelinePlay").getDuration();
    var mySymbol = sym.getSymbol("timelinePlay");
    var scrubber = sym.$("scrubber");
    var bar = sym.$("bar");
    sym.$("mobileHit").hide();
    var dragme = false;
    So I put my "NormalAnatomy" symbol on my main stage to see if the code would work and changed all the relevant details.. and indeed it worked!
    var symDur = sym.getSymbol("NormalAnatomy").getSymbol("Scrub_all").getDuration();
    var mySymbol = sym.getSymbol("NormalAnatomy").getSymbol("Scrub_all");
    var scrubber = sym.getSymbol("NormalAnatomy").$("scrubber");
    var bar = sym.getSymbol("NormalAnatomy").$("bar");
    sym.getSymbol("NormalAnatomy").$("mobileHit").hide();
    var dragme = false;
    But i don't want the "NormalAnatomy" symbol to be on the main stage as I want it to appear in the 'content' box only when i hit a btn
    So as soon as I took this symbol off the main stage, the scrubber doesn't work. So I click a btn, and the symbol appears in the content box but the scrubber doesn't work.
    so I tried in front of the "NormalAnatomy"
    getStage().
    getStage("content").
    getComposition().getStage().
    getSymbol("content").
    but nothing works
    The main problem must be the fact that the NormalAnatomy symbol appears inside a content box so the MainStage actions doesn't know how to find it??
    So my question is... what should I put in the main stage actions to make it access the "NormalAnatomy" symbol?
    Thanks for your help in advance!

    On click handler for the symbol use
    sym.getComposition().getStage().getSymbol("nameofsymbol").play();
    or
    sym.getSymbol("nameofsymbol").play();
    replace the italics with the literal name of the symbol as it appears in the Elements panel.
    Some API details found here (http://www.adobe.com/devnet-docs/edgeanimate/api/current/index.html) in the Work With Symbols section.
    Darrell

  • Accessing properties of loaded WindowedApplication from the Main WindowedApplication.

    Hi Friends.
    I am trying a project and according to my plans I am trying
    for some thing but don't know is it possible..
    I am compiling multiple air applications and One of them will
    be the main application. and another will not be actually *.air but
    the compiled swf file.
    In my final Air package I am going to package the Main
    application withe the other swf file too.
    So the main application will load the second swf file on
    requirement.
    Now my issue is i am able to access properties/functions of
    main application from the loaded WindowedApplication but I am not
    getting the idea how to access the loaded WindowedApplication
    properties/function from the MAIN application..
    This i am doing Because I can later Modify only the other
    application with out EFFECTING the MAIN.. like software updates..
    But getting the issue... Local Connection is Success. but
    still I want to establish a direct connection between the two
    WindowedApplications so to avoid lots of code what we write for
    LocaConnection objects.
    Please Give me any idea.

    I'm not sure how successful you will be with this in the long
    run. The WindowedApplication component is meant to be used as a
    singleton.
    If your goal is simply to modularize your code, you might be
    better off creating components that your main application loads,
    rather than trying to create multiple separate AIR applications and
    then combining them.

  • IDVD 7.1.2: I am making music instrument instructional DVDs, and I want to include several audio loops in that the viewer access from the main menu to play along with

    iDVD 7.1.2: I am making music instrument instructional DVDs, and I want to include several audio loops that the viewer access from the main menu to play along with

    Export the slideshow out of iMovie via the File  ➙  Share ➙ File menu option as a 480p Quicktime movie.
    Open iDVD, select a theme and drag the exported QT movie file into the open iDVD window being careful to avoid any drop zones.
    Follow this workflow to help assure the best quality video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    OT

  • I want to call External Java class from the PL/SQL

    Hi,
    I am using Oracle Apps R11i (11.5.7), I wanted to call external Java class from the PL/SQL. This external Java class is residing in another application server.
    How do I do this.
    I know one way. Develop C routine in Oracle Apps to call external java class and call this C routine from the PL/SQL.
    Is there any simple method available? or any other method?
    Thanks in advance.
    -Venkat

    First of all, this is a Java application you're talking about, right (i.e. it has a main() function)? It's not just a class that you're trying to instantiate is it? If it's an application, you obviously have to start a new virtual machine to run it (rather than using the virtual machine built into the database like stored java). I'm a little leary of your mention of an "application server" as this would more commonly mean that a virtual machine is already over there running with access to this class. In which case, you'd typically interface with SOAP or some other RPC API.
    All that aside, as long as you have physical disc access (through NFS or whatever) to the class file, you could use a java wrapper class with a system call to do this. In fact, there is a thread in just the last day or so on this very forum that has the code to do just that (see " Invoking OS Commands from PL/SQL"). However, it's worth noting that the virtual machine will be running on the database server in this case and not the application server.

  • How to pass the caught exception in Thread.run back to the main program?

    I have following three Java files (simplified from a real world application I am developing, see files at the end of this posting):
    1. ThreadTest.java: The main program that invokes the Manager.run()
    2. Manager.java: The manager that creates a thread to execute the Agent.run() for each agent
    3. Agnet.java: The run() method can throw Exception
    My goal is twofold:
    1. To execute the run() method of an Agent in a thread (the reason for this is there are many Agents all managed by a Manager)
    2. To catch the exception thrown by Agent.run() in the main program, ThreadTest.main() -- so the main program can alert the exceptions
    My problem:
    Bottomline: I cannot pass the exception thrown by Agent.run() in the Thread.run() back to the main program.
    Explanation:
    The signature of Thread.run() (or Runnable.run()) is
    public void run();
    Since it does not have a throws clause, so I have to try/catch the Agent.run(), and rethrow a RuntimeException or Error. However, this RuntimeException or Error will not be caught by the main program.
    One work-around:
    Subclass the ThreadGroup, override the ThreaGroup.uncaughtException() methods, and spawn the threads of this group. However, I have to duplicate the logging and exception alerts in the uncaughtException() in addition to those already in the main program. This makes the design a bit ugly.
    Any suggestions? Am I doing this right?
    Thanks,
    Xiao-Li "Lee" Yang
    Three Java Files:
    // Agent.java
    public class Agent {
    public void run() throws Exception {
    throw new Exception("Test Exception"); // Agent can throw execptions
    // Manager.java
    public class Manager {
    public void run() throws Exception {
    try {         // <===  This try/catch is virtually useless: it does not catch the RuntimeException
    int numberOfAgents = 1;
    for (int i = 0; i < numberOfAgents; i++) {
    Thread t = new
    Thread("" + i) {
    public void run() {
    try {
    new Agent().run();
    } catch (Exception e) {
    throw new RuntimeException(e); // <=== has to be RuntimeException or Error
    t.start();
    } catch (Exception e) {
    throw new Exception(e); // <== never got here
    // ThreadTest.java
    public class ThreadTest {
    public static void main(String[] args) {   
    try {
    Manager manager = new Manager();
    manager.run();
    } catch (Throwable t) {
    System.out.println("Caught!"); // <== never got here
    t.printStackTrace();

    The problem is, where could you catch it anyway?
    try {
    thread.start();
    catch(SomeException e) {
    A thread runs in a separate, er, thread, that the catch(SomeException) isn't running within. Get it?
    Actually the Thread class (or maybe ThreadGroup or whatever) is the one responsible for invoking the thread's run() method, within a new thread. It is the one that would have to catch and deal with the exception - but how would it? You can't tell it what to do with it, it (Thread/ThreadGroup) is not your code.

  • How can I allow a sub-vi to run independent of the main program once it has been called while still sending data to the sub-vi

    I have a main program where I call a sub-vi. In this sub-vi, there is a while loop that is used to wait for commands in the sub-vi. While the while loop is running, I cannot continue with normal operation of the main program. I would like get the sub-vi to run independently once it has been called, but not hold up the main program. As well, I need to still be able to send data to the sub-vi

    One way is to use VI Server, which has been mentioned by others. This will allow you to start another VI (by name) and run it entirely independently of the calling VI. This is a good way to start various independent VIs from a main menu, for example. None of the VIs thus called need have any connection to the others.
    Another way it to have the SubVI in a separate while loop on the calling VI's BD. Then, use a local var to start this sub VI from the main loop. The calling VI sets a local START bit and continues running. The sub VI's while loop watches for this START bit to go true, and then runs the Sub VI. The advantage here is that one can more easily pass arguments to the SubVI when it is started, using local vars, which are preferable to globals. Once the Su
    bVI is running, however, you must use a global Stop Bit, set in the calling VI, to stop it when the calling VI exits, or the calling VI will hang up, waiting for the Sub VI to close and exit its while loop.
    If you need an example of this, email me. ([email protected]). I can also recommend Gary W. Johnson's excellent book which discusses this. ("LabVIEW Graphical Programming", 2nd Ed).
    Note: Where possible, I try to call a subvi from within the main VI, wait till it is done, then continue. It avoids the use of locals & globals, and results in cleaner code, with fewer "race" conditions. However, the main VI stops until the subVI is done, hence one should make the subVI modal.

Maybe you are looking for

  • Problem in Creation of implementaton for Badi FAGL_DERIVE_SEGMENT

    Hello Abapers, I am facing problem when creating a implementaion for BADI FAGL_DERIVE_SEGMENT, FAGL_DERIVE_PSEGMENT, The error is when i am going to save any of BADI implemenations, Specify filter types.. The badi is very important to meet my require

  • Pages 09 and Hebrew

    I am a student at a bilingual school where English and Hebrew are taught. I have work to do in hebrew, and using Pages or Keynote with the hebrew is HORRIBLE. Once you type in hebrew into pages, you cannot see the cursor in between letters! You can o

  • How to find out the unused disk space?

    Hi, I want to know if there is any way possible by which I can find out the amount of disk space that is available. I have to write an application that checks for the disk space under Windows and Unix platforms. If anything is possible please let me

  • What went wrong in this Integration kit  Installation - Any Clue

    Hi Ingo and other experts,                                            I'm trying to install SAP Integration kit and as usual like most of others I'm also getting the common error while importing the roles. "com/sap/mw/jco/JCO$Function" 1. BO Enterpri

  • ITunes doesn't open, QuickTime freezes

    Well, as I read on the subject, a lot of people are experiencing this issue so I don't expect to hear a quick recommendations, still ... Mine is that I upgraded to the last version of iTunes yesterday. Till that moment both Quicktime and iTunes worke