Hi Jerry,
after extensively reading every article that I could get my hands on about the count function, these are some of the results that I came up with.
I ran across three articles that explained that originally the count was four the column and not so much the row, though it was supposed to be able to count rows.
At first there did not seem to be much of a use for it, but as time went on people began to experiment with it and found that it would be very handy.
But the problem was that the count function was not passing the information meeting: P1 was not giving the information to P2 therefore P3 was not delivering
the information to the temporary array, that is the dim that you set up for the temporary array.
From what I understood this was eventually corrected, but not until the latter time of SQL version 2 just before they came out with version 3.
The way they spoke about it was that because it was not passing the information on, meaning P1 give to P2 handing it to P3 the only results was the count of the first line.
That resulted in only being a numerical number one because it only counted the first line.
From what I understand, the true and the false as it was explained false meaning the function was not able to complete our there was no completion to the function null.
The true statement is a representation that the function is completed and there were no problems in the data has been handed too, and compiled in the temporary array, dim.
So I set up a small experiment to see if what they were saying was true in my results for all I ever got was a numerical number one leading me to believe that the SQL
that Hal is using is an older version before the bug was fixed, but only Robert would be able to tell us that for sure.
This is what my experiment looked like so you can do the experiment for yourself:
Rem Type=Plugin
Rem Name=Advanced Emotions
Rem Author=Gerald L. Blakley A.K.A OnTheCuttingEdge2005
Rem Host=All
'This sub setups the plug-ins option panel in Hal's options dialog
Sub OptionsPanel()
lblPlugin(0).Caption = "Advanced Emotions Plug-in, This Plug-in Gives HAL Emotions and other optional abilities."
lblPlugin(0).Move 120, 10, 3300, 1000
lblPlugin(0).WordWrap = True
lblPlugin(0).Visible = True
End Sub
Rem PLUGIN: PRE-PROCESS
If HalBrain.CheckTableExistence(Trim(UserName) & "_Anger") = False Then
'Create table for this person if it doesn't exist
HalBrain.CreateTable Trim(UserName) & "_Anger", "Sentence", ""
End If
Anger = 1
HalBrain.AddToTable Trim(UserName) & "_Anger", "Sentence", "" & Anger & "", ""
Dim EmotQuery()
If HalBrain.RunQuery("SELECT count(*) FROM " & Trim(UserName) & "_Anger", EmotQuery) = True Then
AngryCount = Ubound(EmotQuery)
else
AngryCount = "got to work on it more!"
End If
UltraHal = AngryCount
Exit Function
This may also explain to you some of the things that you may have been a misunderstanding about how information is collected and stored in a temporary array as well as how to retrieve it.
But from what I was understanding, you are basically collecting a numerical factor of one and adding it to an array and you wanted to count how many times you added the numerical one.
If this being the case there is a workaround that I have discovered that I believe that would work for you but you will have to cease using the sentence array format.
The array format best suited for this job is a searchstring, topic, array, basically you will have to put the word anger in the searchstring in the numerical value one in the topic.
Just like the experiment above each time when I typed in the word hello or high or something it would at the numerical value one to the array.
In the experiment below each time when I typed in high or something it would add the word anger in the numerical value one to the array.
The difference between the two was each time when I typed in hello or high or something the count would increase by one numerical value keeping count of how many times I added anger.
The lines that you'll need to change are as follows as well as making sure that the array has been constructed. okay I'm lazy I didn't feel like typing it all out.
Anger = "Anger"
Anger1 = 1
If HalBrain.RunQuery("SELECT searchString, topic FROM begoodtome WHERE strstr(' " & Replace(HalBrain.AlphaNumericalOnly(Anger), "'", "''") & " ', searchString) > 0", EmotQuery) = True then
AngryCount = Ubound(EmotQuery)
else
AngryCount = "got to work on it more!"
End If
UltraHal = AngryCount
Exit Function
If you feel that you need further information about this go into the main brain and look up strikingSimiles I believe that there would be further useful information there for you.
But all in all, I truly hope that Rob has a solution for this dilemma, because I too wanted to be able to count how many rows that are in the array for my own use which is why
I spent countless hours studying to try to find a solution but as you can see I came up with squat. LOL.
Just a little insight, I did read a small article that talked about using the count, the count the # row number but I was unsuccessful in getting it to work they used "No.Id"
in their example, but that does not exist in ultra Hals array, ultra Hals array consist of #, recoredId, array table type, data array table type, and so on.
Jerry I was truly hoping to come up with some good news but if by the information that I have presented here helps you in your endeavor in some small way, I will feel good
knowing that all my hard work and time spent looking up in reading for all those hours was not for nothing.
Sincerely, it's time to go back to my little world and continue working on the free will plug-in.
C load.
PS. If you find a solution to the count please let me know, thank you and good luck!