PureBytes Links
Trading Reference Links
|
are you absolutely positive that these 2 statements were in the original and
that they didn't give you an error?
cs = AB.Stocks(Sym) ;
cs.FullName = SymName ; <<<<<<<<<<<<<<< Error in
this statement ***
the problem is that cs is a variable that contains the ticker taken from the
object AB.Stocks(sym).
Then you try to use cs as an object in cs.FullName and it isn't.
Hard to believe that it worked. Did the original pass the syntax checker?
d
_____
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of Ken Close
Sent: Monday, August 14, 2006 9:27 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] COM Object Statement Works One Place but Not another
This is really puzzling. I successfully have used the following
CompositeLoad procedure (from Dan Clark). It runs and creates great ATCs/
Tonight, I copied this portion from one working code file to a new one, and
then got an error for a statement that works in the original file. How can
that be?
Code Snippit:
Filter=1;
AB = CreateStaticObject("Broker.Application");
//Procedure to add to Composite values
procedure CompositeLoad(Sym, SymName, CloseVal, OpenVal, HighVal, LowVal,
VolVal,
OpenIntVal, ATCFlags, TargetWLNbr)
{
//Add To Composite
AddToComposite(CloseVal, Sym, "C", ATCFlags);
AddToComposite(OpenVal, Sym, "O", ATCFlags);
AddToComposite(HighVal, Sym, "H", ATCFlags);
AddToComposite(LowVal, Sym, "L", ATCFlags);
AddToComposite(VolVal, Sym, "V", ATCFlags);
AddToComposite(OpenIntVal, Sym, "I", ATCFlags);
//Modify Names
cs = AB.Stocks(Sym) ;
cs.FullName = SymName ; <<<<<<<<<<<<<<< Error in
this statement ***
// Add to Watchlists
if (TargetWLNbr != 0)
CategoryAddSymbol(Sym, categoryWatchlist, TargetWLNbr);
}
*** Error 18: COM object variable not initiated or has invalid type.
Since I copied the lines from one working file into a new one, how can this
line get an error?
What step am I missing?
Can someone explain what this line and the one above it are doing?
Right now I can not get it to produce an ATC when I comment out the
cs.FullName line.
Thanks for any help,
Ken
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.10.10/418 - Release Date: 8/14/2006
|