[info] Name=Maximizer Enterprise Vendor=CardScan, Inc. Version=Version 1.0 MajorVersion=1 MinorVersion=0 ExeFile=MAXWIN.EXE [Send] Execute(MAXWIN, CurrentRecord, "[RefreshOtherWindows(False)]") Execute(,,"[ExecuteUpdate(False)]") Execute(,,"[InitAndCreateRecord(IndividualRecord,%{last_name\,59},)]",1) Poke(,,First_Name, %{first_name\,39},1) Poke(,,Position, %{title\,59},1) Poke(,,Company/Organization, %{company\,59},1) Poke(,,Address_Line_1, %{address_line_1\,39},1) Poke(,,Address_Line_2, %{address_line_2\,39},1) Poke(,,City, %{city\,39},1) Poke(,,State_/_Province, %{state\,39},1) Poke(,,Zip_/_Postal_Code, %{zip\,19},1) Poke(,,Phone_1, %{phone\,21},1) Poke(,,Phone_2, %{fax\,21},1) Poke(,,Phone_3, %{phone_1\,21},1) Poke(,,Phone_4, %{phone_2\,21},1) Poke(,,*Web_Page, %email_1,1) Poke(,,*E-mail_Address, %email,1) Poke(,,InsertNote, %notes,1) Execute(,,"[ExecuteUpdate(True)]",1) Execute(,,"[RefreshOtherWindows(True)]",1) [GetSelectInfo] Request(MAXWIN,CurrentRecord,First_Name,%first_name) Request(,,Last_Name,%last_name) Request(,,Company/Organization,%company) ; 4.0 script ------------------------------------------------------------------- [FindFirst] Call(InitializeError) ; standard error handling Call(Activate_Address_Window) Call(Find_Contact) Call(Wait_If_Busy) If(IsNull(%_total), Call(GetFindCount),) Execute(MAXWIN,CurrentRecord,"[ScrollList(Top)]") If(IsEqual(%_total, 0), ,Call(GetContactInfo)) [FindNext] Execute(MaxWin,CurrentRecord, "[ScrollList(LineDown)]") Call(GetContactInfo) [NewCard] Call(ClearError) ; Initialize error is already called in FindFirst Execute(MAXWIN, CurrentRecord, "[RefreshOtherWindows(False)]") Execute(,,"[ExecuteUpdate(False)]") If(IsNull(%last_name), Call(Create_Individual_By_Company), Call(Create_Individual_By_LastName)) [Update] if(IsEqual(%_error, %_Success), Call(Update_Info), ) [Update_Info] Poke(MAXWIN,CurrentRecord,First_Name, %{first_name\,39},1) Poke(,,Last_Name, %{last_name\,59},1) Poke(,,Mr/Ms, %{Name_Prefix\,39},1) Poke(,,Position, %{title\,59},1) Poke(,,Company/Organization, %{company\,59},1) Poke(,,Address_Line_1, %{address_line_1\,39},1) Poke(,,Address_Line_2, %{address_line_2\,39},1) Poke(,,City, %{city\,39},1) Poke(,,State_/_Province, %{state\,39},1) Poke(,,Zip_/_Postal_Code, %{zip\,19},1) Poke(,,Country, %{Country\,39},1) Poke(,,Phone_1, %{phone\,21},1) Poke(,,Phone_2, %{fax\,21},1) Poke(,,Phone_3, %{phone_1\,21},1) Poke(,,Phone_4, %{phone_2\,21},1) Poke(,,*Web_Page, %web_page,1) Poke(,,*E-mail_Address, %email,1) Poke(,,InsertNote, %notes,1) Execute(,,"[ExecuteUpdate(True)]",1) Execute(,,"[RefreshOtherWindows(True)]",1) [Finish] Execute(MAXWIN, CurrentRecord, "[ListAll(ClientsContacts)]") ; ------------- private procedures ------------------- [Activate_Address_Window] Execute(MAXWIN,System,"[ActivateWindow(Client)]") [Wait_If_Busy] Sleep(10) Request(MAXWIN,System,"BusyIndicator",%busy) If(IsEqual(%busy,"READY"), , Call(Wait_If_Busy)) [Find_Contact] If(IsNull(%last_name), Call(No_LastName), Execute(MAXWIN, CurrentRecord, "[SearchBy(LastName,%last_name,2,1,0)]")) [No_LastName] If(IsNull(%company), Call(No_Company), Execute(MAXWIN, CurrentRecord, "[SearchBy(CompanyName,%company,2,0,1,0)]")) [No_Company] If(IsNull(%first_name), Set(_total,0), Execute(MAXWIN, CurrentRecord, "[SearchBy(FirstName,%first_name,2,1,0]")) [GetFindCount] Request(MAXWIN,CurrentRecord,"GetListCount",%_total,1) Request(,,"CurrentRecordError",%MaxWinError) If(IsEqual(%MaxWinError, "0 successful"), , Set(%_error, %_UnknownError)) [GetContactInfo] Request(MAXWIN,CurrentRecord,First_Name, %First_Name) Request(,,Last_Name,%Last_Name) Request(,,Company,%company) Set(First Name, %First_Name) ; just a work around Set(Last Name, %Last_Name) ; just a work around [Create_Individual_By_LastName] Execute(MAXWIN,CurrentRecord,"[InitAndCreateRecord(IndividualRecord,%{last_name\,59},)]",1) [Create_Individual_By_Company] if(IsNull(%company), Set(_error, %_UnknownError), Execute(MAXWIN,CurrentRecord,"[InitAndCreateRecord(IndividualRecord,%{company\,59},)]",1) [End_Lookup] Execute(MAXWIN, CurrentRecord, "[ListAll(ClientsContacts)]") ; **************** standard error handling routines ********** ; Error flag values: ; 0 - Success ; -1 - Unknown Error ; InitializeError initializes error codes and resets the error ; flag status. [InitializeError] Set(_success, 0) Set(_UnknownError, -1) Call(ClearError) ; clears/resets the error flag [ClearError] Set(_error, %_success)