8.18/6/2018

IntToFloat (function)

Converts an integer expression into a measure value.

Syntax

inttofloat( expression ) measure value

Argument

expression

Integer value to be converted.

Code Sample Example

This example uses a loop to draw a series of blue rectangles.

Example


define(&x,integer,1)
%Define loop variable
setfillcolor([100,100,0,0])
%Fill blue
for(&x,1,1,10) 
  %Set up loop
  %We must convert &x because rectfill
  %expects measure values
  rectfill(inttofloat(&x)/2,1,0.1,1)
  %Draw rectangle
endfor()