Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need professional help

Status
Not open for further replies.

Bertv100

Programmer
Apr 27, 2000
204
BE
Hi, I've got some source code in VB I would like to translate to Delphi 4 (Object Pascal). I would be glad if someone could help me out.<br>I've got the same source for Turbo Pascal, Visual Basic 3.0 & 4.0, C and QBasic.<br>You'll think: he's got it in Turbo Pascal, why not use it in Delphi directly. Well I tried but it makes use or TPs PORT array, which doesn't exist in Delphi.<br><br>Here's one of the most important procedures. If you really want to help me, I could send you one of the units.<br>Mind that I've never programmed in this language before, so there could be some missing things.<br>The unit uses inpout.dll.<br><br><FONT FACE=monospace><br>Sub ReadIOchip (ChipNo%)<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim Datavar%, StartChannel%, Temp%, Datvar$, Channel%<br>&nbsp;&nbsp;&nbsp;&nbsp;I2Cstart<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Datavar% = IOChipCode%(ChipNo%) Or 1<br>&nbsp;&nbsp;&nbsp;&nbsp;I2COutput Datavar%<br><br>&nbsp;&nbsp;&nbsp;&nbsp;I2Cclockpulse<br><br>&nbsp;&nbsp;&nbsp;&nbsp;IOdata%(ChipNo%) = I2CInput()<br>&nbsp;&nbsp;&nbsp;&nbsp;IOdata%(ChipNo%) = BINNOT(IOdata%(ChipNo%))<br>&nbsp;&nbsp;&nbsp;&nbsp;I2Cclockpulse<br><br>&nbsp;&nbsp;&nbsp;&nbsp;I2CStop<br><br>&nbsp;&nbsp;&nbsp;&nbsp;StartChannel% = ChipNo% * 8 + 1<br>&nbsp;&nbsp;&nbsp;&nbsp;Temp% = IOdata%(ChipNo%)<br>&nbsp;&nbsp;&nbsp;&nbsp;Datvar$ = DecToBin(Temp%)<br>&nbsp;&nbsp;&nbsp;&nbsp;For Channel% = 0 To 7<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If Mid$(Datvar$, 8 - Channel%, 1) = &quot;1&quot; Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IO%(StartChannel% + Channel%) = 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IO%(StartChannel% + Channel%) = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;Next<br>End Sub<br></font><br><br>Thanks in advance, <p>Bert Vingerhoets<br><a href=mailto:vingerhoetsbert@hotmail.com>vingerhoetsbert@hotmail.com</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top