Article View: pl.comp.lang.vbasic
Article #104413Re: Prosba o uproszczenie funkcji
From: InDesign Scripts
Date: Sat, 19 Dec 2009 20:13
Date: Sat, 19 Dec 2009 20:13
24 lines
1722 bytes
1722 bytes
>> Public Function fragment(wartosc, separator, pozycja, ile_wyrazow) >> >> Dim arrTablica As Variant >> Dim arrTablicaWyn As Variant >> Dim i As Integer >> >> arrTablica = Split(wartosc, separator) >> >> ReDim arrTablicaWyn(1 To ile_wyrazow) >> >> For i = 1 To ile_wyrazow >> arrTablicaWyn(i) = arrTablica(pozycja + i - 2) >> Next i >> >> fragment = Join(arrTablicaWyn, separator) >> >> End Function > > Funkcja dziala poprawnie i szybko, tego potrzebowalem. > Wielkie dzieki. a dodałeś sprawdzanie czy pozycja i pozycja+ile_wyrazow nie jest większe od UBound(arrTablica)-1 ? ;) robin
Technical Details
Message-ID:
<hgjc4c$f7j$1@inews.gazeta.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mailReferences:
<hgdfq6$2ku$1@inews.gazeta.pl> <hgdjja$foq$1@inews.gazeta.pl> <hgdoe6$3ia$1@inews.gazeta.pl> <hgeh3l$3nt$1@inews.gazeta.pl> <hgfl9s$47c$1@nemesis.news.neostrada.pl> <hgiom0$6lp$1@inews.gazeta.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail From: InDesign Scripts <indesignscripts@gazeta.pl> Newsgroups: pl.comp.lang.vbasic Subject: Re: Prosba o uproszczenie funkcji Date: Sat, 19 Dec 2009 20:13:00 +0000 Organization: "Portal Gazeta.pl -> http://www.gazeta.pl" Lines: 24 Message-ID: <hgjc4c$f7j$1@inews.gazeta.pl> References: <hgdfq6$2ku$1@inews.gazeta.pl> <hgdjja$foq$1@inews.gazeta.pl> <hgdoe6$3ia$1@inews.gazeta.pl> <hgeh3l$3nt$1@inews.gazeta.pl> <hgfl9s$47c$1@nemesis.news.neostrada.pl> <hgiom0$6lp$1@inews.gazeta.pl> NNTP-Posting-Host: host81-158-97-19.range81-158.btcentralplus.com Mime-Version: 1.0 X-Trace: inews.gazeta.pl 1261253580 15603 81.158.97.19 (19 Dec 2009 20:13:00 GMT) X-Complaints-To: usenet@agora.pl NNTP-Posting-Date: Sat, 19 Dec 2009 20:13:00 +0000 (UTC) X-User: indesignscripts X-Antivirus: avast! (VPS 091219-0, 2009-12-19), Outbound message In-Reply-To: <hgiom0$6lp$1@inews.gazeta.pl> X-Antivirus-Status: Clean User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit