<br><div class="gmail_quote">2009/6/18 Graeme Geldenhuys <span dir="ltr"><<a href="mailto:graemeg@opensoft.homeip.net">graemeg@opensoft.homeip.net</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Vincent Snijders wrote:<br>
><br>
> Backwards compatibility with turbo pascal, which lacked initialized<br>
> variables and writable constants were the alternative.<br>
<br>
</div>Thanks Vincent. The Kylix 3 help mentioned early versions of Delphi and<br>
Borland Pascal, which made me think that it must have been some<br>
limitation in the older compilers. Thanks for confirming this.<br>
<div class="im"><br>
<br>
Regards,<br>
- Graeme -<br></div></blockquote></div><br>I also find writable constants hand for things like this where I can define the 'variable' + values too so I don't have to set the values at run time:<br><br>Const<br>
{..............................................................................}<br> cNote_Unknown = -1;<br> cNote_C = 0;<br> cNote_Cs = 1; cNote_Db = 1;<br> cNote_D = 2;<br> cNote_Ds = 3; cNote_Eb = 3;<br>
cNote_E = 4;<br> cNote_F = 5;<br> cNote_Fs = 6; cNote_Gb = 6;<br> cNote_G = 7;<br> cNote_Gs = 8; cNote_Ab = 8;<br> cNote_A = 9;<br> cNote_As = 10; cNote_Bb = 10;<br>
cNote_B = 11;<br> cNotes : Array[0..11,0..8] Of Single =<br> (<br> //Octave<br>//Note 0 1 2 3 4 5 6 7 8<br>
{C} (16.3515978312874, 32.7031956625748, 65.4063913251497, 130.812782650299, 261.625565300599, 523.251130601197, 1046.50226120239, 2093.00452240479, 4186.00904480958),<br>{C#/Db} (17.3239144360545, 34.647828872109 , 69.295657744218 , 138.591315488436, 277.182630976872, 554.365261953744, 1108.73052390749, 2217.46104781498, 4434.92209562995),<br>
{D} (18.354047994838 , 36.7080959896759, 73.4161919793519, 146.832383958704, 293.664767917408, 587.329535834815, 1174.65907166963, 2349.31814333926, 4698.63628667852),<br>{D#/Eb} (19.4454364826301, 38.8908729652601, 77.7817459305202, 155.56349186104 , 311.126983722081, 622.253967444162, 1244.50793488832, 2489.01586977665, 4978.03173955329),<br>
{E} (20.6017223070544, 41.2034446141088, 82.4068892282175, 164.813778456435, 329.62755691287 , 659.25511382574 , 1318.51022765148, 2637.02045530296, 5274.04091060592),<br>{F} (21.8267644645628, 43.6535289291255, 87.307057858251 , 174.614115716502, 349.228231433004, 698.456462866008, 1396.91292573202, 2793.82585146403, 5587.65170292806),<br>
{F#/Gb} (23.1246514194772, 46.2493028389543, 92.4986056779086, 184.997211355817, 369.994422711634, 739.988845423269, 1479.97769084654, 2959.95538169308, 5919.91076338615),<br>{G} (24.4997147488593, 48.9994294977187, 97.9988589954373, 195.997717990875, 391.995435981749, 783.990871963499, 1567.981743927 , 3135.96348785399, 6271.92697570799),<br>
{G#/Ab} (25.9565435987466, 51.9130871974931, 103.826174394986, 207.652348789973, 415.304697579945, 830.60939515989 , 1661.21879031978, 3322.43758063956, 6644.87516127912),<br>{A} (27.5 , 55 , 110 , 220 , 440 , 880 , 1760 , 3520 , 7040 ),<br>
{A#/Bb} (29.1352350948806, 58.2704701897613, 116.540940379522, 233.081880759045, 466.16376151809 , 932.32752303618 , 1864.65504607236, 3729.31009214472, 7458.62018428944),<br>{B} (30.8677063285078, 61.7354126570155, 123.470825314031, 246.941650628062, 493.883301256124, 987.766602512248, 1975.5332050245 , 3951.06641004899, 7902.13282009799)<br>
);<br>{..............................................................................}<br><br><br>Notice the cNotes array - it is already filled with values for me to use at runtime :)<br><br>cheers,<br>Paul<br><br><br>