PDA

View Full Version : Directory Assistance Genie


ABC123

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.

Enjoy

Louis

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",|
%dlg%,
{endregion};
%dlg%)
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

%code%)

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
sys_open(URL_var)
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
sys_open(URL_var)
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
sys_open(URL_var)
else if flag_map = .t.
URL_var="http://www.mapquest.com/directions/main.adp?go=1&do=nw&ct=NA&1y=US&1a="+Var->vc_start_street1+"&1p=&1c="+Var->vc_start_City+"&1s="+Var->vc_start_State+"&1z="+"&1ah=&2y=US&2a="+var->vc_goto_street+"=&2c="+var->vc_goto_city+"&2s="+var->vc_goto_state+"&2z="+"&2ah=&lr=2&x=61&y=14"
sys_open(Url_var)

end if
end if

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

Here is the url to the original post mentioned above.

http://msgboard.alphasoftware.com/alphaphorum/read.php3?num=11&id=19932&loc=0&offset=0&sortby=lastreply&direction=desc&thread=19932

Louis

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?

thanks,
mike

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

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

As requested the text file is attached.

Alan