Hello,
If you still need some additional help with this, I have included a piece of skill code I wrote to check and change some Text block data for my job. Take a look, maybe you can modify it for your needs.
; vc_SetTxtPlotW.il
; Ver. 1.1- 11-25-2008 - VC
;
; Written by:
; Vincent Canulli Sr.
; boardman0@lycos.com
;
; This will set all fields of the first four text blocks for you and then check to see that all the remaining
; text blocks have the PhotoPlot Width set to our standards. If it is not it will correct it.
;
axlCmdRegister( "settxtpw" 'vc_SetTextPlotW ) ;register the command with allegro
;Globals
defun( vc_SetTextPlotW ()
let(( x p txtBlk_name txtBlk_photo txtBlk_height )
axlMsgPut( " Running vc_SetTxtPlotW" )
axlUIWPrint( nil " Check the allegro journal file for Text Block PhotoPlot Width changes if interested." )
for(i, 1, axlDBControl('maxTextBlock) ; loop from 1 to max text block number
sprintf(p, "paramTextBlock:%d", i) ; set p equal to the dbid of the text block number
txtBlk_name = axlGetParam(p)->name ; get the name field
txtBlk_photo = axlGetParam(p)->photoWidth ; get the photoWidth field
txtBlk_height = axlGetParam(p)->height ; get the height filed
; test each case and correct if needed
cond(
( equal( txtBlk_name "1" ) x=axlGetParam(p) x->width=0.2540 x->height=0.3810 x->lineSpace=0.5080 x->photoWidth=0 x->charSpace=0.0762 axlSetParam(x) )
( equal( txtBlk_name "2" ) x=axlGetParam(p) x->width=0.5842 x->height=0.7874 x->lineSpace=0.9906 x->photoWidth=0.1270 x->charSpace=0.1524 axlSetParam(x) )
( equal( txtBlk_name "3" ) x=axlGetParam(p) x->width=0.9652 x->height=1.2700 x->lineSpace=1.6002 x->photoWidth=0.1524 x->charSpace=0.2032 axlSetParam(x) )
( equal( txtBlk_name "4" ) x=axlGetParam(p) x->width=0.6096 x->height=1.0160 x->lineSpace=2.0066 x->photoWidth=0.1524 x->charSpace=0.1524 axlSetParam(x) )
( txtBlk_height <=0
axlMsgPut( "*** Warning Text Block - #%d has an invalid height! ***" i );
axlUIConfirm( sprintf( nil "*** Warning Text Block - #%d has an invalid height! ***" i ))
)
( txtBlk_height <2.540 && atoi( txtBlk_name ) >4 && nequal( txtBlk_photo 0.1524) x=axlGetParam(p) x->photoWidth=0.1524 axlSetParam(x)
axlMsgPut( " Text Block %s PhotoPlot Width was changed from %n to 0.1524." txtBlk_name txtBlk_photo ))
( txtBlk_height <3.810 && txtBlk_height >=2.540 && atoi( txtBlk_name ) >4 && nequal( txtBlk_photo 0.2540 ) x=axlGetParam(p) x->photoWidth=0.2540 axlSetParam(x)
axlMsgPut( " Text Block %s PhotoPlot Width was changed from %n to 0.2540." txtBlk_name txtBlk_photo ))
( txtBlk_height <5.080 && txtBlk_height >=3.810 && atoi( txtBlk_name ) >4 && nequal( txtBlk_photo 0.3810 ) x=axlGetParam(p) x->photoWidth=0.3810 axlSetParam(x)
axlMsgPut( " Text Block %s PhotoPlot Width was changed from %n to 0.3810." txtBlk_name txtBlk_photo ))
( txtBlk_height <6.350 && txtBlk_height >=5.080 && atoi( txtBlk_name ) >4 && nequal( txtBlk_photo 0.5080 ) x=axlGetParam(p) x->photoWidth=0.5080 axlSetParam(x)
axlMsgPut( " Text Block %s PhotoPlot Width was changed from %n to 0.5080." txtBlk_name txtBlk_photo ))
( txtBlk_height >=6.350 && atoi( txtBlk_name ) >4 && nequal( txtBlk_photo 0.6350 ) x=axlGetParam(p) x->photoWidth=0.6350 axlSetParam(x)
axlMsgPut( " Text Block %s PhotoPlot Width was changed from %n to 0.6350." txtBlk_name txtBlk_photo ))
);end cond
);end for
axlMsgPut( " Text PhotoPlot Widths have been checked and/or corrected." )
);end let
);end vc_SetTextPlotW