serial VHLibTMStrings Default %Library.TMStrings %Library.List 0 Als KeysEmptyCheck=1 (true), dan wordt gecontoleerd of elk item een niet-lege Key bevat.
Controle gebeurt VOOR het TOEVOEGEN van de items.]]>
%Library.Boolean 0 0
Als KeysRepeatCheck=1 (true), dan wordt gecontoleerd of elk item slechts één maal vorkomt.
Controle gebeurt VOOR het TOEVOEGEN van de items.]]>
%Library.Boolean 0 0
Uitleg analoog aan KeysEmptyCheck. De actie "Remove" is enkel van toepassing op de method ..SetTextImtes() %Library.Boolean 0 0 Uitleg analoog aan KeysRepeatCheck. De actie "Remove" is enkel van toepassing op de method ..SetTextImtes() %Library.Boolean 0 0 Adds the specified text string and associated key to the end of the collection, returns the index of added item code S:%String,Key:%Library.String cache 0 %Library.Integer Adds the specified text string and associated key to the end of the collection, returns the index of added item code S:%String,AObject:%Integer,Key:%Library.String cache 0 %Library.Integer Removes all items from the collection. code cache 0 Deletes the string specified by its index from the collection. Indexing starts from 0. code Index:%Integer cache 0 Deletes the string specified by its index from the collection. Indexing starts from 0. code Key:%Library.String cache 0 0) tmp=%this.RunMethod("Delete",$lb(i-1)) s:(tmp'<0) ..Keys=$$$LBDeleteAt(..Keys,i) q ]]> code Index:%Library.Integer cache 0 %Library.String code Index:%Library.Integer cache 0 %Library.String Inserts the specified text string at the specified position in the collection. code Index:%Integer,S:%String,Key:%Library.String cache 0 code Key:%Library.String cache 0 %Library.Integer code Key:%Library.String cache 0 %Library.String Temporary method voor DEBUG code cache 0 %Library.String code TextBegin:%Library.String,MatchCase:%Library.Boolean=0 cache 0 %Library.Integer -1) . Set:($$$BeginsWith($P(Items,$$$D,i),TextBegin)) SelIndex=i-1 Quit SelIndex ]]> Verwijdert de aanwezige items en voegt de nieuwe items toe via een lijst van Text (CRLF-delimited) en een lijst van Keys ($LISTBUILD).
Geeft een foutmelding terug als de items niet toegevoegd zijn; anders "" (leeg).
CheckFlags en RemoveFlags zijn optionele parameters (beschreven in VHStringsCNTs.INC) :
- CheckFlags kan het toevoegen van de Items verhinderen, RemoveFlags zal steeds de geldige Items toevoegen.
- Let wel: de RemoveFlags overheersen de resp. CheckFlags.]]>
code Text:%String,Keys:%List,CheckFlags:%Integer,RemoveFlags:%Integer cache 0 %Library.String 0) Quit $S(i=$LL(Keys):"", 1:"Repeat:"_i) ; Als laatste item bereikt is, dan O.K. ;----------------------------------------------------------------------------- stiRemoveEmpty ; Verwijder de Keys met waarde "" (leeg) uit de lijst New Ri For Quit:($LF(Keys,"")=0) Do . Set Ri=$LF(Keys,"") . Set Keys=$$$LBDeleteAt(Keys,Ri) . Do stiRemoveText(Ri) Quit ;----------------------------------------------------------------------------- stiRemoveRepeat ; Verwijder de Keys die meermaals voorkomen uit de lijst New i,Ri,pos For i=$LL(Keys)-1:-1:1 Do:($LF(Keys,$LI(Keys,i),i)>0) . Set Ri=$LF(Keys,$LI(Keys,i),i) . Set Keys=$$$LBDeleteAt(Keys,Ri) . Do stiRemoveText(Ri) Quit ;----------------------------------------------------------------------------- stiRemoveText(i) Set $P(Text,$$$CRLF,i)="" Set pos=$F($$$CRLF_Text_$$$CRLF,$$$CRLF_$$$CRLF)-2 Set $E(Text,pos-2,pos-1)="" Quit ]]>
code S:%Library.String cache 0 %Library.Integer code S:%Library.String cache 0 %Library.String %Library.CacheSerialState Address ClassName CloseFromClient Parent Capacity CommaText Count Strings Text PropName Keys KeysNotEmpty KeysUnique KeysEmptyCheck KeysEmptyRemove KeysRepeatCheck KeysRepeatRemove KeysCheckEmpty KeysCheckRepeat KeysRemoveEmpty KeysRemoveRepeat Tag