Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Intro tp Powerhome Javascript/VB Script Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
hotcoffee76
Newbie
Newbie


Joined: December 04 2009
Location: Canada
Online Status: Offline
Posts: 12
Posted: August 29 2010 at 22:05 | IP Logged Quote hotcoffee76

Hi,

Is there a primer or introduction to using javascript or vb script to control Powerhome? Reading the guides and help I can find has left it unclear how to get started with this.

Thanks.
Back to Top View hotcoffee76's Profile Search for other posts by hotcoffee76
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: August 30 2010 at 11:50 | IP Logged Quote grif091

The following line in a Macro (Formula) will invoke the VB Script file below that. The VB Script file is a junk file I use to test things so do not look at it for any meaningful function.

ph_runscript_0(0, "c:\temp\avbscript1.vbs", "testfunction")


@language="vbscript"
Sub sub1()
     ph.usermessage("user message from vb script")
      
End Sub

Function testfunction()

     const ion = 17
     const ion10 = 10
     const ion7 = 7
     const ioff9 = 9
     ioff = 10
     stringPH = "text of message with VBS variable inline " & ioff & " remainder of message"

     ph.usermessage("test message from function " & ion + ioff9 & " more message")
     ph.usermessage("second message from function")
     ' rv=ph.insteon("ICON SWITCH TEST", int(ioff) + ioff9, 254)
     ph.usermessage(stringPH)

End Function



__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum