$$345678901234567890123456789012345678901234567890123456789012345678901234567890 $$ 1 2 3 4 5 6 7 8 $$ $$ Rename_Expressions.grs To rename a group of expressions (as a clean up). $$ Manipulating part expressions may be risky! $$ $$ To sort the expressions list a command line inter- $$ face (CLI) tool is used, called 'NatSort.exe'. $$ $$ Installation: $$ ------------- $$ 1. Check if the below defined paths are ok for your UG installation. $$ 2. Compile this GRIP source code. $$ 3. Copy the compiled GRIP program to the adequate UG directory. $$ 4. Copy the CLI program 'NatSort.exe' to a (system) directory. $$ $$ Note: $$ ----- $$ . The 'external' program 'NatSort.exe' is used, because UG-GRIP doesn't sup- $$ port this sort algorithm and an export of the expressions list is not sor- $$ ted. $$ For details to this program type in the shell 'NatSort.txt -h'. $$ . This program is tested with UG-18 and UG-NX3 on Windows XP. $$ . Each label has as first character a 'L' (for Label), this for code high- $$ lighting with my editor. $$ $$ History: $$ -------- $$ V1.00 / Pyramid Solutions / 21.01.05 First public release. Works with a ma- $$ cro. $$ V1.01 / Pyramid Solutions / 27.02.05 Some minor improvements, easy to adapt $$ for UNIX systems. $$ V2.00 / Pyramid Solutions / 27.02.05 Works with an external tool to have $$ access to system functions out of $$ GRIP. Much faster than V1.01! $$ V2.01 / Pyramid Solutions / 22.03.05 Corrected a minor bug - a variable had $$ a wrong value that a file without ex- $$ pressions couldn't be detected. $$ V3.00 / Pyramid Solutions / 22.08.06 Changed the use of an external macro $$ tool to an external CLI program to $$ perform the sortation. This is much $$ faster and much easier to install. $$ Then, for NX, it's necessary to remove $$ the units form the expressions list. $$ $$ COPYRIGHT by Pyramid Solutions, Switzerland. $$ You may use and modify this code for free. But it's not allowed to make any $$ profit with this code. For commercial use you have to get a permission from $$ the author, Pyramid Solutions. E-mail address: info@pyrasol.ch $$ It's not allowed to give this e-mail address to other people (no spam!). $$ $$ $$ $$ $$ ***************************** $$ * Declaration of variables: * $$ ***************************** $$ $$ Index: o = object variable $$ n = numerical variable $$ s = string variable $$ $$ The listed variables are sorted alphabetically $$ GRIPSW/DECLRV $$ $$ NUMBER/nChar,nCounter NUMBER/nDigits NUMBER/nEnd,nExisting NUMBER/nFound NUMBER/nI,nInput(3) NUMBER/nJump1,nJump2 NUMBER/nLang,nLength,nLines NUMBER/nOldResp NUMBER/nPos,nPrevCounter NUMBER/nResp,nRetData,nRetValue NUMBER/nStart,nSwitch,nSystemUsed $$ STRING/sArgs(132) STRING/sFileExp(11),sFileImp(11),sFileWrk(11) STRING/sInfo(40),sInput(2,40) STRING/sLang(16),sLine(132),sLoCase(1) STRING/sMenuTxt(4,40),sMsg1(60),sMsg2(60) STRING/sName(132) STRING/sPath(7),sPathExp(19),sPathImp(19),sPathWrk(19),sPrevName(132) STRING/sPrompt(3,15) STRING/sRetData(1) STRING/sTool(20),sTxt1(132),sTxt2(132) STRING/sUpCase(1) $$ $$ $$ $$ **************************** $$ * Definition of constants: * $$ **************************** $$ sPath='C:\Temp' $$ Path definitions! sFileWrk='WrkFile.exp' $$ Have a look at the variable declaration! sFileImp='ImpFile.txt' $$ Adjust the length if you edit the path or the file sFileExp='ExpFile.txt' $$ names! $$ sPathWrk=sPath+'\'+sFileWrk sPathImp=sPath+'\'+sFileImp sPathExp=sPath+'\'+sFileExp $$ sTool='C:\Shell\NatSort.exe' $$ Path definition! Check the same as above! sArgs=sPath $$ $$ $$ $$ ******************************** $$ * Initialization of variables: * $$ ******************************** $$ $$ None... $$ $$ $$ $$ ************ $$ * Program: * $$ ************ $$ $$ Prepare $$ ======= $$ If there is no active part $$ -------------------------- IF/&ACTPRT==1,JUMP/LEND: $$ $$ $$ Check the language setting for the user interaction $$ (Supported in this program: ENGLISH, GERMAN) $$ --------------------------------------------------- sLang=&LANG $$ Change the whole string to upper case characters. nLength=LENF(sLang) DO/LEDo1P:,nI,1,nLength,1 nChar=ASCII(sLang,nI) IFTHEN/nChar>=97 AND nChar<=122 sLoCase=CHRSTR(nChar) nChar=nChar-32 sUpCase=CHRSTR(nChar) sLang=REPSTR(sLang,sLoCase,sUpCase,nI) ENDIF LEDo1P: $$ $$ Set a control value to switch to the current language. IFTHEN/sLang=='GERMAN' nLang=1 ELSE nLang=0 ENDIF $$ $$ Close a possible open information window. EJECT/WINDOW $$ $$ $$ $$ Main $$ ==== $$ Export all expressions to a text file $$ ------------------------------------- LRet1M: $$ $$ For the creation of a file there mustn't be a file with the same name. $$ Therefore a delete operation is needed, first. FDEL/sPathWrk,IFERR,LCnt1M: $$ The jump to a label is needed to prevent a GRIP LCnt1M: $$ error message, if the file doesen't exists. FDEL/sPathImp,IFERR,LCnt2M: LCnt2M: FDEL/sPathExp,IFERR,LCnt3M: LCnt3M: $$ $$ Export all expressions to the text file 'sPathWrk' ('.exp' will be added by $$ the system, therefore a removal of this is needed here). EXPEXP/SUBSTR(sPathWrk,1,LENF(sPathWrk)-4),IFERR,LErr1M: $$ $$ $$ Remove all unwanted stuff from the expressions list $$ --------------------------------------------------- $$ A sample line of an expression list: [mm]p123=100/4 $$ $$ Open a 1st scratch file with the contents of the file 'sPathWrk' and $$ set the line pointer to the first line. FETCH/TXT,1,sPathWrk,IFERR,LErr2M: RESET/1 $$ $$ Create a 2nd scratch file #2 to buffer the data. CREATE/TXT,2,IFERR,LErr3M: $$ $$ Create a 3rd scratch file 'sPathImp' to save the data. CREATE/TXT,3,sPathImp,IFERR,LErr4M: $$ $$ Read all lines until the '=' sign to remove the values (e.g. =100/4). $$ For that, set the delimiter to '=' instead of ',' (default value). DELIM/'=' $$ nLines=0 $$ LBeg1M: $$ Read a line from file #1 until the delimiter. READ/1,IFEND,LEnd1M:,sLine $$ Write the line back to file #2. WRITE/2,sLine nLines=nLines+1 JUMP/LBeg1M: LEnd1M: $$ $$ Close the scratch file #1. FTERM/TXT,1 $$ $$ If the line counter is '0', then there is an empty expressions file. IF/nLines==0,JUMP/LErr5M: $$ $$ Remove the (ev. existing) units from all lines (e.g. [mm]). RESET/2 $$ Reset the line pointer of the buffer file #2. nLines=0 $$ LBeg2M: $$ Read a line from file #2. READ/2,IFEND,LEnd2M:,sLine nPos=FNDSTR(sLine,']',1) nLength=LENF(sLine) sLine=SUBSTR(sLine,nPos+1,nLength-nPos) $$ Write the line back to file #3. WRITE/3,sLine nLines=nLines+1 JUMP/LBeg2M: LEnd2M: $$ $$ Write the file #3 and close the scratch files #2 and #3. FILE/TXT,3,IFERR,LErr6M: FTERM/TXT,2 FTERM/TXT,3 $$ $$ $$ Sort the file $$ ------------- XSPAWN/PROG,sTool,sArgs,RESULT,sRetData,IFERR,LErr7M: nRetData=VALF(sRetData) $$ Return value may be 0, 1 or 2. JUMP/LErr8M:,LErr9M:,nRetData $$ $$ Open a 4th scratch file with the contents of the file 'sPathExp'. FETCH/TXT,4,sPathExp,IFERR,LErrAM: $$ $$ $$ Ask the user for what to do $$ --------------------------- $$ Initialize the information window (to not have the system created stuff $$ at the top of the listing). PRINT/'Initializing...' EJECT/WINDOW $$ LRet2M: $$ $$ First, display a list of all expressions with gaps between the counters. $$ Set the line pointer to the first line of file #4. RESET/4 $$ $$ Set the start values. sPrevName=' ' nPrevCounter=-1 $$ LBeg3M: $$ Read a line. READ/4,IFEND,LEnd3M:,sLine nLength=LENF(sLine) nDigits=0 $$ Get the last character(s) of the string. DO/LEDo3M:,nI,1,nLength,1 nPos=nLength-nI+1 nChar=ASCII(sLine,nPos) IFTHEN/nChar>=48 AND nChar<=57 $$ Found a counter. nDigits=nI ELSE $$ Found no counter. IFTHEN/nDigits==0 $$ Didn't found a group. PRINT/sLine ELSE sName=SUBSTR(sLine,1,nLength-nDigits) nCounter=VALF(SUBSTR(sLine,nLength-nDigits+1,nDigits)) IFTHEN/sPrevName==sName $$ Found a group. LBeg4M: IFTHEN/nPrevCounter==nCounter-1 PRINT/sLine ELSE $$ Found a gap. PRINT/'-' nPrevCounter=nPrevCounter+1 JUMP/LBeg4M: ENDIF ELSE $$ Didn't found a group, but an expression counter. PRINT/sLine ENDIF sPrevName=sName nPrevCounter=nCounter ENDIF JUMP/LBeg3M: $$ Exit DO- loop. ENDIF LEDo3M: JUMP/LBeg3M: LEnd3M: $$ LRet3M: nSwitch=0 $$ $$ Create the main menu to select the functions or a help text. IFTHEN/nLang==1 sInfo='Bitte erst die lesen!' sMenuTxt(1)='Umbenennen' sMenuTxt(2)='Umnummerieren' sMenuTxt(4)='Programm- Info' ELSE sInfo='Please read the first!' sMenuTxt(1)='Rename' sMenuTxt(2)='Renumber' sMenuTxt(4)='Program Info' ENDIF sMenuTxt(3)='-' CHOOSE/sInfo,sMenuTxt,DEFLT,nOldResp,nResp nOldResp=nResp-4 $$ 1=Back / 2=Cancel / 3= / 4= / 5=Option 1 / 6=Option 2 etc. JUMP/LCln1S:,LCln1S:,,,LNxt1M:,LNxt2M:,,LNxt3M:,nResp $$ $$ $$ Rename expressions $$ ------------------ LNxt1M: $$ $$ Create a string input field to enter the current name. IFTHEN/nLang==1 sInfo='Gegenwärtiger Name?' ELSE sInfo='Current Name?' ENDIF sInput(1)='p' $$ Default value. TEXT/sInfo,sInput(1),nResp,DEFLT $$ 1=Back / 2=Cancel / 3=OK - no text entered / 4= Alternate action / $$ 5=OK - text entered JUMP/LRet3M:,LRet3M:,LCnt4M:,LNxt1M:,LCnt4M:,nResp $$ LCnt4M: IF/nSwitch==1,JUMP/LCnt6M: $$ $$ Create a string input field to enter the new name. IFTHEN/nLang==1 sInfo='Neuer Name?' ELSE sInfo='New Name?' ENDIF TEXT/sInfo,sInput(2),nResp $$ 1=Back / 2=Cancel / 3=OK - no text entered / 4= Alternate action / $$ 5=OK - text entered JUMP/LNxt1M:,LRet3M:,LCnt4M:,LCnt4M:,LCnt5M:,nResp $$ LCnt5M: EJECT/WINDOW $$ $$ Set the line pointer to the first line of file #4. RESET/4 $$ $$ Set the start values. nFound=0 sPrevName=' ' nPrevCounter=-1 $$ LBeg5M: $$ Read a line. READ/4,IFEND,LEnd5M:,sLine nLength=LENF(sLine) nDigits=0 $$ Get the last character(s) of the string. DO/LEDo5M:,nI,1,nLength,1 nPos=nLength-nI+1 nChar=ASCII(sLine,nPos) IFTHEN/nChar>=48 AND nChar<=57 $$ Found a counter. nDigits=nI ELSE $$ Found no counter. IFTHEN/nDigits==0 $$ Didn't found a group. IFTHEN/sLine==sInput(1) nJump1=1 JUMP/LSub1M: LRet4M: ENDIF ELSE sName=SUBSTR(sLine,1,nLength-nDigits) nCounter=VALF(SUBSTR(sLine,nLength-nDigits+1,nDigits)) IFTHEN/sPrevName==sName $$ Found a group. LBeg6M: IFTHEN/nPrevCounter==nCounter-1 IFTHEN/SUBSTR(sLine,1,nLength-nDigits)==sInput(1) nJump1=2 JUMP/LSub1M: LRet5M: ENDIF ELSE $$ Found a gap. nPrevCounter=nPrevCounter+1 JUMP/LBeg6M: ENDIF ELSE $$ Didn't found a group, but an expression counter. IFTHEN/SUBSTR(sLine,1,nLength-nDigits)==sInput(1) nJump1=3 JUMP/LSub1M: LRet6M: ENDIF ENDIF sPrevName=sName nPrevCounter=nCounter ENDIF JUMP/LBeg5M: $$ Exit DO- loop. ENDIF LEDo5M: JUMP/LBeg5M: LEnd5M: $$ IFTHEN/nFound==1 IFTHEN/nLang==1 sMsg1='Fertig - prüfe die Liste' ELSE sMsg1='Finished - check the list' ENDIF MESSG/sMsg1 $$ $$ Close the scratch file. FTERM/TXT,2 $$ EJECT/WINDOW $$ JUMP/LRet1M: $$ Get a new expressions list. ELSE IFTHEN/nLang==1 sMsg1='Nichts gefunden' ELSE sMsg1='Nothing found' ENDIF MESSG/sMsg1 JUMP/LRet2M: $$ Get the current expressions list. ENDIF $$ $$ $$ Renumber expressions $$ -------------------- LNxt2M: $$ nSwitch=1 JUMP/LNxt1M: LCnt6M: nSwitch=0 $$ $$ Create a integer input menu to enter the renumbering data. IFTHEN/nLang==1 sInfo='Zählerwerte?' sPrompt(1)='Start gegenw.' sPrompt(2)='Ende gegenw.' sPrompt(3)='Start neu' ELSE sInfo='Counter Values?' sPrompt(1)='Start current' sPrompt(2)='End current' sPrompt(3)='Start new' ENDIF PARAM/sInfo,$ sPrompt(1),INT,nInput(1),$ sPrompt(2),INT,nInput(2),$ sPrompt(3),INT,nInput(3),nResp $$ 1=Back / 2=Cancel / 3=OK / 4= Alternate action JUMP/LNxt2M:,LRet3M:,LCnt7M:,nResp $$ LCnt7M: IFTHEN/nInput(2)3 IFTHEN/nExisting==0 $$ No start counter and no end counter found. IFTHEN/nLang==1 sMsg1='Keinen Startzähler und keinen Endzähler gefunden (Name?)' ELSE sMsg1='No start counter and no end counter found (name?)' ENDIF ELSEIF/nExisting==1 $$ Start counter found, only. IFTHEN/nLang==1 sMsg1='Nur Startzähler gefunden' ELSE sMsg1='Start counter found, only' ENDIF ELSEIF/nExisting==2 $$ End counter found, only. IFTHEN/nLang==1 sMsg1='Nur Endzähler gefunden' ELSE sMsg1='End counter found, only' ENDIF ENDIF MESSG/sMsg1 JUMP/LNxt2M: ENDIF $$ EJECT/WINDOW $$ $$ Set the start values. nLines=0 nSystemUsed=0 $$ LBeg8M: $$ Read a line. READ/4,IFEND,LEnd8M:,sLine nLines=nLines+1 IF/nLinesnEnd,JUMP/LBeg8M: LCnt8M: IFTHEN/sLine==sInput(1)+ISTR(nInput(1)) $$ Found a name and a counter. IFTHEN/nLang==1 sTxt1='Gegenw. Name / Zähler gefunden: <'+sInput(1)$ +ISTR(nInput(1))+'>' sTxt2='Neuer Name / Zähler: <'+sInput(1)$ +ISTR(nInput(3))+'>' ELSE sTxt1='Current Name / Counter found: <'+sInput(1)+ISTR(nInput(1))+'>' sTxt2='New Name / Counter: <'+sInput(1)+ISTR(nInput(3))+'>' ENDIF PRINT/sTxt1 nJump2=2 IFTHEN/nInput(1)<>nInput(3) EXPRNM/sInput(1)+ISTR(nInput(1)),TO,sInput(1)+ISTR(nInput(3)),$ IFERR,LErrBM: ENDIF PRINT/sTxt2 LRet7M: IFTHEN/nSystemUsed==1 $$ System used, do not read the next line. nInput(3)=nInput(3)+1 nSystemUsed=0 JUMP/LCnt8M: ENDIF nInput(1)=nInput(1)+1 nInput(3)=nInput(3)+1 ELSE $$ Found a gap, do not read the next line. nInput(1)=nInput(1)+1 JUMP/LCnt8M: ENDIF IFTHEN/sLine==sInput(1)+ISTR(nInput(2)) JUMP/LEnd8M: $$ End counter found, exit READ loop. ENDIF JUMP/LBeg8M: LEnd8M: $$ IFTHEN/nLang==1 sMsg1='Fertig - prüfe die Liste' ELSE sMsg1='Finished - check the list' ENDIF MESSG/sMsg1 $$ $$ Close the scratch file. FTERM/TXT,2 $$ EJECT/WINDOW $$ JUMP/LRet1M: $$ Get a new expressions list. $$ $$ $$ Display help text $$ ----------------- LNxt3M: $$ IFTHEN/nLang==1 PRINT/'' PRINT/'-------------------------------------------------------' PRINT/'Rename Expressions V3.00 / 22.08.06 / Pyramid Solutions' PRINT/'-------------------------------------------------------' PRINT/'' PRINT/'Mit diesem Programm können Sie Gruppen von Ausdrücken umbenennen oder' PRINT/'umnummerieren. Eine Umnummerierung kann zum Aufräumen oder Umgruppie-' PRINT/'ren von Ausdrücken hilfreich sein.' PRINT/'Es könnte interessant sein, die obige Liste vor und nach einer Ände-' PRINT/'rung zu speichern. Somit könnten Sie die Unterschiede vergleichen.' PRINT/'Benützen Sie dafür !' PRINT/'' PRINT/'Wichtig: Manipulieren von Bauteil- Ausdrücken kann riskant sein!' PRINT/' Sichern Sie Ihre Datei immer, bevor Sie dieses Programm aus-' PRINT/' führen!' PRINT/' Achten Sie beim Umnummerieren darauf, dass der Nummernbe-' PRINT/' reich der neuen Zähler frei ist!' PRINT/' Es können verborgene Ausdrücke vorhanden sein, die uner-' PRINT/' reichbar sind, z.B. vom Formelement !' PRINT/' Die Zeichen <[> und <]> werden für die Einheiten verwendet' PRINT/' und sind deshalb für Namen nicht erlaubt!' PRINT/'' PRINT/'Normalerweise benötigt eine Umnummerierung zwei Schritte, z.B.:' PRINT/'Parameter p0 ... p57 mit Lücken dazwischen' PRINT/'1. Schritt: Name = p' PRINT/' Zähler Start gegenw. = 0' PRINT/' Zähler Ende gegenw. = 57' PRINT/' Zähler Start neu = 100' PRINT/'2. Schritt: Name = p' PRINT/' Zähler Start gegenw. = 100' PRINT/' Zähler Ende gegenw. = 145' PRINT/' Zähler Start neu = 0' PRINT/'' PRINT/'Namenskonventionen: Die Ausdrücke sind in zwei Teile aufgeteilt, ei-' PRINT/' nen Namen und einen Zähler.' PRINT/'' PRINT/'Gültige Ausdrücke: . Fräser-Durchmesser (nur Name)' PRINT/' . Steigung-1 (Name und Zähler)' PRINT/' . Dia01, Dia02 (Name und Zähler als Gruppe)' PRINT/'Ungültige Ausdrücke: . 001 (nur Zähler, von UG nicht unterstützt)' PRINT/' . Linie01Oben (eingebetteter Zähler ignoriert)' PRINT/'' PRINT/'' ELSE PRINT/'' PRINT/'-------------------------------------------------------' PRINT/'Rename Expressions V3.00 / 22.08.06 / Pyramid Solutions' PRINT/'-------------------------------------------------------' PRINT/'' PRINT/'With this program you can rename or renumber a group of expressions.' PRINT/'A renumbering could be useful for clean- up or for regrouping of ex-' PRINT/'pressions.' PRINT/'It could be interesting to save the above listing before and after' PRINT/'a change. Thus you can compare the differences.' PRINT/'For that, use !' PRINT/'' PRINT/'Important: Manipulating part expressions may be risky!' PRINT/' Backup your file always before you run this program!' PRINT/' At renumbering, see that the number range of the new' PRINT/' counters is free!' PRINT/' There may be hidden expressions which are unreachable,' PRINT/' e.g. from the feature !' PRINT/' The characters <[> and <]> are used for the units and' PRINT/' therefore they are not allowed for names!' PRINT/'' PRINT/'Normally, a renumbering needs two steps, e.g.:' PRINT/'Parameters p0 ... p57 with gaps between' PRINT/'1st step: Name = p' PRINT/' Counter start current = 0' PRINT/' Counter end current = 57' PRINT/' Counter start new = 100' PRINT/'2nd step: Name = p' PRINT/' Counter start current = 100' PRINT/' Counter end current = 145' PRINT/' Counter start new = 0' PRINT/'' PRINT/'Naming conventions: The expressions are divided into two parts,' PRINT/' a name and a counter.' PRINT/'' PRINT/'Valid expressions: . Cutter-Diameter (name only)' PRINT/' . Pitch-1 (name and counter)' PRINT/' . Dia01, Dia02 (name and counter as a group)' PRINT/'Invalid expressions: . 001 (counter only, not supported by UG)' PRINT/' . Line01Top (embedded counter ignored)' PRINT/'' PRINT/'' ENDIF JUMP/LRet3M: $$ $$ $$ $$ **************** $$ * Sub modules: * $$ **************** $$ $$ Rename expressions - name found $$ =============================== LSub1M: IFTHEN/nJump1==1 IFTHEN/nLang==1 sTxt1='Gegenw. Name gefunden: <'+sInput(1)+'>' sTxt2='Neuer Name: <'+sInput(2)+'>' ELSE sTxt1='Current Name found: <'+sInput(1)+'>' sTxt2='New Name: <'+sInput(2)+'>' ENDIF PRINT/sTxt1 EXPRNM/sInput(1),TO,sInput(2),IFERR,LErr1S: ELSE IFTHEN/nLang==1 sTxt1='Gegenw. Name gefunden: <'+sInput(1)+ISTR(nCounter)+'>' sTxt2='Neuer Name: <'+sInput(2)+ISTR(nCounter)+'>' ELSE sTxt1='Current Name found: <'+sInput(1)+ISTR(nCounter)+'>' sTxt2='New Name: <'+sInput(2)+ISTR(nCounter)+'>' ENDIF PRINT/sTxt1 nJump2=1 EXPRNM/sInput(1)+ISTR(nCounter),TO,sInput(2)+ISTR(nCounter),IFERR,LErr1S: ENDIF PRINT/sTxt2 nFound=1 LRet1S: JUMP/LRet4M:,LRet5M:,LRet6M:,nJump1 $$ $$ $$ $$ Error messages $$ ============== LErr1M: IFTHEN/nLang==1 sMsg1='Problem beim Exportieren der Ausdrücke' ELSE sMsg1='Problem when exporting the expressions' ENDIF MESSG/sMsg1 JUMP/LEnd: $$ $$ LErr2M: IFTHEN/nLang==1 sMsg1='Problem beim Öffnen der Datei' ELSE sMsg1='Problem when opening the file' ENDIF sMsg2='<'+sPathWrk+'>' MESSG/sMsg1,sMsg2 JUMP/LCln1S: $$ $$ LErr3M: IFTHEN/nLang==1 sMsg1='Problem beim Erstellen der Puffer- Datei' ELSE sMsg1='Problem when creating the buffer file' ENDIF MESSG/sMsg1 FTERM/TXT,1 JUMP/LCln1S: $$ $$ LErr4M: IFTHEN/nLang==1 sMsg1='Problem beim Erstellen der Datei' ELSE sMsg1='Problem when creating the file' ENDIF sMsg2='<'+sPathImp+'>' MESSG/sMsg1,sMsg2 FTERM/TXT,1 FTERM/TXT,2 JUMP/LCln1S: $$ $$ LErr5M: IFTHEN/nLang==1 sMsg1='Keine Ausdrücke gefunden' ELSE sMsg1='No expressions found' ENDIF MESSG/sMsg1 FTERM/TXT,2 FTERM/TXT,3 JUMP/LCln1S: $$ $$ LErr6M: IFTHEN/nLang==1 sMsg1='Problem beim Schreiben der Datei' ELSE sMsg1='Problem when writing the file' ENDIF sMsg2='<'+sPathImp+'>' MESSG/sMsg1,sMsg2 FTERM/TXT,2 FTERM/TXT,3 JUMP/LCln1S: $$ $$ LErr7M: IFTHEN/nLang==1 sMsg1='Problem beim Aufrufen des externen Sortierprogramms' ELSE sMsg1='Problem when calling the external sort program' ENDIF MESSG/sMsg1 JUMP/LCln1S: $$ $$ LErr8M: $$ Left blank because getting return values doesen't work. $$ $$ LErr9M: $$ Left blank because getting return values doesen't work. $$ $$ LErrAM: IFTHEN/nLang==1 sMsg1='Problem beim Öffnen der Datei' ELSE sMsg1='Problem when opening the file' ENDIF sMsg2='<'+sPathExp+'>' MESSG/sMsg1,sMsg2 JUMP/LCln1S: $$ $$ LErrBM: $$ $$ LErr1S: IFTHEN/nLang==1 sTxt1='!! Umbenennen fehlgeschlagen, schon belegt !! <'+sInput(1)$ +ISTR(nInput(1))+'>' ELSE sTxt1='!! Rename failed, already used !! <'+sInput(1)+ISTR(nInput(1))+'>' ENDIF PRINT/sTxt1 nSystemUsed=1 JUMP/LRet1S:,LRet7M:,nJump2 $$ $$ $$ $$ Clean up $$ ======== LCln1S: $$ Delete probably existing files 'sPathWrk', 'sPathImp' and 'sPathExp'. FDEL/sPathWrk,IFERR,LCnt1S: LCnt1S: FDEL/sPathImp,IFERR,LCnt2S: LCnt2S: FDEL/sPathExp,IFERR,LCnt3S: LCnt3S: $$ $$ Close probably open information window. EJECT/WINDOW $$ JUMP/LEnd: $$ $$ $$ $$ ******** $$ * End: * $$ ******** $$ LEnd: HALT