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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.