Source code of file oscpmwin_v0.1.2.189/modules.pas from the
osCommerce Product Manager for Windows.


0000:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001:   osCommerce Product Manager for Windows (oscpmwin).
0002:   0003:   
0004:   You can contact Mario A. Valdez-Ramirez
0005:   by email at mario@mariovaldez.org or paper mail at
0006:   Olmos 809, San Nicolas, NL. 66495, Mexico.
0007:   
0008:   This program is free software; you can redistribute it and/or modify
0009:   it under the terms of the GNU General Public License as published by
0010:   the Free Software Foundation; either version 2 of the License, or (at
0011:   your option) any later version.
0012:   
0013:   This program is distributed in the hope that it will be useful, but
0014:   WITHOUT ANY WARRANTY; without even the implied warranty of
0015:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0016:   General Public License for more details.
0017:   
0018:   You should have received a copy of the GNU General Public License
0019:   along with this program; if not, write to the Free Software
0020:   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0021:   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0022:   unit modules;
0023:   
0024:   interface
0025:   
0026:   USES
0027:     Classes, menus, IdTCPClient;
0028:   
0029:   CONST
0030:     opmC_Max_Modules_PerList = 50;
0031:     opmC_Def_ModPort = 27572;
0032:     opmC_Min_ModPort = 1;
0033:     opmC_Max_ModPort = 65535;
0034:     opmC_DirModules = 'modules';
0035:     opmC_Def_ModulesExt = 'ini';
0036:     opmC_RKModule = 'module';
0037:     opmC_ModQuitCommand = 'QUIT OSCPM1';
0038:     opmC_ModStatCommand = 'STATS OSCPM1';
0039:     opmC_TCPTimeout = 10000;
0040:     opmC_Localhost = '127.0.0.1';
0041:     opmC_ModOKCode = 'OK';
0042:     opmC_ModStatCode = 'STAT';
0043:     opmC_ModStatCodeEnd = 'STAT END';
0044:     opmC_ModNACode = 'NOT FOUND';
0045:     opmC_ModErrorCode = 'ERROR ERROR';
0046:     opmC_Max_ModNameWidth = 100;
0047:     opmC_Max_ModCMDWidth = 500;
0048:     opmC_ModStartupWait = 1000;
0049:     opmC_Max_Exchanges_PerList = 8192;
0050:     opmC_Def_LoadModExt = 'exe';
0051:     opmC_Def_LoadModFilename = '';
0052:     opmC_Def_LoadModFilter = '*.exe';
0053:     opmC_ModRet_Null = 0;
0054:     opmC_ModRet_Data = 1;
0055:     opmC_ModRet_Stat = 2;
0056:     opmC_SyncField_ProductID = 'products_id';
0057:     opmC_SyncField_ProductModel = 'products_model';
0058:     opmC_SyncField_ProductQuantity = 'products_quantity';
0059:     opmC_SyncField_ProductPrice = 'products_price';
0060:     opmC_SyncField_ProductImage = 'products_image';
0061:     opmC_SyncField_ProductWeight = 'products_weight';
0062:     opmC_SyncField_ProductStatus = 'products_status';
0063:     opmC_SyncField_ProductOrdered = 'products_ordered';
0064:     opmC_SyncResult_Any = 0;
0065:     opmC_SyncResult_Equal = 1;
0066:     opmC_SyncResult_Diff = 2;
0067:     opmC_SyncResult_Unknown = 3;
0068:     opmC_SyncResult_Error = 4;
0069:     opmC_SyncResult_Restricted = 5;
0070:   
0071:   
0072:   
0073:   TYPE
0074:     opmR_Module = RECORD
0075:                      Name : STRING;
0076:                      CommandFile : STRING;
0077:                      CommandPara : STRING;
0078:                      Port : LONGINT;
0079:                      Remote : LONGINT;
0080:                      IndexData : STRING;
0081:                      ResultData : STRING;
0082:                      JustRun : LONGINT;
0083:                      OnSelection : LONGINT;
0084:                    END;
0085:     opmT_ModuleList = ARRAY [0..opmC_Max_Modules_PerList] OF opmR_Module;
0086:     opmR_ExchangeData = RECORD
0087:                           IndexString : STRING;
0088:                           CurrentString : STRING;
0089:                           ResultString : STRING;
0090:                           Status : LONGINT;
0091:                         END;
0092:     opmT_ExchangeList = ARRAY [0..opmC_Max_Exchanges_PerList] OF opmR_ExchangeData;
0093:     opmT_MenuMethod = CLASS
0094:                         PROCEDURE opm_PRRunModuleMenu (Sender: TObject);
0095:                       END;
0096:   
0097:   
0098:   VAR
0099:     opm_TotalModules : LONGINT;
0100:     opm_CurrentModuleRecord : opmR_Module;
0101:     opmG_ModuleList : opmT_ModuleList;
0102:     opm_ModuleDirectory : STRING;
0103:     opmG_ModIndexData_BoxList : TStringList;
0104:     opmG_ModResultData_BoxList : TStringList;
0105:     opm_MenuClick : opmT_MenuMethod;
0106:     opm_TCPClientModule : TIdTCPClient;
0107:     opmG_ExchangeList : opmT_ExchangeList;
0108:     opmG_TotalExchangeItems : LONGINT;
0109:   
0110:   
0111:   FUNCTION opm_FNLoad_ModuleData (ModIniFile : STRING) : opmR_Module;
0112:   PROCEDURE opm_PRLoad_ModuleList;
0113:   FUNCTION opm_FNSave_ModuleData (CurModule : opmR_Module) : BOOLEAN;
0114:   PROCEDURE opm_PRDelete_ModuleData (ModIniFile : STRING);
0115:   FUNCTION opm_FNGetListIndexByString (ListString : STRING; VAR FieldList : TStringList) : LONGINT;
0116:   PROCEDURE opm_PRAddModules_ToMenu (ParentMenu : TMenuItem);
0117:   PROCEDURE opm_PRSetValidModules (ParentMenu : TMenuItem; SelCount : LONGINT);
0118:   PROCEDURE opm_PRExecModule (ModCommandFile, ModCommandParam : STRING);
0119:   FUNCTION opm_FNConnectMod (ModHost : STRING; ModPort : LONGINT) : BOOLEAN;
0120:   FUNCTION opm_FNQueryMod (Query : STRING; VAR Answer : STRING) : LONGINT;
0121:   FUNCTION opm_PRAskStatsMod : STRING;
0122:   PROCEDURE opm_PRDisconnectMod;
0123:   
0124:   
0125:   IMPLEMENTATION
0126:   
0127:   
0128:   USES gnugettext, regconfig, Windows, sysutils, forms, dataman, runmod, main, oscpmdata, Controls;
0129:   
0130:   
0131:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0132:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0133:   FUNCTION opm_FNLoad_ModuleData (ModIniFile : STRING) : opmR_Module;
0134:   VAR
0135:     CurModule : opmR_Module;
0136:   BEGIN
0137:     IF (ModIniFile <> '') THEN
0138:       BEGIN
0139:         CurModule.Name := COPY (ModIniFile, 1, LENGTH (ModIniFile) - LENGTH (ExtractFileExt (ModIniFile)));
0140:         CurModule.CommandFile := FNINI_ReadSetting ('OSCModCommandFile', '', opm_ModuleDirectory + ModIniFile, opmC_RKModule);
0141:         CurModule.CommandPara := FNINI_ReadSetting ('OSCModCommandPara', '', opm_ModuleDirectory + ModIniFile, opmC_RKModule);
0142:         CurModule.Port := FNopm_StrToInt (FNINI_ReadSetting ('OSCModPort', INTTOSTR (opmC_Def_ModPort), opm_ModuleDirectory + ModIniFile, opmC_RKModule));
0143:         CurModule.Remote := FNopm_StrToInt (FNINI_ReadSetting ('OSCModRemote', '0', opm_ModuleDirectory + ModIniFile, opmC_RKModule));
0144:         CurModule.IndexData := FNINI_ReadSetting ('OSCModIndex', '', opm_ModuleDirectory + ModIniFile, opmC_RKModule);
0145:         CurModule.ResultData := FNINI_ReadSetting ('OSCModResult', '', opm_ModuleDirectory + ModIniFile, opmC_RKModule);
0146:         CurModule.JustRun := FNopm_StrToInt (FNINI_ReadSetting ('OSCModJustRun', '0', opm_ModuleDirectory + ModIniFile, opmC_RKModule));
0147:         CurModule.OnSelection := FNopm_StrToInt (FNINI_ReadSetting ('OSCModOnSelection', '0', opm_ModuleDirectory + ModIniFile, opmC_RKModule));
0148:         IF ((CurModule.CommandFile = '') OR (CurModule.Port < opmC_Min_ModPort) OR
0149:             (CurModule.Port > opmC_Max_ModPort) OR
0150:             (CurModule.Name <> FNopm_CleanUploadName (CurModule.Name))) THEN CurModule.Name := '';
0151:       END
0152:     ELSE
0153:       BEGIN
0154:         CurModule.Name := '';
0155:         CurModule.CommandFile := '';
0156:         CurModule.CommandPara := '';
0157:         CurModule.Port := 0;
0158:         CurModule.Remote := 0;
0159:         CurModule.IndexData := '';
0160:         CurModule.ResultData := '';
0161:         CurModule.JustRun := 0;
0162:         CurModule.OnSelection := 0;
0163:       END;
0164:     opm_FNLoad_ModuleData := CurModule;
0165:   END;
0166:   
0167:   
0168:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0169:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0170:   FUNCTION opm_FNSave_ModuleData (CurModule : opmR_Module) : BOOLEAN;
0171:   VAR
0172:     NewModFile : STRING;
0173:   BEGIN
0174:     IF ((CurModule.CommandFile <> '') AND (CurModule.Port > opmC_Min_ModPort) AND
0175:         (CurModule.Port < opmC_Max_ModPort) AND
0176:         (CurModule.Name = FNopm_CleanUploadName (CurModule.Name))) THEN
0177:       BEGIN
0178:         NewModFile := opm_ModuleDirectory + CurModule.Name + '.' + opmC_Def_ModulesExt;
0179:         PRINI_WriteSetting ('OSCModCommandFile', CurModule.CommandFile, NewModFile, opmC_RKModule);
0180:         PRINI_WriteSetting ('OSCModCommandPara', CurModule.CommandPara, NewModFile, opmC_RKModule);
0181:         PRINI_WriteSetting ('OSCModPort', INTTOSTR (CurModule.Port), NewModFile, opmC_RKModule);
0182:         PRINI_WriteSetting ('OSCModRemote', INTTOSTR (CurModule.Remote), NewModFile, opmC_RKModule);
0183:         PRINI_WriteSetting ('OSCModIndex', CurModule.IndexData, NewModFile, opmC_RKModule);
0184:         PRINI_WriteSetting ('OSCModResult', CurModule.ResultData, NewModFile, opmC_RKModule);
0185:         PRINI_WriteSetting ('OSCModJustRun', INTTOSTR (CurModule.JustRun), NewModFile, opmC_RKModule);
0186:         PRINI_WriteSetting ('OSCModOnSelection', INTTOSTR (CurModule.OnSelection), NewModFile, opmC_RKModule);
0187:         opm_FNSave_ModuleData := TRUE;
0188:       END
0189:     ELSE opm_FNSave_ModuleData := FALSE;
0190:   END;
0191:   
0192:   
0193:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0194:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0195:   PROCEDURE opm_PRLoad_ModuleList;
0196:   VAR
0197:     DirRecord : TSearchRec;
0198:     ModCount, ModCount2, ModIndex : LONGINT;
0199:     opm_SwapModRecord : opmR_Module;
0200:   BEGIN
0201:     opm_TotalModules := 0;
0202:     IF (SysUtils.FINDFIRST (opm_ModuleDirectory + '*.' + opmC_Def_ModulesExt, faAnyFile, DirRecord) = 0) THEN
0203:       BEGIN
0204:         REPEAT
0205:           opm_CurrentModuleRecord := opm_FNLoad_ModuleData (DirRecord.Name);
0206:           IF (opm_CurrentModuleRecord.Name <> '') THEN
0207:             BEGIN
0208:               opmG_ModuleList[opm_TotalModules] := opm_CurrentModuleRecord;
0209:               INC (opm_TotalModules);
0210:             END;
0211:         UNTIL (SysUtils.FINDNEXT (DirRecord) <> 0);
0212:         SysUtils.FINDCLOSE (DirRecord);
0213:       END;
0214:     { Sort the list... }
0215:     FOR ModCount := 0 TO (opm_TotalModules - 1) DO
0216:       BEGIN
0217:         ModIndex := ModCount;
0218:         FOR ModCount2 := (ModCount + 1) TO (opm_TotalModules - 1) DO
0219:           IF (ANSIUPPERCASE (opmG_ModuleList[ModIndex].Name) > ANSIUPPERCASE (opmG_ModuleList[ModCount2].Name)) THEN ModIndex := ModCount2;
0220:         opm_SwapModRecord := opmG_ModuleList[ModIndex];
0221:         opmG_ModuleList[ModIndex] := opmG_ModuleList[ModCount];
0222:         opmG_ModuleList[ModCount] := opm_SwapModRecord;
0223:       END;
0224:   END;
0225:   
0226:   
0227:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0228:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0229:   PROCEDURE opm_PRDelete_ModuleData (ModIniFile : STRING);
0230:   BEGIN
0231:     SysUtils.DELETEFILE (opm_ModuleDirectory + ModIniFile);
0232:   END;
0233:   
0234:   
0235:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0236:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0237:   FUNCTION opm_FNGetListIndexByString (ListString : STRING; VAR FieldList : TStringList) : LONGINT;
0238:   VAR
0239:     ListCounter : LONGINT;
0240:   BEGIN
0241:     opm_FNGetListIndexByString := 0;
0242:     FOR ListCounter := 0 TO (FieldList.Count - 1) DO
0243:       IF (FieldList.Strings [ListCounter] = ListString) THEN
0244:         BEGIN
0245:           opm_FNGetListIndexByString := ListCounter;
0246:           BREAK;
0247:         END;
0248:   END;
0249:   
0250:   
0251:   
0252:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0253:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0254:   PROCEDURE opm_PRAddModules_ToMenu (ParentMenu : TMenuItem);
0255:   VAR
0256:     NewMenu : TMenuItem;
0257:     ModCounter : LONGINT;
0258:   BEGIN
0259:     IF (ParentMenu.Count > 0) THEN
0260:       REPEAT
0261:         NewMenu := ParentMenu.Items [0];
0262:         ParentMenu.Remove (NewMenu);
0263:       UNTIL (ParentMenu.Count = 0);
0264:     IF (opm_TotalModules > 0) THEN
0265:       FOR ModCounter := 0 TO (opm_TotalModules - 1) DO
0266:         BEGIN
0267:           NewMenu := TMenuItem.Create (ParentMenu);
0268:           NewMenu.Caption := STRINGREPLACE (opmG_ModuleList[ModCounter].Name, '_', ' ', [rfReplaceAll, rfIgnoreCase]);
0269:           NewMenu.Tag := ModCounter;
0270:           NewMenu.OnClick := opm_MenuClick.opm_PRRunModuleMenu;
0271:           ParentMenu.Add (NewMenu);
0272:         END;
0273:   END;
0274:   
0275:   
0276:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0277:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0278:   PROCEDURE opm_PRSetValidModules (ParentMenu : TMenuItem; SelCount : LONGINT);
0279:   VAR
0280:     ModCounter : LONGINT;
0281:   BEGIN
0282:     IF ((opm_TotalModules > 0) AND (ParentMenu.Count = opm_TotalModules)) THEN
0283:       FOR ModCounter := 0 TO (opm_TotalModules - 1) DO
0284:         BEGIN
0285:           IF (opmG_ModuleList[ModCounter].OnSelection > 0) THEN
0286:             IF (SelCount > 0) THEN ParentMenu.Items[ModCounter].Enabled := TRUE
0287:             ELSE ParentMenu.Items[ModCounter].Enabled := FALSE
0288:           ELSE ParentMenu.Items[ModCounter].Enabled := TRUE;
0289:         END;
0290:   END;
0291:   
0292:   
0293:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0294:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0295:   PROCEDURE opmT_MenuMethod.opm_PRRunModuleMenu (Sender: TObject);
0296:   BEGIN
0297:     opm_CurrentModuleRecord := opmG_ModuleList[(Sender AS TMenuItem).Tag];
0298:     IF (opm_CurrentModuleRecord.Remote > 0) THEN
0299:       BEGIN
0300:         IF (opm_Form_Runmod.ShowModal = mrAll) THEN
0301:           opm_Form_Main.PRopm_Reload_ProductList (opm_WeAreSearching);
0302:       END
0303:     ELSE
0304:       IF (opm_CurrentModuleRecord.JustRun > 0) THEN
0305:         BEGIN
0306:           opm_PRExecModule (opm_CurrentModuleRecord.CommandFile, opm_CurrentModuleRecord.CommandPara);
0307:         END
0308:       ELSE
0309:         BEGIN
0310:           opm_PRExecModule (opm_CurrentModuleRecord.CommandFile, opm_CurrentModuleRecord.CommandPara);
0311:           IF (opm_Form_Runmod.ShowModal = mrAll) THEN
0312:             opm_Form_Main.PRopm_Reload_ProductList (opm_WeAreSearching);
0313:         END;
0314:   END;
0315:   
0316:   
0317:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0318:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0319:   PROCEDURE opm_PRExecModule (ModCommandFile, ModCommandParam : STRING);
0320:   VAR
0321:     ExeDir : STRING;
0322:     StartupTime : DOUBLE;
0323:   BEGIN
0324:     ExeDir := opm_ModuleDirectory;
0325:     IF (FNopm_RunExternalApp (opm_ModuleDirectory + ModCommandFile, ModCommandParam, ExeDir, FALSE, TRUE, 0) > 0) THEN
0326:       BEGIN
0327:         StartupTime := GetTickCount;
0328:         REPEAT
0329:           Application.ProcessMessages;
0330:         UNTIL ((GetTickCount - StartupTime) > opmC_ModStartupWait);
0331:       END;
0332:   END;
0333:   
0334:   
0335:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0336:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0337:   FUNCTION opm_FNConnectMod (ModHost : STRING; ModPort : LONGINT) : BOOLEAN;
0338:   BEGIN
0339:     opm_TCPClientModule.Port := ModPort;
0340:     opm_TCPClientModule.Host := ModHost;
0341:     TRY
0342:       opm_TCPClientModule.Connect (opmC_TCPTimeout);
0343:       opm_FNConnectMod := TRUE;
0344:     EXCEPT
0345:       opm_FNConnectMod := FALSE;
0346:     END;
0347:   END;
0348:   
0349:   
0350:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0351:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0352:   FUNCTION opm_FNQueryMod (Query : STRING; VAR Answer : STRING) : LONGINT;
0353:   BEGIN
0354:     opm_FNQueryMod := opmC_ModRet_Null;
0355:     Answer := '';
0356:     TRY
0357:       IF (Query <> '') THEN opm_TCPClientModule.WriteLn (Query);
0358:       Answer := opm_TCPClientModule.ReadLn (#13#10, opmC_TCPTimeout, -1);
0359:     EXCEPT
0360:       Answer := '';
0361:       opm_FNQueryMod := opmC_ModRet_Null;
0362:     END;
0363:     IF (Answer <> '') THEN
0364:       BEGIN
0365:         IF (COPY (Answer, 1, LENGTH (opmC_ModOKCode)) = opmC_ModOKCode) THEN
0366:           BEGIN
0367:             Answer := COPY (Answer, (LENGTH (opmC_ModOKCode) + 2), LENGTH (Answer));
0368:             opm_FNQueryMod := opmC_ModRet_Data;
0369:           END
0370:         ELSE
0371:           BEGIN
0372:             IF (COPY (Answer, 1, LENGTH (opmC_ModStatCode)) = opmC_ModStatCode) THEN
0373:               BEGIN
0374:                 Answer := COPY (Answer, (LENGTH (opmC_ModStatCode) + 2), LENGTH (Answer));
0375:                 opm_FNQueryMod := opmC_ModRet_Stat;
0376:               END
0377:             ELSE
0378:               BEGIN
0379:                 Answer := '';
0380:                 opm_FNQueryMod := opmC_ModRet_Null;
0381:               END;
0382:           END;
0383:       END;
0384:     Application.ProcessMessages;
0385:   END;
0386:   
0387:   
0388:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0389:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0390:   FUNCTION opm_PRAskStatsMod : STRING;
0391:   VAR
0392:     Answer, FullAnswer : STRING;
0393:   BEGIN
0394:     Answer := '';
0395:     FullAnswer := '';
0396:     TRY
0397:       opm_TCPClientModule.WriteLn (opmC_ModStatCommand);
0398:       REPEAT
0399:         Answer := opm_TCPClientModule.ReadLn (#13#10, opmC_TCPTimeout, -1);
0400:         FullAnswer := FullAnswer + COPY (Answer, (LENGTH (opmC_ModStatCode) + 1), LENGTH (Answer)) + #13#10;
0401:       UNTIL ((Answer = '') OR (Answer = opmC_ModStatCodeEnd));
0402:     EXCEPT
0403:     END;
0404:     opm_PRAskStatsMod := FullAnswer;
0405:   END;
0406:   
0407:   
0408:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0409:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0410:   PROCEDURE opm_PRDisconnectMod;
0411:   BEGIN
0412:     TRY
0413:       opm_TCPClientModule.WriteLn (opmC_ModQuitCommand);
0414:       opm_TCPClientModule.Disconnect;
0415:     EXCEPT
0416:     END;
0417:   END;
0418:   
0419:   
0420:   INITIALIZATION
0421:     opm_TotalModules := 0;
0422:     opm_ModuleDirectory := ExtractFilePath (Application.Exename) + opmC_DirModules + '\';
0423:     opmG_ModIndexData_BoxList := TStringList.Create;
0424:     opmG_ModResultData_BoxList := TStringList.Create;
0425:     opmG_ModIndexData_BoxList.Add ('');
0426:     opmG_ModIndexData_BoxList.Add (opmC_SyncField_ProductID);
0427:     opmG_ModIndexData_BoxList.Add (opmC_SyncField_ProductModel);
0428:     opmG_ModResultData_BoxList.Add ('');
0429:     opmG_ModResultData_BoxList.Add (opmC_SyncField_ProductQuantity);
0430:     opmG_ModResultData_BoxList.Add (opmC_SyncField_ProductPrice);
0431:     opmG_ModResultData_BoxList.Add (opmC_SyncField_ProductImage);
0432:     opmG_ModResultData_BoxList.Add (opmC_SyncField_ProductWeight);
0433:     opmG_ModResultData_BoxList.Add (opmC_SyncField_ProductStatus);
0434:     opm_TCPClientModule := TIdTCPClient.Create (opm_TCPClientModule);
0435:   
0436:   
0437:   
0438:   FINALIZATION
0439:     opm_TCPClientModule.Free;
0440:     FreeAndNIL (opmG_ModIndexData_BoxList);
0441:     FreeAndNIL (opmG_ModResultData_BoxList);
0442:   
0443:   end.
 
 
NA fum/lmd: 2007.07.15
Copyright ©1994-2017 by Mario A. Valdez-Ramírez.
no siga este enlace / do not follow this link