| 
    
     | 
       
        | Author |  |  
        | Neptuni Newbie
 
  
  
 Joined: August 29 2007
 Location: Sweden
 Online Status: Offline
 Posts: 7
 | 
          Hello,
           | Posted: August 31 2007 at 16:04 | IP Logged |   |  
           | 
 |  
 I would appriciate a little help, I can't get the following VB script to compile in Powerhome.
 What am I doing wrong...?
 
 It reports error 1025 on row 2, column 16
 
 Code:
 
 Option Explicit
 'Declare use of the DLL
 Private Declare Function Out8255 Lib "C:\WINDOWS\8255.dll" _
 (ByVal PortAddress As Integer, ByVal PortData As Integer) As Integer
 Private Declare Function In8255 Lib "8255.dll" _
 (ByVal PortAddress As Integer) As Integer
 
 'Declare variables
 Dim BaseAddress As Integer: ' 8255 Base Address
 Dim Dummy As Integer: ' Dummy variable used with DLL
 Dim PortA As Integer: ' 8255 Port A address
 Dim PortB As Integer: ' 8255 Port B address
 Dim PortC As Integer: ' 8255 Port C address
 Dim Cntrl As Integer: ' 8255 Control Address
 
 Private Sub main()
 
 
 ' Assign values for all addresses
 BaseAddress = 528
 PortA = BaseAddress
 PortB = BaseAddress + 1
 PortC = BaseAddress + 2
 Cntrl = BaseAddress + 3
 
 
 ' configure all ports for output
 Dummy = Out8255(Cntrl, 128)
 ' initialize all Ports to 0
 Dummy = Out8255(PortA, 0)
 Dummy = Out8255(PortB, 0)
 Dummy = Out8255(PortC, 0)
 
 End Sub
 
 
 Best Regards,
 
 Mikael
 |  
        | Back to Top |     |  
        |  |  
        | Neptuni Newbie
 
  
  
 Joined: August 29 2007
 Location: Sweden
 Online Status: Offline
 Posts: 7
 | 
          Ok, I have done some more research...
           | Posted: September 01 2007 at 18:42 | IP Logged |   |  
           | 
 |  
 It should be;
 dim Aport instead of;
 dim Aport as integer
 
 Is it correct that the use of a dll isn't supported in VBscript?
 
 And if thats true, are there any other way to make use of an dll in PowerHome?
 
 Best Regards,
 
 Mikael
 |  
        | Back to Top |     |  
        |  |  
        | dhoward Admin Group
 
  
  
 Joined: June 29 2001
 Location: United States
 Online Status: Offline
 Posts: 4447
 | 
          Mikael,
           | Posted: September 02 2007 at 20:18 | IP Logged |   |  
           | 
 |  
 I am not a VBScript expert, but that is my understanding as well that external DLL's are not supported.
 
 However, look into the new plugin SDK of PowerHome.  This will allow you to code in VB (or any language that supports activex creation) and include external DLL's in that plugin as well.
 
 You can find the documentation in the Help file (Help|Contents) as well as full sourcecode samples on the download page.
 
 HTH,
 
 Dave.
 
 |  
        | Back to Top |       |  
        |  |  |  |