|
-
Oct 25th, 2011, 08:54 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Use of variables in Activex8 sound API to set Constants.
I am trying to write code using the ActiveX8 reference to generate short bursts of sound through my speaker at a FREQ(in Hz) and for a dur(ation) (in secs.). Parameters are specified at Option Explicit as constants.
The routine works 100% if I write code which specifies these parameters : eg.
Const FREQ = 500 'means 500 Hz
Const dur = 0.2 'means 200 milliseconds
So far, so good. But now I wish to have the VB6 program vary these parameters. For example, I would like to dim an integer variable named MYFREQ and be able to write Const FREQ = MYFREQ. However this fails. I get the error message "Assignment to Constant not permitted".
How can I reset, in software, the value of an API Const to the instantaneous value of a variable? Does the variable need to be Dim'd as a special type? How to assign a new value to a Constant in software?
Suggestions gratefully requested.
camoore
Wales
UK
Last edited by camoore; Oct 25th, 2011 at 09:03 AM.
Reason: some more info added.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|