Welcome, Guest. Please login or register.

Author Topic: Question from an ARexx newbie  (Read 2356 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Daedalus

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 893
    • Show all replies
    • http://www.robthenerd.com
Re: Question from an ARexx newbie
« on: June 10, 2009, 10:39:09 PM »
I'm a little rusty myself but I did write just such a script years ago for my InfraRexx setup... How about something like this:

Code: [Select]
ADDRESS AMPLIFIER.1
'VOLUME'
MyVol = RESULT
MyVol = MyVol + 10
IF MyVol > 64 THEN MyVol = 64

'VOLUME 'MyVol

Think that should work to up the volume, and check to make sure you don't go above the maximum value of 64. Bear in mind that different players have different volume scales (IIRC AmigaAmp goes from 0 to 26), and that I remember steps of 1 were far too small to be useful or even noticeable, so I think I used 5 or 10. Experiment there...
Engineers do it with precision
--
http://www.robthenerd.com
 

Offline Daedalus

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 893
    • Show all replies
    • http://www.robthenerd.com
Re: Question from an ARexx newbie
« Reply #1 on: June 10, 2009, 11:50:43 PM »
Quote from: Matt_H;510480
Thanks for that, but where does the returned value of VOLUME go? Does it actually go to RESULT? If that's the case, I'm having some data type issues, since the subsequent lines of the example treat it as the letters R E S U L T rather than a number.


Oh, maybe it doesn't then... Usually in ARexx you issue a command to the application (in this case 'VOLUME' without an argument), and the app puts the result in a special variable called RESULT. If a variable is empty/unused in ARexx however, it defaults to the string you're seeing. I guess Amplifier works differently to how I remember...

Crap! Don't forget to put OPTIONS RESULTS at the top of your script - like I did ;) Without it ARexx is unable to accept RESULTS values...
Engineers do it with precision
--
http://www.robthenerd.com