Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 04-26-2014, 11:15 AM   #1
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,680
Default JS FX: Syntax for indexing sliders

Slider values can also be accessed with a variable index: slider(1), slider(2), ... slider(variable).
i=1; loop(64, x+=slider(i) ; i+=1);
Wouldn't it be better if the indexing used the usual JS FX syntax:
i=1; loop(64, x+=slider[i] ; i+=1);
I've just spent 15 minutes trying to see why the second form was not working! Especially as it does not throw up a compilation error.

In fact 'slider' is then treated as a user-defined variable, and as nothing is assigned to it, it has a value of 0. But is it coloured yellow indicating that is is a system name of some sort.

-------------------------------------
Issue Tracker:
http://forum.cockos.com/project.php?issueid=5180
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is offline   Reply With Quote
Old 05-04-2014, 06:10 AM   #2
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,818
Default

Voted, as I'm fond of consistency and the lack of oxygen-wasting surprises.
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 07-20-2014, 11:44 AM   #3
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,891
Default

I disagree. I think the square braces should remain exclusively for memory access. What you're suggesting would only muddy the waters.

The issue of text colouring is another matter. The text "slider" shouldn't be coloured yellow in your example. That's misleading.
IXix is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:20 PM.


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