EXIT Question

Using Nyquist scripts in Audacity.
Post and download new plug-ins.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like

EXIT Question

Permanent link to this post Posted by dondiego929 » Sat Jul 31, 2010 4:29 am

<<deleted by user>>
Last edited by dondiego929 on Mon Sep 13, 2010 2:10 am, edited 1 time in total.
dondiego929
 
Posts: 54
Joined: Mon May 17, 2010 4:40 am
Operating System: Please select

Re: EXIT Question

Permanent link to this post Posted by dondiego929 » Sun Aug 01, 2010 12:32 am

<<deleted by user>>
Last edited by dondiego929 on Mon Sep 13, 2010 2:11 am, edited 1 time in total.
dondiego929
 
Posts: 54
Joined: Mon May 17, 2010 4:40 am
Operating System: Please select

Re: EXIT Question

Permanent link to this post Posted by steve » Sun Aug 01, 2010 2:06 pm

dondiego929 wrote:Can't get !end to work either.

!end is used in "adagio" to mark the end of a score. http://www.audacity-forum.de/download/e ... l#index750

dondiego929 wrote:... allow programmers to have the plug-in exit instead of running through all the code.
... I like to program in modules,
... as plug-ins become larger with more features (no sense running through all the code if you're only going to use a few modules).
...allows programmers to greater ensure that the plug-in is running under acceptable parameters using the correct type of audio.


I totally agree with your reasoning. This was one of the main points that I raised in an earlier post concerning the usefulness of structured programming.

In BASIC, depending on the dialect, structuring code can be quite limited. For example, some dialects do not allow the programmer to write their own procedures. Procedures and functions are methods, implemented in some later versions of BASIC, of creating structured flow control, thus avoiding cumbersome and inefficient complex GOTO branching (often referred to as "spaghetti code")

Nyquist inherits from XLisp the facility to structure code in several useful ways.
For example: Nyquist supports block structures such as LET, conditional block structures such as DO and WHILE, and user defined functions.

dondiego929 wrote:For Example:
(IF (= X Y) (EXIT))

In this example, you are wanting to skip the code that follows this statement.
Or put another way, the code that follows this statement should only be run IF (= X Y) is false, so the "block" of code that follows this line should be run conditionally.

(IF (= X Y) (EXIT)
ELSE
{run this block of code
.....
....}
END

A simple and efficient way to structure this would be to write that block of code as a function.

(defun block_of_code ()
....
....)

Then you can call that function (run that code) conditionally:

(if (/= X Y) (block_of_code)) ; if x is not equal to y, run the block of code, otherwise don't
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46584
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: EXIT Question

Permanent link to this post Posted by dondiego929 » Sun Aug 01, 2010 8:28 pm

<<deleted by user>>
Last edited by dondiego929 on Mon Sep 13, 2010 2:11 am, edited 1 time in total.
dondiego929
 
Posts: 54
Joined: Mon May 17, 2010 4:40 am
Operating System: Please select

Re: EXIT Question

Permanent link to this post Posted by steve » Sun Aug 01, 2010 9:42 pm

Nyquist is a high level scripting language. If you wish to do low level programming then Nyquist is not the language for you.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 46584
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu


Return to Nyquist



Who is online

Users browsing this forum: No registered users and 1 guest