I'm making a routine which I might post later. I had a horrible time trying to get RGB true color values converted to index colors using the vla-setRGB function. I think I almost started crying at one point but finally got it...
It appears that my VARIABLE NAMES needed to be all lower-lower case (and possible not have any special characters in them).
Something really strange was happening in that if I plugged in actual numbers (and not variables) the routine would work. As soon as I tried the exact same thing with variables the routine would crash. Not only that it would actually clear my variable from memory (set it to 'nil'), but not update my watch window.
I got smart and downloaded Lee Mac's routine. Same problem. As soon as I switched to lower-case variable names without any special characters, everything started working perfectly. I've never experienced this with AutoLISP before. So thought I would share my findings. I will post my code once it's done if anyone is interested in what I'm actually creating.
Synopsis: Strange behavior using VLA-SETRGB function - appears that variable names used for arguments might have to be LOWER CASE ONLY (and may or may not work with 'special' characters).