dupa

Author Topic: SDK or Functon Listings ?  (Read 3123 times)

hockeystud

  • Newbie
  • *
  • Posts: 2
    • View Profile
SDK or Functon Listings ?
« on: July 03, 2002, 02:24:24 pm »
Can anyone tell me if there is a Software Developer's Kit for the HalBrain and/or a definition file for the functions ?

Don Ferguson

  • Sr. Member
  • ****
  • Posts: 303
    • View Profile
    • http://www.cortrapar.com
SDK or Functon Listings ?
« Reply #1 on: July 28, 2002, 05:29:10 pm »
Hello,

Hal's brains are written in VBS, Visual Basic Scripting.  An excellent reference book on VBS is as follows:

VBScript in a Nutshell
By Matt Childs, Paul Lomax, & Ron Petrusha
Published by O'Reilly, Copyright 2000

The book cover is white with red and black lettering, and has a picture of a terrier dog on it.  It is soft-cover, $24.95 retail.  All the major book stores have it.  

Starting on page 181, the book lists every possible function, what it's used for, and how it works.

VBS is a very intuitive, human-readable language.  If you're already a programmer, or if you already understand if-then statements, variables, functions, and arguments, you'll pick it up immediately.  If you're a novice, you will still learn it, but you'll have to study a bit harder.

VBS is a great language for Hal, because it does everything needed, and the coding reads very logically.  For instance, you don't have to declare variables in advance, like in some languages.  

For those of you reading this who are even slightly interested, I want to encourage you to learn more about this and try it!  

Take a look at this code:

     Friendname = "Harvey"

That one line of code creates a variable (a memory-bank) called Friendname, and makes it equal to the alphanumeric string "Harvey."  

Now consider this code:

     If Friendname = "Harvey" Then
       Friendcomment = "That's a great name!"
     End If

That code tested to see whether Friendname was still equal to Harvey, and if it tested as TRUE, it ran the second line of code, creating a variable (a memory-bank)called Friendcomment, and made it equal to "That's a great name!"

And finally, take a look at this:

   ReplyBack = Friendname & " , wow, " & Friendcomment

That one line of code creates yet another variable, called ReplyBack, and makes it equal to the contents of Friendname, followed by some punctuation and the word wow, and the contents of Friendcomment, so Replyback becomes "Harvey, wow, that's a great name!"

VBS gives you unlimited numbers of variables (they can contain letters or numbers and you can name your variables anything that you want), the ability to detect any words or phrases, the ability to substitute words for any other words, the ability to perform math functions and generate random numbers, and the ability to test for TRUE and FALSE for any conditions you set up... and more and more!  But best of all, the code stays fairly human-readable, once you get familiar with it.

With the book I recommended above, you should be able to read and understand all of Enhanced Brain 216 and any other brain for Hal.

You can read and edit any HalBrain.uhp file using MS Word (always make a safety-backup file copy first, and put it in a different folder for safe-keeping).  I recommend shutting off every spell-checking and autocorrect feature, and turning "on" the display of paragraph marks so that you can see the line breaks.  As I've mentioned in other postings, Word keeps wanting to put the ".txt" file extension on your file instead of the ".uhp" file extension, but there are ways around that.

Also, Robert Medeksza created a VBS editor that came with Hal 4.0, and it's quite an accomplishment!  The editor automatically color-codes if-then statements, text, and certain functions, so it's much easier to read.

I am happy to hear of the interest in VBS programming and functions!  Please let me know how it goes!

Sincerely,

Don










Don Ferguson
traininginc@cortrapar.com
www.cortrapar.com
Don Ferguson
E-mail: fergusonrkfd@prodigy.net
Website: www.cortrapar.com
Don's other forum posts: http://www.zabaware.com/forum/search.asp?mode=DoIt&MEMBER_ID=274