Posted: Sat Feb 10, 2007 2:33 pm
...which would look like this:
which is better (in my eyes) than using a temp variable:
though the last approach isn't too bad as long as you combine just one parameter. But for multiple parameters it becomes worse:
is much better than introducing lots of temp variables:
Code: Select all
Out("sprite(" + \Name + ", " \
+ Str(Value) + ", " \
+ Str(\Width) + ", " \
+ Str(\Height) + ", " \
+ Str(\left) + ", " \
+ Str(\right) + ", " \
+ Str(\bottom) + ", " \
+ Str(\top) + ", " \
+ Str(\Transparent) + ", " \
+ Str(\Smooth) + ", " \
+ Str(\Preload) + ", " \
+ Str(\BoundingBox) + ", " \
+ Str(\Precise) + ", " \
+ Str(\Origin\x) + ", " \
+ Str(\Origin\y) + ", " \
+ Str(\SubimageCount) + ")")
Code: Select all
s.s = "sprite(" + \Name + ", "
s + Str(Value) + ", "
s + Str(\Width) + ", "
s + Str(\Height) + ", "
s + Str(\left) + ", "
s + Str(\right) + ", "
s + Str(\bottom) + ", "
s + Str(\top) + ", "
s + Str(\Transparent) + ", "
s + Str(\Smooth) + ", "
s + Str(\Preload) + ", "
s + Str(\BoundingBox) + ", "
s + Str(\Precise) + ", "
s + Str(\Origin\x) + ", "
s + Str(\Origin\y) + ", "
s + Str(\SubimageCount) + ")"
Out(s)
Code: Select all
OpenWindow(#WindowId, \
GetXPosition(#WindowId), \
GetYPosition(#WindowId), \
GetW(#WindowId), \
GetH(#WindowId), \
"This is just a test-window doing nothing but hanging around...", \
#PB_Window_BorderLess | #PB_Window_Invisible | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered)
Code: Select all
id = #WindowId
x = GetXPosition(#WindowId)
y = GetYPosition(#WindowId)
w = GetW(#WindowId)
h = GetH(#WindowId)
title.s = "This is just a test-window doing nothing but hanging around..."
flags = #PB_Window_BorderLess | #PB_Window_Invisible | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered
OpenWindow(id, x, y, w, h, title, flags)