[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] COM Object Statement Works One Place but Not another



PureBytes Links

Trading Reference Links

Even when it is a COM object or associated with a COM object??
 
It does not appear to be an AFL statement, but maybe it is.
 
The curious part of my overall question is that I just copied code from
another code window in which it was working fine.  It did not have
Fullname() in the other window and worked there.
 
Anyway, thanks for replying.
 
Ken

  _____  

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of Terry
Sent: Monday, August 14, 2006 10:48 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] COM Object Statement Works One Place but Not
another



Without reading your code FullName requires () 

 

FullName() = SymName;

 

--

Terry

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of Ken Close
Sent: Monday, August 14, 2006 19:27
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