Zabaware Support Forums

Sub Directories

Started by Psych, July 24, 2003, 12:53:55 PM

Previous topic - Next topic

Psych

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
ITS NOT WHAT YOU THINK THAT MAKES YOU HUMAN --- ITS WHAT YOU THINK ABOUT WHAT YOU THINK!

onthecuttingedge2005

#1
'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.

Psych

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
ITS NOT WHAT YOU THINK THAT MAKES YOU HUMAN --- ITS WHAT YOU THINK ABOUT WHAT YOU THINK!