
-----------------------------------
xHoly-Divinity
Thu Dec 02, 2004 10:41 am

Card game shapes!!! moving procedures!!!
-----------------------------------


proc club (var xx, yy : int)
    drawfilloval (400 + xx, 100 + yy, 7, 7, black)
    drawfilloval (392 + xx, 90 + yy, 7, 7, black)
    drawfilloval (408 + xx, 90 + yy, 7, 7, black)
    Draw.ThickLine (400 + xx, 90 + yy, 400 + xx, 75 + yy, 5, black)
    Draw.ThickLine (396 + xx, 74 + yy, 404 + xx, 74 + yy, 3, black)
end club

club (50, 50)



I do not know what is wrong with the code. It doesn't move the procedure. I get an error stating 'non variable passed to variable format'

-----------------------------------
Delos
Thu Dec 02, 2004 10:45 am


-----------------------------------
Your paramters for your proc have been declared in variable format.  Instead, declare your procedure as:


proc club (xx, yy : int)
%...


This way the paramters may be hardcoded ints or variables, but may not be editted at anypoint during the proc.

-----------------------------------
xHoly-Divinity
Thu Dec 02, 2004 11:17 am


-----------------------------------
Ahhh ic ic. Thank you. But now I am having another problem. I am using the drawfillpolygon command and I end up getting an error. 


procedure spade (xx, yy : int)
    drawfilloval (113 + xx, 98 + yy, 12, 10, black)
    Draw.ThickLine (113 + xx, 98 + yy, 113 + xx, 80 + yy, 7, black)
    Draw.ThickLine (105 + xx, 79 + yy, 120 + xx, 79 + yy, 3, black)
    var x : array 1 .. 3 of int := init (100 + xx, 126 + xx, 113 + xx)
    var y : array 1 .. 3 of int := init (100 + yy, 100 + yy, 119 + yy)
    Draw.FillPolygon (x, y, 3, black)
end spade

spade (50, 50)




I have tried doing it that way and



procedure spade (xx, yy : int)
    drawfilloval (113 + xx, 98 + yy, 12, 10, black)
    Draw.ThickLine (113 + xx, 98 + yy, 113 + xx, 80 + yy, 7, black)
    Draw.ThickLine (105 + xx, 79 + yy, 120 + xx, 79 + yy, 3, black)
    var x : array 1 .. 3 of int := init (100, 126, 113)
    var y : array 1 .. 3 of int := init (100, 100, 119)
    Draw.FillPolygon (x+xx, y+yy, 3, black)
end spade


that way. But for both I get an error. I really need help with this if there is a way to fix it!!!!!!

-----------------------------------
Viper
Thu Dec 02, 2004 2:09 pm


-----------------------------------
try putting the polygon somewhere else bc i think the problem is with the x+xx and y+yy since xx and yy havent been previously declared it has nothing 2 add 2 x and y im not totaly sure though

-----------------------------------
Delos
Thu Dec 02, 2004 3:25 pm


-----------------------------------
I couldn't tell you why, but replace the init clause with direct initializations, and it will work.

Perhaps someone who could translate "compile time expression"...I used to know what that meant...something about certain things that must be computable before compilation...[sigh]
