Jump to content

Recursive subVI


Recommended Posts

QUOTE (jzoller @ Oct 7 2008, 07:51 PM)

Keep in mind that using a stack (http://en.wikipedia.org/wiki/Stack_(data_s...e)#Applications, for instance) can be far more efficient than using recursion in LV. It may require painful architectural changes though.

Joe Z.

actually I am working on an iterative version of my application using a stack. I am not a big fan of recursive functions, not even in classical languages as C or Pascal.

but I was wondering if recursion exists in LV 8 and I will read something about that. maybe sometimes it will come handy. :)

edit:

I have another question, and I'm not opening a separate thread for it:

Is it bad to use Event Structure to do an event-driven application (for example an application where the user does different actions by pushing buttons)? I find it very easy to use but I haven't seen any example written that way.

Is there any other way to do this type of application?

Link to comment

QUOTE (Pollux @ Oct 8 2008, 04:45 AM)

...edit:

I have another question, and I'm not opening a separate thread for it:

Is it bad to use Event Structure to do an event-driven application (for example an application where the user does different actions by pushing buttons)? I find it very easy to use but I haven't seen any example written that way.

Is there any other way to do this type of application?

I see nothing bad with event driven architrectures. I use them for almost all of my GUI's and with user events i have extended their use to more than just the GUI.

The "old way" used polling which almost shapes out the same but puts additional load on the CPU to do the polling and introduces a delay if you throttle the polling.

Ben

Link to comment

QUOTE (Pollux @ Oct 8 2008, 01:45 AM)

edit:

I have another question, and I'm not opening a separate thread for it:

Is it bad to use Event Structure to do an event-driven application (for example an application where the user does different actions by pushing buttons)? I find it very easy to use but I haven't seen any example written that way.

Is there any other way to do this type of application?

I agree with Ben on this one. The event driven architecture is easy to implement and one of the most efficient ways to implement the kind of program you refer to. The method of polling for changes to your buttons inside a while loop wastes processor time and generally responds more slowly than the event structure.

Toby

Link to comment

QUOTE (Pollux @ Oct 8 2008, 03:45 AM)

I have another question, and I'm not opening a separate thread for it:

Is it bad to use Event Structure to do an event-driven application (for example an application where the user does different actions by pushing buttons)? I find it very easy to use but I haven't seen any example written that way.

Is there any other way to do this type of application?

a) The event structure is *the* way to do UI programming. Polling loops or any other style are not recommended for a host of reasons. Any examples you saw that claim to be demos of user interface programming that are not using the event structure are antiquated.

b) I found a whole lot of example programs that use the event structure. Just use Help>>Examples and search for "events" keyword.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.