// // NumSort.vdm Ch. Ziemski 20.10.2203 // 21.10.2003 // // // Sort a list by the first column using its numerical value. // Leading zeros are preserved. // // If the first column contains a non-numeric value it's treated as "0". // (But that shouldn't happen when using this macro.) // // It's limited to 10 digits now. But with VEDIT Pro64 that may increase. // // ------ // // Changes a list like // // 4,willi // 002,karl // 1,otto // 738,tom // 12,peter // 10,peter // // to // // 0000000004#4,willi // 0000000002#002,karl // 0000000001#1,otto // 0000000738#738,tom // 0000000012#12,peter // 0000000010#10,peter // // sorts it by the numeric value of the forst column // and removes the additional first column again. // // 1,otto // 002,karl // 4,willi // 10,peter // 12,peter // 738,tom // //---------------------------------------------------------------------------- BoF while ( ! At_EoF ) { #103=Num_Eval(SUPPRESS) Num_Ins(#103, FILL+FORCE+NOCR) Ins_Text("#") Line(1, NOERR) } Sort_Merge("1,11", 0, File_Size, NOCOLLATE) BoF Del_Block(0,File_Size, COLSET,1,11)