View Full Version : Directory Assistance Genie


Louis Nickerson
01-31-2003, 02:16 AM
Here is the most recent incarnation of the "Directory Assistance Genie".

To see the original post of this script and the subsequent Version 5 forum dialog and enhancement of the Genie, copy and paste the following url into your browser.

If you want the "State" field of the Genie to function as a Record List Edit Combo Box, which is how it was intended to work, include the table (tbl_states) that is attached to this thread in your database.

Doing this will accomplish two things.

1. Make the script easier to use since the user will no longer have to type out the whole name of the state.

2. Prevent the user from typing a state abbreviation which can cause the search to fail.

Finally,thanks to all who have offered enhancements and compliments.



Code Follows

'Date Created: 16-Dec-2002 05:48:10 PM
'Last Updated: 30-Jan-2003 09:44:27 AM
'Created By : Louis H. Nickerson
'Updated By :
Dim mode as C
dim vc_411_business_name as c
mode = "Search YellowPages.com"
flag_business = .t.
flag_residential = .f.
flag_reverse = .f.
flag_map = .f.
result=ui_dlg_box("Directory Assistance Genie",|
end if
end if
if a_dlg_button = "vc_area_code_change" then
a_dlg_button = ""
if len(vc_area_code) = 3
ui_dlg_ctl_goto("Directory Assistance Genie","vc_npa")
end if
end if
if a_dlg_button = "vc_npa_change" then
a_dlg_button = ""
if len(vc_npa) = 3
ui_dlg_ctl_goto("Directory Assistance Genie","vc_xxxx")

end if
end if


if result = "Search" then
if flag_business = .t.
URL_var = "http://www.yellowpages.com/asp/search/SearchResult.asp?page=home&searchtips=&moresearchoptions=&searchform=homesearch&typeorname=name&search="+Var->vc_411_business_name+"&city="+Var->vc_411_city+"&state="+var->vc_411_state
else if flag_residential = .t.
URL_var = "http://www.whitepages.com/resi_qry_results.pl?fid=n&fk=b&f="+Var->vc_411_first_name+"&lk=eq&l="+Var->vc_411_last_name+"&c="+Var->vc_411_city+"&s="+Var->vc_411_state
else if flag_reverse = .t.
URL_var = "http://www.whitepages.com/resi_qry_results.pl?fid=p&ac="+Var->vc_area_code+"&p="+Var->vc_NPA+"-"+Var->vc_XXXX
else if flag_map = .t.

end if
end if

Louis Nickerson
01-31-2003, 02:19 AM

Here is the url to the original post mentioned above.



Alan Lucas
08-30-2006, 02:24 PM
Update August 2006

Yellowpages.com has apparently changed their website.

Change the line in your code that reads...

URL_var = "http://www.yellowpages.com/asp/search/SearchResult.asp?page=home&searchtips=&moresearchoptions=&searchform=homesearch&typeorname=name&search="+Var->vc_411_business_name+"&city="+Var->vc_411_city+"&state="+var->vc_411_state

To this...

URL_Var = "http://www.yellowpages.com/sp/yellowpages/ypresults.jsp?t=0&v=2&s=1&q="+Var->vc_411_business_name+"&ci="+Var->vc_411_city+"&st="+var->vc_411_state

Mike Reed
08-30-2006, 05:11 PM
I get and error when I copy this and try to run it.

Script contained errors.
Error at line: 14,column: 1

Error:Expected value

Is it possible to post this as an attachment in a text file?


Alan Lucas
08-31-2006, 04:58 PM

I run this new script, without any problems, off a button on a form.

As requested the text file is attached.