How to combine two msgfiles

The attached spec MAKENEWMSGFILE.SPX is a Mentor run to read 2Survox msgfiles and merge the files such that the “new” file adds to and/or replaces lines in the “old” file.

The application is to update Survox msgfiles with new messages, especially in other languages, without having to edit the msgfile every time you get a new update. Just keep a file of your messages separate from the Survox msgfile.raw.

If you send messages to Survox support, and they are new for your language, we will include them in the standard msgfile for the next version available. Otherwise you can use this to add your own messages. Or, if you have “Customized” messages, keep them in this file.

The following define sets the name of the YOUR file with the changed or customized messages in it.

>Define @YourFile msgnew.raw

The following define sets the name for the standardSurvox raw message file, usually located int he Control sub-directory of wherever the software was installed and it is called msgfile.raw.

>Define @CfMCFile msgfile.raw

The following define sets the name for the new outputted raw message file.

>Define @NewFile msgflnew.raw

Put both input files in the same directory and then execute the spec usually by saying “mentor mknewmsg.spx -mknewmsg.lfl”.

You can then take the output file from above and create a new msgfile by saying:

makemsg msgflnew.raw gapfile language=xx

where msgflnew.raw is the name of the newfile from above. This will make the file “newfile” which should be copied to “msgxxxx”, where “xxxx” is your current msgfile version number.

>purgesame~in @CfMCFile ascii=500 totallength=520~out msgfilex.raw ascii trimblanks~define proc=mark9:             ''Write files out with mergable msg/line numbersif firstcasemodify [501.6$]="zz0000"modify count9[508.4*z]=0001modify filenum9[507]=9endifif [1.4*Z#0000-9999]mod [501.2$]="zz"mod [503.4*z]=[1.4]mod count9=0elseif [1.2#aa-zz] and [3.4*z#0000-9999]mod [501.6$]=[1.6$]mod count9=0else mod count9++=1endif endifwritecase }~execute proc=mark9~define proc=mark1:             ''Write files out with mergable msg/line numbersif firstcasemodify [501.6$]="zz0000"modify count1[508.4*z]=0001modify filenum1[507]=1endifif [1.4*Z#0000-9999]mod [501.2$]="zz"mod [503.4*z]=[1.4]mod count1=1elseif [1.2#aa-zz] and [3.4*z#0000-9999]mod [501.6$]=[1.6$]mod count1=1else mod count1++=1endif endifwritecase }~input @YourFile ascii=500 totallength=520~out msgnewx.raw ascii trimblanks~execute proc=mark1~in files="msgnewx.raw,msgfilex.raw" ascii=520~output msgfiley.raw ascii length=520 trimblanks~sort [503.4$] [501.2$] [507.5$]~in msgfiley.raw ascii=520 totallength=540~out @NewFile ascii length=500 trimblanks~define proc=final:if [507#1] ''found new messagemodify [521.6$]=[501.6$]endifif [507#9] and [521.6$]=[501.6$] elsewritecaseendif}~execute proc=final~in;>ifdefine @DEBUG>else>delete msgfilex.raw>delete msgfiley.raw>delete msgnewx.raw>endif~end

  • makenewmsgfile.spx