I want to get the TextBlock attribute by variate.1. The general situation: OKp=axlGetParam("paramTextBlock:2") p->??=>(objType "paramTextBlock" width 0.584 photoWidth 0.127 name "2" lineSpace 0.991 height 0.787 charSpace 0.203)2. n=2p=axlGetParam("paramTextBlock:n")p->??=>(objType "paramTextBlock")3. procedure( Text(x "n")axlGetParam("paramTextBlock:x"))Text(2)->??=>(objType "paramTextBlock")The result of the 2nd and 3rd situation are not correct. why? how can I get it?
The problem is that you are passing a string to the axlGetParam procedure.Because "x" is inside of double quotes, you are passing a string "x" rather than the evaluation of the variable x.use sprintf, and I would check to make sure that x is an integer:procedure(Text(x) when(integerp(x) axlGetParam(sprintf(nil "paramTextBlock:%d" x)) ))This should return the param or nil (when invalid input).
Ok.It means that I can use sprintf to convert number type to string type.haha, thanks.