They program is constantly communicating every few miliseconds, but I thought I'd try to destroy the object and then redeclare it at an interval, such as every 1000 uses.
However, I can't seem to get the syntax to work. Set serialce.port.1 = nothing Set objport = nothing Set "serialce.port.1" = nothing Set "objport" = nothing All cause the error popup statement "illegal assignment". --- In [email protected], "Tim Markoski" <tmarko...@...> wrote: > > Again, Keep in mind that VBScript is the engine for NSBasic. > Therefor it depends totally on VBScript for memory management. > ALL variables are variants and by definition allocate the maximum > stack space per declaration. > > With any ActiveX Control being used in a Scripting environment, memory > issues can arise. > > I'm not talking about destroying the object during the loop. > I mean that you should explicitly destroy it when you are done. > > A Global declaration for an Object should be avoided wherever possible. > You should try creating the object locally as part of the sub that > actually writes the output. > > At the end of the output, destroy the object. > > > > > --- In [email protected], "stewartmayer" <stew@> wrote: > > > > Thank you for the suggestion. In my program I add the serial port > > control only once at the beginning: > > > > AddObject "serialce.port.1","objPort" > > AddObject "serialce.license","objlicense" > > objLicense.LicenseKey = "xxxxxxxxxxxx" > > > > and then essentially run: > > > > objport.write string > > > > In a timed loop, so I don't think I need to destroy it. > > > > However, my programming knowledge has been gained only through my > > trials and errors and I haven't yet encountered the need to destroy > > objects so perhaps i'm not understanding correctly. > > > > Thanks! > > Stewart > > > > > > > > > > > > --- In [email protected], "Tim Markoski" <tmarkoski@> wrote: > > > > > > Make sure you are explicitly destroying all objects > > > > > > ex. > > > Set objport = Nothing > > > > > > Don't ever depend on vbscript to do this automatically. > > > vbscript is the engine for NSBasic. > > > The first thing vbscript does before any operation is allocate stack > > > space. > > > > > > > > > > > > --- In [email protected], "stewartmayer" <stew@> wrote: > > > > > > > > I'm using the franson serial tools included with NSB and I've > noticed > > > > that every time I send data using objport.write there is a small > > > > memory leak. After about 100,000 writes it adds up and I get an > "out > > > > of memory" error and the pocket pc freezes requiring a hard reset. > > > > With my program constantly communicating this takes about an hour to > > > > happen. > > > > > > > > This is a pretty major problem right now. Anyone have any > experience > > > > with this issue? > > > > > > > > Happy Holidays :) > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nsb-ce" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nsb-ce?hl=en -~----------~----~----~----~------~----~------~--~---
