Zabaware Support Forums
Zabaware Forums => Ultra Hal 7.0 => Topic started by: Psych on July 24, 2003, 12:53:55 pm
-
Hello All
When writing VBScript in Hal's Brain how do I direct hal to look in a subfolder of WorkingDir. For example, what term do I use instead of WorkingDir to get hal to look in a subfolder of WorkingDir called 'PeopleData'.
Thanks - Psych
-
'Hi Psych.
'Here's an example of one way it could be done for sub-directory.
If InStr(1, UserSentence, "Heart", vbTextCompare) = 0 And (InStr(1, UserSentence, "Lungs", vbTextCompare) > 0 And (InStr(1, UserSentence, "Cancer", vbTextCompare) > 0 Or InStr(1, UserSentence, "Disease", vbTextCompare) > 0)) Or (InStr(1, UserSentence, "Medicine", vbTextCompare) > 0 And InStr(1, UserSentence, "Thearpy", vbTextCompare) > 0) Then
GetResponse = GetResponse & HalBrain.ChooseSentenceFromFile(WorkingDir & "<a href="file:///C|/C:Program Files/ZabawareUltra Hal Assistant 4/HALSUB/MedicalUser_Strings.brn"></a>")
End If
'Best of wishes and new discoveries.
'Jerry.
-
Thanks Jerry - but although this works, it will not meet my needs.
The problem is that I transport hal across several machines using a Memory-Stick.For various reasons, the various computers I use would give hal a different address
(eg. "<a href="file:///C|/C:Program Files/ZabawareUltra Hal Assistant 4/HALSUB/MedicalUser_Strings.brn"></a>")
Consequently I need code that is based on the WorkingDir. For example, code which tells hal to look in "MedicalUser_Strings.brn" which is located in the folder "medical" which is contained in "WorkingDir".
As you can see, in this manner there is no need to refer to a specific c: location.
Any ideas Jerry?
Thanks - Phil