Skip to content

Commit d46dd44

Browse files
committed
Remove redundant function getSetRemovePropXMLdata
1 parent 3ca5621 commit d46dd44

File tree

1 file changed

+0
-150
lines changed

1 file changed

+0
-150
lines changed

testStack/behaviors/stackbehavior.livecodescript

Lines changed: 0 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -867,156 +867,6 @@ end urlCallback
867867

868868

869869

870-
871-
function getSetRemovePropXMLdata pSetProps, pRemoveProps
872-
local thisLine,tNextProp,tPrevProp,tPropCount
873-
local tPropsXML,tRemovePropsXML,tSetPropsXML
874-
875-
-- BUILD SET PROPERTY XML DATA
876-
if pSetProps is an array then
877-
878-
put "-" into tKeyDelim
879-
put "=" into tValueDelim
880-
881-
put arrayToKeyValueList(pSetProps, tKeyDelim, tValueDelim) into tProps
882-
883-
## SORT PROPS LINES
884-
set the itemdelimiter to tKeyDelim
885-
sort tProps by item 1 of each
886-
887-
## BUILD XML
888-
put "<D:set>" & return & "<D:prop>" & return into tSetPropsXML
889-
890-
## GET VALUES FROM PROPSLIST
891-
set the itemdelimiter to tKeyDelim
892-
put the number of lines of tProps into tPropsLineNums
893-
put 1 into tCurrentLine
894-
repeat for each line tPropsLine in tProps
895-
if item 1 of tPropsLine is a number then
896-
delete item 1 of tPropsLine
897-
898-
## GET VALUE
899-
set the itemdelimiter to tValueDelim
900-
put last item of tPropsLine into tValue
901-
902-
## GET NODE NAMES
903-
put tPropsLine into tNodes
904-
delete last item of tNodes
905-
906-
## BUILD XML
907-
set the itemdelimiter to tKeyDelim
908-
if tNodes <> tPrevNodes then
909-
## WRITE OPENING TAGS
910-
repeat for each item tNode in tNodes
911-
put "<Z:" & tNode & ">" & return after tSetPropsXML
912-
if tNode is last item of tNodes then
913-
## WRITE FIRST VALUE AFTER LAST OPENING TAG
914-
delete char -1 of tSetPropsXML
915-
put tValue & "</Z:" & tNode & ">" & return after tSetPropsXML
916-
end if
917-
end repeat
918-
put tNodes into tPrevNodes
919-
else
920-
## WRITE VALUES
921-
put last item of tPrevNodes into tNode
922-
put "<Z:" & tNode & ">" & tValue & "</Z:" & tNode & ">" & return after tSetPropsXML
923-
end if -- IF tNodes <> tPrevNodes then
924-
925-
## CHECK IF NODES IN NEXT LINE ARE EQUAL
926-
if tCurrentLine < tPropsLineNums then
927-
## GET NODES OF NEXT LINE
928-
put line (tCurrentLine + 1) of tProps into tNextNodes
929-
set the itemdelimiter to tValueDelim
930-
delete last item of tNextNodes -- REMOVE VALUE
931-
set the itemdelimiter to tKeyDelim
932-
delete item 1 of tNextNodes -- REMOVE NUMBER
933-
934-
## COMPARE NODES IN CURRENT AND NEXT LINE
935-
if tNextNodes <> tPrevNodes then
936-
## WRITE CLOSING TAGS
937-
repeat with i = (the number of items of tPrevNodes -1) down to 1
938-
put "</Z:" & item i of tPrevNodes & ">" & return after tSetPropsXML
939-
end repeat
940-
put empty into tPrevNodes
941-
end if
942-
943-
else -- IF TCURRENTLINE < TPROPSLINENUMS THEN
944-
## WRITE CLOSING TAGS
945-
repeat with i = (the number of items of tPrevNodes -1) down to 1
946-
put "</Z:" & item i of tPrevNodes & ">" & return after tSetPropsXML
947-
end repeat
948-
end if -- IF TCURRENTLINE < TPROPSLINENUMS THEN
949-
950-
else -- IF ITEM 1 OF TPROPSLINE IS A NUMBER THEN
951-
set the itemdelimiter to tValueDelim
952-
put item 1 of tPropsLine into tNode
953-
put last item of tPropsLine into tValue
954-
put "<Z:" & tNode & ">" & tValue & "</Z:" & tNode & ">" & return after tSetPropsXML
955-
end if -- IF ITEM 1 OF TPROPSLINE IS A NUMBER THEN
956-
957-
add 1 to tCurrentLine
958-
end repeat
959-
960-
put "</D:prop>" & return & "</D:set>" after tSetPropsXML
961-
962-
end if -- IF PSETPROPS IS NOT EMPTY THEN
963-
964-
##
965-
## BUILD REMOVE PROPERTY XML DATA
966-
if pRemoveProps is an array then
967-
968-
put "-" into tKeyDelim
969-
put "=" into tValueDelim
970-
971-
put arrayToKeyValueList(pRemoveProps, tKeyDelim, tValueDelim) into tRemoveProps
972-
973-
put "<D:remove>" & return & "<D:prop>" & return into tRemovePropsXML
974-
975-
repeat for each line tPropLine in tRemoveProps
976-
delete last char of tPropLine -- "="
977-
978-
set the itemdelimiter to tKeyDelim
979-
980-
if the number of items of tPropLine > 1 then
981-
repeat for each item thisItem in tPropLine
982-
if thisItem is last item of tPropLine then
983-
## WRITE OPENING TAG AND CLOSING TAG IN ONE LINE
984-
put "<Z:" & thisItem & "></Z:" & thisItem & ">" into tLastTag
985-
else
986-
## WRITE OPENING TAGS
987-
put "<Z:" & thisItem & ">" & cr after tOpeningTags
988-
put cr & "</Z:" & thisItem & ">" before tClosingTags
989-
end if
990-
end repeat
991-
## BUILD XML
992-
put tOpeningTags & tLastTag & tClosingTags & cr after tRemovePropsXML
993-
else
994-
put "<Z:" & tPropLine & "></Z:" & tPropLine & ">" & return after tRemovePropsXML
995-
end if
996-
997-
end repeat
998-
999-
put "</D:prop>" & return & "</D:remove>" after tRemovePropsXML
1000-
end if -- IF PREMOVEPROPS IS AN ARRAY THEN
1001-
1002-
## ADD SET PROPS XML
1003-
if tSetPropsXML is not empty then
1004-
put tSetPropsXML into tPropsXML
1005-
if tRemovePropsXML is not empty then
1006-
put tPropsXML & return & tRemovePropsXML into tPropsXML
1007-
end if
1008-
else
1009-
if tRemovePropsXML is not empty then
1010-
put tRemovePropsXML into tPropsXML
1011-
end if
1012-
end if
1013-
return tPropsXML
1014-
end getSetRemovePropXMLdata
1015-
1016-
1017-
1018-
1019-
1020870
command prepareLogFields
1021871
local tLogFld, tErrorField, tLogField, tStatusFld
1022872

0 commit comments

Comments
 (0)