Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,310 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Combining two variables! #366579
04/05/11 12:48
04/05/11 12:48
Joined: Aug 2007
Posts: 74
Mahdi Offline OP
Junior Member
Mahdi  Offline OP
Junior Member

Joined: Aug 2007
Posts: 74
hi,

sorry I ask a lot of questions grin

This is the situation:

I hav several panels with these kind of names:

inventory_panel_1, inventory_panel_2, inventory_panel_3,...

I have a function and I want to make all these panels visible with just one while loop, like this:

Code:
function whatever ()
{
  while (x < y)
  {
    inventory_panel_x.visible=on;
    x+=1;
    wait(1);
  }

}



Is it possible (don't forget the above code does not work)?

Last edited by Mahdi; 04/05/11 12:50.

I don't care!
Re: Combining two variables! [Re: Mahdi] #366581
04/05/11 12:51
04/05/11 12:51
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You can save your panels in an array and later on iterate over that array. You can store the panels in a var array. You just have to temporarily assign them to a panel reference later on to set their visible flag.


Always learn from history, to be sure you make the same mistakes again...
Re: Combining two variables! [Re: Uhrwerk] #366586
04/05/11 13:23
04/05/11 13:23
Joined: Aug 2007
Posts: 74
Mahdi Offline OP
Junior Member
Mahdi  Offline OP
Junior Member

Joined: Aug 2007
Posts: 74
I don't undrestand. can u pls write an example?


I don't care!
Re: Combining two variables! [Re: Mahdi] #366598
04/05/11 15:22
04/05/11 15:22
Joined: Aug 2007
Posts: 74
Mahdi Offline OP
Junior Member
Mahdi  Offline OP
Junior Member

Joined: Aug 2007
Posts: 74
someone please help me. I want to change not only the visibility but also the bmap property of all panels.

Is there any way?

Last edited by Mahdi; 04/05/11 15:27.

I don't care!
Re: Combining two variables! [Re: Mahdi] #366599
04/05/11 15:28
04/05/11 15:28
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Which part didn't you understand?


Always learn from history, to be sure you make the same mistakes again...
Re: Combining two variables! [Re: Uhrwerk] #366600
04/05/11 15:32
04/05/11 15:32
Joined: Aug 2007
Posts: 74
Mahdi Offline OP
Junior Member
Mahdi  Offline OP
Junior Member

Joined: Aug 2007
Posts: 74
I think the whole part grin

How can I assign panels to arrays?
In which way can change the visibility of panels (now arrays)?

I just cann't undrestand. please give me an example.


I don't care!
Re: Combining two variables! [Re: Mahdi] #366601
04/05/11 15:44
04/05/11 15:44
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
Well, you define a panel as usual. Then you define an array - as usual as well. My C-Script is a bit rusty, but it should be something like this:
Code:
var mypanels[10];


The you can assign your panels to the array.
Code:
mypanels[0] = my_first_panel;
mypanels[1] = my_second_panel;
// etc.


Finally you can read them out of the array.
Code:
PANEL* p;
p = mypanels[0];
p.visible = off;


Just put that last code fragment in a loop.



Always learn from history, to be sure you make the same mistakes again...
Re: Combining two variables! [Re: Uhrwerk] #366662
04/06/11 03:22
04/06/11 03:22
Joined: Aug 2007
Posts: 74
Mahdi Offline OP
Junior Member
Mahdi  Offline OP
Junior Member

Joined: Aug 2007
Posts: 74
Thanks. That is want. problem is solved.


I don't care!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1