Posted By: JoGa
[solved] comparing of panels - 10/05/11 14:34
Hi
I have a problem in comparing Panel-pointers.
I have got some Panels and wrote a little piece of code, which cycles through the panels:
But I think i can't do this - it is not detected right.
The Panels name is pan_invplatz1 and goes to pan_invplatz60.
I hoped I could do this with the strings, because if this does not working, I have to wrote a if-comparing for every single panel (if(mouse_panel == pan_invplatz1){...}, if(mouse_panel == pan_invplatz2){...}, ...) An thats a lot :-) Not only this 60, there are some other places in the code, i would be forced to write the same code clusters.
So, how can i convert a string in a panel-pointer?
Thanks for reading, i'm excited for your hints :-)
I have a problem in comparing Panel-pointers.
I have got some Panels and wrote a little piece of code, which cycles through the panels:
Code:
var i; for(i=1; i <60; i++) { str_cpy(str_mouse_over, "pan_invplatz"); //Name of panels str_cat_num(str_mouse_over,"%.0f",i); //number of panels in the name pan_mouse_over = (PANEL*) str_mouse_over; //tried to say "dude, thats a panel-pointer" if(mouse_panel == pan_mouse_over) // and tried to compare it with the mouse-over-panel { str_cpy(str_debug,str_mouse_over); // .... } } }
But I think i can't do this - it is not detected right.
The Panels name is pan_invplatz1 and goes to pan_invplatz60.
I hoped I could do this with the strings, because if this does not working, I have to wrote a if-comparing for every single panel (if(mouse_panel == pan_invplatz1){...}, if(mouse_panel == pan_invplatz2){...}, ...) An thats a lot :-) Not only this 60, there are some other places in the code, i would be forced to write the same code clusters.
So, how can i convert a string in a panel-pointer?
Thanks for reading, i'm excited for your hints :-)