Zabaware Support Forums
Zabaware Forums => Programming using the Ultra Hal Brain Editor => Topic started by: prichard on June 13, 2007, 05:10:28 pm
-
Simple VB experiment:
Dim chALBRAIN As New brain
Private Sub Command1_Click()
Set chALBRAIN = New brain
Text1 = chALBRAIN.ChooseSentenceFromFile("paraphrase")
End Sub
Doesn't work.
What is the problem? Is it the literal underline of the "paraphrase" filename? Or is initialization necessary...
-
It works!
I used a textbox and the dLL returned the line with vbCRLF so it wiped the text.
Also the path was insufficient. When I put the dLL in the VB98 project folder the path was at VB98 folder. I appnded the path to access the hAL brainfiles properly.
SpyDaz Class file is extremely helpful.
Moving forward to creating the script functions in VB.
I'm more intrigued by what hAL can do with background process capabillity.
Will be trying to figure out how to analyze some Encarta texts. Emulating the Brain Editor textfile leaning functions will have high priority.
I have an HTML parser.
-
-
-
Download Attachment: 2007615185158_hALdemo.zip (http://"http://www.zabaware.com/forum/uploaded/prichard/2007615185158_hALdemo.zip")
This simple file demonstrates the DLL use from VB.
-
-
When creating the VB PRoject ADD a REFERENCE to Ultrahalassist.dll
not add Component...
Option explicit
Public UhBrain as NEW Brain
Private Sub Command1_Click()
'Remember that the brain you are using Should be UHAL5
'If you are ussing uhal6 then your HALBRAIN.db should be in the same folder where the project is compiled. in vb the halbrain.db may also need to be in the defalt project directory for on the fly testing....
Text1 = UhBrain.ChooseSentenceFromFile("paraphrase") 'hal6
End Sub
I have found that using the hal5 dll works the best as the hal.db file is not easy to Browse. where as the hal5 dll works fine with textfiles .... And you can use ADO, in VB so you can customize you db more better in MSACESS, Which also uses SQL to search the DB for data{QUERY}...