dupa

Author Topic: Sub Directories  (Read 3095 times)

Psych

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Sub Directories
« 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
ITS NOT WHAT YOU THINK THAT MAKES YOU HUMAN --- ITS WHAT YOU THINK ABOUT WHAT YOU THINK!

onthecuttingedge2005

  • Guest
Sub Directories
« Reply #1 on: August 04, 2003, 10:52:06 pm »
'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.
« Last Edit: August 04, 2003, 10:55:23 pm by onthecuttingedge2005 »

Psych

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Sub Directories
« Reply #2 on: August 06, 2003, 03:29:53 am »
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!