Dynamic names

new topic     » topic index » view thread      » older message » newer message

Hi everyone,

Case:     In a given situation I want to add 1 to an specified integer.

Something like this:

integer atbat, RBIplayer1, RBIplayer2, RBIplayer3.....RBIplayer 10, etc.

if X > 0 then
     if atbat = player1 then RBIplayer1 = RBIplayer1 + 1 end if
     if atbat = player2 then RBIplayer2 = RBIplayer2 + 1 end if
....
     if atbat = player10 then RBIplayer10 = RBIplayer10 + 1 end if
end if

Is it possible to simplify it to something like this:

if X > 0 then
     RBI[atbat] = RBI[atbat] + 1
end if


Bye,

Jasper.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu