my program runs fine from the IDE but when i create an exe i get error
warning fatal run time error
number:(1) at line:(1)
error caused by :if
lines 1-5 are remmed statements and the next line (6) is
#include "savebitmap"
confused?
and the version is ?
ah yes,sorry.
i have tried with 1.64 beta 0 16
and 1.64N3d2
Quotei have tried with 1.64 beta 0 16
it can't work with this, none the runtimes are supplied for it.. it sounds like your install now might have mismatched compiler->runtimes, which definitely won't work.
I doubt the issue with caused by the SaveBitmap include, since it only contain a single function. Really without the code to go through becomes a just guessing game..
I have tried re-installing the retail release and patched to latest update but no luck,can i send you the source so you can see what's going on kevin?
[plink]Email Support (http://www.underwaredesign.com/?l=Email-Support)[/plink]
sent.
Thanks
perhaps you should read your emails :)
Picking through the code, it doesn't seem to be as efficient as it could be.. So some general tips would be..
* Limit memory thrashing. A dynamic list is handy, but they contain allocation overhead in them. Requesting memory (allocation) from the system isn't free, nor is it a fixed time operation. So It'd be far more efficient to ween the code off them and roll your own heap. Particularly where there's no allocation/deallocation and no list size iteration.
* Commands like GetListSize() for example have to iterate through the list each call.. So using it a nesting loop say, gives us the dreaded N squared iteration count for the solution.
* Functions have greater overhead than PSUBS due to scope allocation. Not a big deal when we're calling a function a few hundred times, but call them ten of 1000's of times and there's significant amount of performance lost. So for 'operation/calculation' functions it's generally better to use PSUBS.
eg.
[pbcode]
Function getHyp(x,y)
local hyp,x1,y1
; path.DestinatioX
; path.DestinationY
; path.endy
x1=abs(x-path.startX)
y1=abs(y-path.StartY)
hyp=Sqrt((x1*x1)+(y1*y1))
;hyp=
endfunction hyp
[/pbcode]
could be simplified as,
[pbcode]
Psub getHyp(x,y)
local hyp,x1,y1
x1=(x-path.startX)
y1=(y-path.StartY)
hyp=Sqrt((x1*x1)+(y1*y1))
endPsub hyp
[/pbcode]
An inclined get distance is probably faster however, than manually calculating the length. It might be viable to avoid the square roots by using square distances, but I haven't really look at your implementation..
[pbcode]
setfps 60
ZoneX=400
ZoneY=300
ZoneSize=100
ZoneSizeSquared=ZoneSize*ZoneSize
Do
cls
mx=mousex()
my=mousey()
// Check if mouse is inside circle using getdistance
if GetDistance2D(mx,my,ZoneX,ZoneY)=<ZoneSize
print "Get Distance Inside Circle"
endif
// Check if it's inside the sqaured distance
dx=mx-zonex
dy=my-zoney
if ((Dx*Dx)+(Dy*DY))=<ZoneSizeSquared
print "Squared Distance Inside Circle"
endif
Circle ZoneX,ZoneY,ZoneSize,true
sync
loop
[/pbcode]
See Tutorial: A Crash Course In Optimization (http://www.underwaredesign.com/forums/index.php?topic=2548.0)
Thanks for the comments,the getHyp is redundant code at the mo,i shall get rid of the linked lists.
You can use the PixelRunLength to map the an image a bit like this,
Make Occupied Map From 2 Colour image (http://www.underwaredesign.com/forums/index.php?topic=4067.0)
cool.i will try that.
Thanks
Posted a second variant of the same idea, but this one uses maps completely..
i reinstalled 1.64 N and its creating runnable exe's now.
yeah, somewhere between N2 and N3 the runtime startup breaks from a compile time dependency, it's actually fixed in V1.64O already. Amos To PlayBASIC (http://www.underwaredesign.com/forums/index.php?topic=4024.msg27191#msg27191) is built in a younger version of it