Sunday 15 June 2014

vb.net - InfEng.RunQuery(Query).Count -


I ask the conclusion engine as the following question, and want to get the first fact for the first question (in the question If any result results, then 2 atom in question).

strSnswer = IIf (InfEng.RunQuery (question). Account> 0, InfEng.RunQuery (question) (0) (0) .ostring, "no answer")

This throws an error

 Exception Description: System.ArgumentOutOfRangeException: The index was out of bounds. The size of the collection should be non-negative and less. Parameter Name: Index " When Query Count = 0. In the 'Watch' window, it evaluates 0, and the message is: Error & no child, when I open the evaluated statement .  When the query returns the facts, it works without any interruption.  

I replaced the . Any code, instead of calculating, but that was not working .

When I changed it to a standard - then-end if , all this Works in S ... and with ./code> & . Anyone

What am I doing wrong?

I am not a VB.NET specialist, but the fact InfEng.RunQuery (question) Dual form in the IIf statement that the query will be executed twice if . Gt> gt> 0 . You do not want to do this, that is, any good By running a query twice for the reason.

My suggestion is You Assign InfEng.RunQuery (Q) Use this var is a variable IIf qualify statement.

No comments:

Post a Comment