Jump to content

VBScript to PHP Translation


ungajava

Recommended Posts

I hope someone can help me with this one. I have tried all sorts of different methods and I can't seem to get the syntax correct. The application is calling a program called ZP4, a database used for address scrubbing, using COM.

 

From their documentation:

ZP4IPCOM exposes a simple interface of four different calls: Input, Correct, Output, and Reset. "Input" is used to pass address input to ZP4... "Correct" is used to make ZP4 search the ZIP+4 database for the previously specified input address. "Output" retrieves a ZP4 output field.

 

The COM example they give in the documentation uses VB. The VB code executes as it should without problems but everything I try with PHP issues an error:

 

Here is the VB code straight from their documentation, which executes correctly.

 

Set zp4 = CreateObject("ZP4IPCom.ZP4Com")
zp4.input "Company", "xyz corp"
zp4.input "Address", "box 1920"
zp4.input "City", "rio del mar"
zp4.correct
MsgBox zp4.output("ZIP (final)")
Set zp4 = Nothing

 

Here is my attempt at the translation to PHP, which issues an error (Method not found for 3 of the 4 methods)

 

$zp4 = new COM('ZP4IPCom.ZP4Com');
$zp4->reset;
$zp4->input("Company", "xyz corp");
$zp4->input("Address", "box 1920");
$zp4->input("City", "rio del mar");
$zp4->correct;
$output = $zp4->output("ZIP (final)");
echo $output;
$zp4 = null;

 

It's strange because the output method is found, because the results will be displayed on the program's server log window, but the other 3 methods are not found (input, reset, and correct).

 

Any help with this would be greatly appreciated!

 

 

Link to comment
https://forums.phpfreaks.com/topic/222494-vbscript-to-php-translation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.