PureBytes Links
Trading Reference Links
|
You will get an error when ticker does NOT exist in the database.
In such case the stock5 will contain null handle
You should wite
if( stock5 ) FName5 = stock5.FullName;
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "Ken Close" <ken45140@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Sunday, June 10, 2007 6:35 PM
Subject: RE: [amibroker] Re: Extremely Sharp Eye Required to Find Error
> Greg:
>
> Thanks for taking a look and responding.
> What you suggested is exactly the syntax that produces the error with no
> apparent reason for it doing so.
> See the second part of the listing that shows the error.
>
> Ken
>
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
> Of tedd2pumpkin
> Sent: Sunday, June 10, 2007 11:41 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Extremely Sharp Eye Required to Find Error
>
> Hi Ken,
>
> Taking a guess here.
>
> Might be this line
>
> stock5 = ab.Stocks(Fn3);
>
> Maybe should be
>
> stock5 = ab.Stocks(Fn5);
>
> regards,
>
> Greg
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Ken Close" <ken45140@xxx> wrote:
>>
>> The following code does not produce an error:
>>
>> ab = CreateObject("Broker.Application");
>>
>>
>>
>> Fn3 = ParamStr( "Fund3", "WTM24");
>>
>> Fn4 = ParamStr( "Fund4", "FDRXX");
>>
>> Fn5 = ParamStr( "Fund5", "WTM25");
>>
>> stock3 = ab.Stocks(Fn3);
>>
>> stock4 = ab.Stocks(Fn4);
>>
>> stock5 = ab.Stocks(Fn3);
>>
>> FName3 = stock3.FullName;
>>
>> FName4 = stock4.FullName;
>>
>> FName5 = stock5.FullName;
>>
>>
>>
>> The following produces an error in the last shown line:
>>
>>
>>
>> ab = CreateObject("Broker.Application");
>>
>>
>>
>> Fn3 = ParamStr( "Fund3", "WTM24");
>>
>> Fn4 = ParamStr( "Fund4", "FDRXX");
>>
>> Fn5 = ParamStr( "Fund5", "WTM25");
>>
>> stock3 = ab.Stocks(Fn3);
>>
>> stock4 = ab.Stocks(Fn4);
>>
>> stock5 = ab.Stocks(Fn5);
>>
>> FName3 = stock3.FullName;
>>
>> FName4 = stock4.FullName;
>>
>> FName5 = stock5.FullName; <<<< Line with error
>>
>>
>>
>> Error Msg = COM object variable is not initialized or has invalid type
>> (valid COM object handle required)
>>
>>
>>
>> Look closely. The definition of stock5 changes subtley from the no
>> error state to the error state.
>>
>>
>>
>> I used copy/paste for the statements, then changed the variables. I
> cannot
>> get rid of the error message. Fn5 always has contained a valid
> statement
>> and a valid fund in the default position of the ParamStr statement.
>>
>>
>>
>> Any ideas?
>>
>>
>>
>> Ken
>>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to SUPPORT {at}
> amibroker.com
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> Yahoo! Groups Links
>
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> Yahoo! Groups Links
>
>
>
>
>
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|