@Rook,
you could use a kind of HashTable to store the name of an image. Since you use Blitz3D, you may find useful a property read and write function, available in the code archive, by Ken Lynch:
http://www.blitzbasic.com/codearcs/codearcs.php?code=820
With the above property bag, you can use SetProperty, by using the image ID as property name. Later you can, via GetProperty, address to that property (by using the image ID) to get the image name.
In this way, you achieve an HashTable in a very easy - and effective - way.
Alternatively:
Since each image has an unique ID - which is returned by the function LoadImage - you can use store that ID in a string (or in a bi-dimensional array) or in a type structure, and associate it with anything you like.
Example:
Another example:
You need a string parsing function too. Look in the code archive.
Hope this has sense for you,
Sergio.
you could use a kind of HashTable to store the name of an image. Since you use Blitz3D, you may find useful a property read and write function, available in the code archive, by Ken Lynch:
http://www.blitzbasic.com/codearcs/codearcs.php?code=820
With the above property bag, you can use SetProperty, by using the image ID as property name. Later you can, via GetProperty, address to that property (by using the image ID) to get the image name.
In this way, you achieve an HashTable in a very easy - and effective - way.
Alternatively:
Since each image has an unique ID - which is returned by the function LoadImage - you can use store that ID in a string (or in a bi-dimensional array) or in a type structure, and associate it with anything you like.
Example:
type t_img_name field ID field name$ end type Global img_name.t_img_name ID = LoadImage("test.bmp") img_name = new t_img_name img_name\ID = ID img_name\name = "your image name here" . .A simple for..each loop through the type list, will check if the ID of the clicked image is in the list, and then get its name.
Another example:
mystring$ = ID + "#" + "your image name" . . ID = Parse(mystring,"#",1) name$ = Parse(mystring,"#",2) if ID = image_clicked_by_mouse then print "you clicked on the image named: " + name endifYou need an array of strings here, but you can use also a bi-dimensional array for your convenience. You have to loop through the whole list until your ID is matched, or the list is ended.
You need a string parsing function too. Look in the code archive.
Hope this has sense for you,
Sergio.