X-Received: by 2002:a5e:9241:: with SMTP id z1mr13604449iop.39.1559456769069; Sat, 01 Jun 2019 23:26:09 -0700 (PDT) X-Received: by 2002:a9d:66d8:: with SMTP id t24mr7503423otm.349.1559456768947; Sat, 01 Jun 2019 23:26:08 -0700 (PDT) Path: csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!4no894521itm.0!news-out.google.com!l135ni548itc.0!nntp.google.com!i64no926033iti.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.javascript Date: Sat, 1 Jun 2019 23:26:08 -0700 (PDT) In-Reply-To: <09b80eaf-4e43-4f99-b8f7-de0440a9c4c4@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=213.112.1.151; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW NNTP-Posting-Host: 213.112.1.151 References: <30b489af-8a97-43be-9ef8-94da87ce7d7a@googlegroups.com> <1ovdybefl3zg5$.1txcn41x377u4$.dlg@40tude.net> <09b80eaf-4e43-4f99-b8f7-de0440a9c4c4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5ab0dc7f-e55d-421b-9cee-e514eaf11967@googlegroups.com> Subject: Re: Read in cakewalk instrument files banks and their content and hold in coherent manner. From: =?UTF-8?Q?Jonas_Th=C3=B6rnvall?= Injection-Date: Sun, 02 Jun 2019 06:26:09 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Lines: 26 Xref: csiph.com comp.lang.javascript:36739 Den s=C3=B6ndag 2 juni 2019 kl. 08:24:08 UTC+2 skrev Jonas Th=C3=B6rnvall: > Den s=C3=B6ndag 2 juni 2019 kl. 04:28:27 UTC+2 skrev JJ: > > On Sat, 1 Jun 2019 04:26:44 -0700 (PDT), Jonas Th=C3=B6rnvall wrote: > > >> //REMOVE EMPTY LINES FROM BANK > > >> Abank[current]=3DAbank[current].replace(/^\s*[\r]/gm,""); > >=20 > > That clears the unwanted lines, instead of removing them. >=20 > I removed replace regex with splice. >=20 > function ListBankInstruments(current){=20 > instName=3DAbank[current].split("\n");[]=20 > //REMOVE FIRST LINE "BANKNAME"=20 > instName.shift();=20 > //REMOVE LINES NOT STARTING WITH DIGIT OR EMPTY=20 > alert(instName[instName.length-1].charCodeAt(0));=20 > =20 > for (var j=3DinstName.length-1;j>=3D0;j--){=20 > ChCode=3DinstName[j].charCodeAt(0);=20 > if (ChCode<48 || ChCode>57 || ChCode=3D=3D13 ) { instName.splice(= j,1); }=20 > }=20 > alert(instName.length);=20 > instOptionList();=20 > } Sorry i exchanged... and removed