# Using GPs to store more than number or text

Thought I would pass this on to you all.
I did not like my array solution for determining how many hexes the AoE would show.
eg GP text2 - 010203040506070809101112
Then using the instring function to get the 2 digit value I needed (and then it fails due to the leading 0).
So I tried another way:
GP text2 ydiff=2?xdiff<=1?2:xdiff+1
To use in a DP simply do this - GetProperty(“text”+ydiff). The DP takes that ydiff=2?xdiff<=1?2:xdiff+1 and evaluates it as a conditional statement. ydiff is a property that be from 0 to 10 (for my modules).

As if. It was only working when I moved horizontally and the ydiff==0:xdiff part worked. As soon as ydiff (vertical movement) was not 0, all I got was the contents of the GP.
So, instead of those GPs, I compiled this beast (at the least it does work):
ydiff>=stdrange?stdrange:ydiff==0?xdiff:(ydiff==1&&xdiff<=1)?1:(ydiff==2&&xdiff<=1)?2:(ydiff==3&&xdiff<=2)?3:(ydiff==4&&xdiff<=2)?4:(ydiff==5&&xdiff<=3)?5:(ydiff==6&&xdiff<=3)?6:(ydiff==7&&xdiff<=4)?7:(ydiff==8&&xdiff<=4)?8:(ydiff=9&&xdiff<=5)?9:(ydiff==10&&xdiff<=5)?10:(ydiff==11&&xdiff<=6)?11:(ydiff==12&&xdiff<=6)?12:(ydiff==13&&xdiff<=7)?13:(ydiff==14&&xdiff<=7)?14:(ydiff==15&&xdiff<=8)?15:(ydiff==16&&xdiff<=8)?16:(ydiff==17&&xdiff<=9)?17:(ydiff==18&&xdiff<=9)?18:(ydiff==19&&xdiff<=10)?19:xdiff+1