IMHO it's always a bad idea to use keywords as variable names. Unfortunately something like "select%" was allowed in version 10. Good to see that this was corrected in V11.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
TYPE TRect
x1%
y1%
width%
height%
ENDTYPE
LOCAL r AS TRect
r = create_rect(10, 10, 100, 50)
draw(r)
SHOWSCREEN
KEYWAIT
FUNCTION create_rect AS TRect: x1%, y1%, width%, height%
LOCAL r AS TRect
r.x1 = x1
r.y1 = y1
r.width = width
r.height = height
RETURN r
ENDFUNCTION
FUNCTION draw: r AS TRect
DRAWRECT r.x1, r.y1, r.width, r.height, RGB(255, 0, 0)
ENDFUNCTION
draw(create_rect(10, 10, 100, 50))
WHILE TRUE
unterprog1()
unterprog2()
...
SHOWSCREEN
WEND
INLINE
const TVec2 operator+(TVec2& _a, const TVec2& _b );
const TVec2 operator+(TVec2& _a, DGInt b);
ENDINLINE
TYPE TVec2
x#
y#
w# = 1
ENDTYPE
LOCAL one AS TVec2
LOCAL two AS TVec2
one.x = 1
one.y = 2
two.x = 3
two.y = 4
LOCAL result AS TVec2
result = one + two
result = result + 11
STDOUT "result.x = " + result.x + "\n"
STDOUT "result.y = " + result.y + "\n"
STDOUT "result.w = " + result.w + "\n"
KEYWAIT
FUNCTION __dummy__:
ENDFUNCTION
INLINE
const TVec2 operator+(TVec2& _a, const TVec2& _b )
{
_a.x += _b.x;
_a.y += _b.y;
_a.w += _b.w;
return _a;
}
const TVec2 operator+(TVec2& _a, DGInt b)
{
_a.x += b;
_a.y += b;
_a.w += b;
return _a;
}
ENDINLINE