Handles are numbers, not strings. The particular number is not important; it just indicates the place in memory to store the image (and the particular number is going to be different each time your run your program so it doesn't really matter to you much). The important point you want to know about a handle is that it is how you get your program to access the data. So leave the number of a handle alone, leave it "under the hood". Don't do any math with that number.
The first line in your function:
"tempOutImgStore$=outimg$ ; loads the data of outimg$ into a temporary variable"
Actually, it's not loading any data, it is just copying a string (text) from another string.
tempOutImgStore$ = tempOutImgStore$+i ;add the current direction to the tempOutImgStore variable
So, you want your tempOutImgStore$ variable to be:
rotatedimage1
...and then, ...eventually:
rotatedimage123456789[...]360
? No? (that might work in Python, not even sure about it working or not in Blitz.) It seems you are trying to add a number, i, to some text, "rotatedimage". It's probably
not what you want, right? In any case, it doesn't really matter to the compiler, because you completely throw away the value you assigned to tempOutImgStore$ entirely with your very next line:
tempOutImgStore$ = CopyImage(tempImg2) ;copies the rotated image to the newly defined tempOutImgStore variable
Directly above is my problem - I need the data defined (the text of tempOutImg) to be the 'handle' for the image.
If that line of code works, it will write a very arbitrary, non-useful number to the string (text!!!) variable tempOutImgStore$. You can't really do much with that. (And, tempOutImageStore gets an entirely
new value two lines later, so it's all for nothing.)
Sauer has very good advice on structuring your code and simplifying it.
Good use of DebugLog... write more of these statements earlier in your code.