Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Help with VB script Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Neptuni
Newbie
Newbie
Avatar

Joined: August 29 2007
Location: Sweden
Online Status: Offline
Posts: 7
Posted: August 31 2007 at 16:04 | IP Logged Quote Neptuni

Hello,

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 View Neptuni's Profile Search for other posts by Neptuni
 
Neptuni
Newbie
Newbie
Avatar

Joined: August 29 2007
Location: Sweden
Online Status: Offline
Posts: 7
Posted: September 01 2007 at 18:42 | IP Logged Quote Neptuni

Ok, I have done some more research...

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 View Neptuni's Profile Search for other posts by Neptuni
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: September 02 2007 at 20:18 | IP Logged Quote dhoward

Mikael,

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 

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