wPrintF
- Posted by bobspringett <bobspringett at WANADOO.FR> Aug 25, 2000
- 490 views
I am trying to wPrintf an atom to a window using the attached code but I keep getting an error " type check failed s2=1." I also tried calling it an integer 'and a few other names' but always the same. The variable n is the one in question and all I need is to print a number in a certain position on the window. Can someone please tell me what I am doing wrong? CODE: procedure SideIndex() atom n x1=2 y1=editBoxHeight+2 n=1 for z=1 to screenCellsDown do setPenColor(DrawWin,rgb(200,200,200)) drawRectangle(DrawWin,True,x1+2,y1+2,x1+editBoxWidth-3,y1+editBoxHeight-3) setPenColor(DrawWin,BrightWhite) drawLine(DrawWin,x1,y1,x1+editBoxWidth,y1) drawLine(DrawWin,x1+1,y1+1,x1+editBoxWidth-2,y1+1) drawLine(DrawWin,x1,y1,x1,y1+editBoxHeight) drawLine(DrawWin,x1+1,y1+1,x1+1,y1+editBoxHeight-2) setPenColor(DrawWin,rgb(100,100,100)) drawLine(DrawWin,x1+2,y1+editBoxHeight-1,x1+editBoxWidth-1,y1+editBoxHeight-1) drawLine(DrawWin,x1+3,y1+editBoxHeight-2,x1+editBoxWidth-2,y1+editBoxHeight-2) drawLine(DrawWin,x1+editBoxWidth-1,y1+3,x1+editBoxWidth-1,y1+editBoxHeight-1) drawLine(DrawWin,x1+editBoxWidth-2,y1+2,x1+editBoxWidth-2,y1+editBoxHeight-2) indexPosX=floor(x1+(editBoxWidth/2)-(fontSize[1]/2)) indexPosY=floor(y1+(editBoxHeight/2)-(fontSize[2]/2)) setPosition(DrawWin,indexPosX,indexPosY) wPrintf(DrawWin,"%d",n) n+=1 y1+=editBoxHeight end for end procedure