Mega Code Archive

 
Categories / Delphi / Examples
 

Porting infopower 4 to delphi 5

Jeff Overcash (TeamB), overcash@onramp.net, explains how to port InfoPower 4 to Delphi 5: Open ip40_d4.dpk and answer yes to the upgrade question. View source and change the package ip40_d4 to ip40_d5 on the first line and change the description to Delphi 5 on line 25. Open up the options for the package and add to the search path the source directory. Optionally you can make the Unit output path set to the lib directory. Also Optional is to remove the DCP directory and allow it to goto the default Projects\bpl directory. Next do a file save as ip40_d5.dpk (note these four steps will be done for each of the packages). Open the wwlfDef.pas file. At the end add {$IFDEF VER130} {$define wwDelphi3Up} {$define wwDelphi4Up} {$define wwDelphi5Up} {$ENDIF} File wwQuery.pas line 372 insert before the {$ifdef wwDelphi4Up} {$ifdef wwDelphi5Up} if Datatype=ftBCD then begin if BCDToCurr(TBcd(Pointer(FFilterFieldBuffer)^), tempValue) then FFilterParam.AsBCD := tempValue else FFilterParam.AsBCD := 0; end else {$else} and add an {$endif} after the wwDelphi4Up stuff (line 390). Note I think this is correct. I don't use BCD datatypes so this could be incorrect since it is not tested. If it needs modifying I'll post that later. File wwQbe.pas line 586 insert before the {$ifdef wwDelphi4Up} {$ifdef wwDelphi5Up} if Datatype=ftBCD then begin if BCDToCurr(TBcd(Pointer(FFilterFieldBuffer)^), tempValue) then FFilterParam.AsBCD := tempValue else FFilterParam.AsBCD := 0; end else {$else} and add an {$endif} after the wwDelphi4Up stuff (line 604). (same warning as before) Note I think this is correct. I don't use BCD datatypes so this could be incorrect since it is not tested. If it needs modifying I'll post that later. File wwStorep.pas line 313 insert before the {$ifdef wwDelphi4Up} {$ifdef wwDelphi5Up} if Datatype=ftBCD then begin if BCDToCurr(TBcd(Pointer(FFilterFieldBuffer)^), tempValue) then FFilterParam.AsBCD := tempValue else FFilterParam.AsBCD := 0; end else {$else} and add an {$endif} after the wwDelphi4Up stuff (line 331). (same warning as before) Note I think this is correct. I don't use BCD datatypes so this could be incorrect since it is not tested. If it needs modifying I'll post that later. File wwTable.pas line 1176 insert before the {$ifdef wwDelphi4Up} {$ifdef wwDelphi5Up} if Datatype=ftBCD then begin if BCDToCurr(TBcd(Pointer(FFilterFieldBuffer)^), tempValue) then FFilterParam.AsBCD := tempValue else FFilterParam.AsBCD := 0; end else {$else} and add an {$endif} after the wwDelphi4Up stuff (line 1194). (same warning as before) Note I think this is correct. I don't use BCD datatypes so this could be incorrect since it is not tested. If it needs modifying I'll post that later. File wwDBNavigator line 536 change var Selections: TComponentList; to var Selections: {$ifdef wwDelphi5Up} TDesignerSelectionList {$else} TComponentList {$endif}; line 540 change var CompList: TComponentList; to var CompList: {$ifdef wwDelphi5Up} TDesignerSelectionList {$else} TComponentList {$endif}; line 543 CompList := TComponentList.Create; to CompList := {$ifdef wwDelphi5Up} TDesignerSelectionList.Create {$else} TComponentList.Create {$endif}; line 561 var NewSelections: TComponentList; to var NewSelections: {$ifdef wwDelphi5Up} TDesignerSelectionList {$else} TComponentList {$endif}; line 564 NewSelections := TComponentList.Create; to NewSelections := {$ifdef wwDelphi5Up} TDesignerSelectionList.Create {$else} TComponentList.Create {$endif}; line 608 Selections := TComponentList.Create; to Selections := {$ifdef wwDelphi5Up} TDesignerSelectionList.Create {$else} TComponentList.Create {$endif}; Now just compile the package. You will get a couple of out of range warnings, but they can be ignored. Next open ip40d_d4.dpk and answer yes to the upgrade question. View source and change the package ip40d_d4 to ip40d_d5 on the first line and change the description to Delphi 5 on line 25. Change the requires to be ip40_d5 on line 30. Open up the options for the package and add to the search path the source directory. Optionally you can make the Unit output path set to the lib directory. Also Optional is to remove the DCP directory and allow it to goto the default Projects\bpl directory. Next do a file save as ip40d_d5.dpk changes File wwCollectionEditor.pas line 185 Selections: TComponentList; to Selections: {$ifdef wwDelphi5Up} TDesignerSelectionList {$else} TComponentList {$endif}; line 195 Selections := TComponentList.Create; to Selections := {$ifdef wwDelphi5Up} TDesignerSelectionList.Create {$else} TComponentList.Create {$endif}; line 308 var Selections: Tcomponentlist; to var Selections: {$ifdef wwDelphi5Up} TDesignerSelectionList {$else} TComponentList {$endif}; line 314 Selections := TComponentList.Create; to Selections := {$ifdef wwDelphi5Up} TDesignerSelectionList.Create {$else} TComponentList.Create {$endif}; line 324 var Selections: TComponentList; to var Selections: {$ifdef wwDelphi5Up} TDesignerSelectionList {$else} TComponentList {$endif}; line 336 Selections := TComponentList.Create; to Selections := {$ifdef wwDelphi5Up} TDesignerSelectionList.Create {$else} TComponentList.Create {$endif}; File wwDBNavEdit line 122 var Selections: TComponentList; to var Selections: {$ifdef wwDelphi5Up} TDesignerSelectionList {$else} TComponentList {$endif}; line 130 Selections := TComponentList.Create; to Selections := {$ifdef wwDelphi5Up} TDesignerSelectionList.Create {$else} TComponentList.Create {$endif}; Compile and install the package. The following is for Enterprise owners. Next open ip40client.dpk and answer yes to the upgrade question. View source and change the package ip40client to ip40client_d5 on the first line and change the description to Delphi 5 on line 25. Change the requires to be ip40_d5 on line 29. Open up the options for the package and add to the search path the source directory. Optionally you can make the Unit output path set to the lib directory. Also Optional is to remove the DCP directory and allow it to goto the default Projects\bpl directory. Next do a file save as ip40client_d5.dpk File wwProvider.pas remove BdeProv from line 16 of the uses clause. File wwClient line 187 sqlString:= provider.DataRequest(VarArrayOf(['w2wGetFieldInfo'])); to sqlString:= AppServer.AS_DataRequest(ProviderName,VarArrayOf(['w2wGetFieldInfo'])); Compile and install.