Go Back   Cockos Incorporated Forums > Projects > Deprecated REAPER issue tracker > Feature Request

JS: GOTO (the FR of the shame) Issue Tools
issueid=2973 09-23-2010 06:48 AM
Human being with feelings
JS: GOTO (the FR of the shame)
The FR of the shame

Without functions, JS code can become quiet complicated + duplicated + hard to read (especially @gfx) + bigger JS + etc..
One pragmatic/reasonable solution (if we think to ASM compilation that occurs behind the scene) would perharps be a new "goto" instruction (?)

Example: a "function" in JS that returns (prm1+prm2)

Code:
[...]

@block


// "FUNCTION" MUL
@mul
return = prm1 * prm2;
goto caller;


// "FUNCTION" ADD
@add
return = prm1 + prm2;
goto caller;


[...]

     // CALL TO THE ADD "FUNCTION"
     prm1 = 78;
     prm2 = 2.33;
     caller = "stuff";
     goto "add";
@stuff
     myArray[i] = return;

[...]

This is a raw "function" example, just to describe the idea. There're many other cases where a goto instruction could be useful.
I'm not asking for -this- implementation (string type doesn't exist in JS so, for ex., @custom_parts could be numerical values: @12 / goto 12)



OT: being a dev and entering GOTO fr 20 years after the glorious Commodore 64 is just a shame. Never thought I'd have to do that one day!
=> thanks in advance for your discretion ;-)

Bob.
Issue Details
Issue Type Feature Request
Project Deprecated REAPER issue tracker
Category Arcana
Status Suggested
Priority 5 - Medium
Suggested Version 3.672
Implemented Version (none)
Users who would use this feature 12
Users who would not use this feature 1
Assigned Users (none)
Tags (none)

09-23-2010 02:30 PM
Moderator
 
Reply
07-24-2012 04:55 AM
Mortal
 
The issue tracker needs a new status like "more than implemented" :)

Indeed, in REAPER v4.25, among other JS goodies, we now have functions (which was the real need behind this FR), see http://www.cockos.com/reaper/sdk/js/js.php#js_userfunc

Thank you CockOS!!
Reply
Reply

Issue Tools
Subscribe to this issue

All times are GMT -7. The time now is 10:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.