项目作者: lveith

项目描述 :
Only a test example for collection convert to HTML, CSV, MD, TXT and more with col.map("colMapJoin")
高级语言: HTML
项目地址: git://github.com/lveith/testCollectionTo.git
创建时间: 2020-05-15T13:43:43Z
项目社区:https://github.com/lveith/testCollectionTo

开源协议:

下载


testCollectionTo (4Dv18R3)

Only a test example for collection convert to HTML, CSV, MD, TXT and more with collection.map(“colMapJoin”)

collections of values (one not named column)

  1. $col.map("colMapJoin";$rowPrefix;$rowSuffix;$cellPrefix;$cellSuffix;$cellSeparator;$colReplace)
  1. $col.map("colMapJoin";$rowPrefix;$rowSuffix;$cellPrefix;$cellSuffix;$cellSeparator)

collections of objects (multi columns with nameKey)

  1. $col.map("colMapJoin";$rowPrefix;$rowSuffix;$cellPrefix;$cellSuffix;$cellSeparator;$colReplace;$colKeys)

Examples in test-dialog

  • Collection to HTML
  • Collection to CSV
  • Collection to MD
  • Collection to TXT
  • Collection to TSV
  • Collection to XML
  • Collection to JSON

Call Example

  1. C_COLLECTION($myCollectionToDumpOut)
  2. C_TEXT($docType)
  3. C_TEXT($myListName)
  4. C_TEXT($myTimelineMiddle)
  5. C_TEXT($myTimelineBefore)
  6. C_TEXT($myTimelineAfter)
  7. // Any collection what you want to dump out with collectionTo
  8. // ...creating here any test-data for testing collectionTo...
  9. $myCollectionToDumpOut:=New collection
  10. $myCollectionToDumpOut.push(New object("a";"a1";"b";"b1";"c";"c1"))
  11. $myCollectionToDumpOut.push(New object("a";"a2";"b";"b2";"c";"c2"))
  12. $myCollectionToDumpOut.push(New object("a";"a3";"b";"b3";"c";"c3"))
  13. $docType:=".html"
  14. $myListName:="Place here any name for the list"
  15. $myTimelineMiddle:="" // if not filled, than created automatically
  16. $myTimelineBefore:="" // optional
  17. $myTimelineAfter:="" // optional
  18. C_COLLECTION($colToAttr)
  19. C_OBJECT($itemColumn)
  20. // create a new default colKeysAttr
  21. $colToAttr:=yColToAttrCreate ($myCollectionToDumpOut)
  22. If (True) // only a example for change default attributes like title, sort (or hide column with active=False)
  23. For each ($itemColumn;$colToAttr)
  24. Case of
  25. : ($itemColumn.key="a")
  26. $itemColumn.title:="# A #" // change default title to individual title
  27. : ($itemColumn.key="b")
  28. $itemColumn.title:="# B #" // change default title to individual title
  29. End case
  30. End for each
  31. Else
  32. // use default attributes like title, sort (or hide column with active=False)
  33. // when its wished to dump out all existing keys from your collection
  34. // in phySortOrder and with title=keyname
  35. // ...than take standard you get by $colToAttr:=yColToAttrCreate($myCollectionToDumpOut)
  36. // ...nothing more to do when no different customs needed
  37. End if
  38. Case of
  39. : (True) // $docType (like before is set to ".html"
  40. collectionTo ($myCollectionToDumpOut;$docType;$myListName;$myTimelineMiddle;$myTimelineBefore;$myTimelineAfter;$colToAttr)
  41. : (True) // alternativ ".csv"
  42. collectionTo ($myCollectionToDumpOut;".csv";$myListName;$myTimelineMiddle;$myTimelineBefore;$myTimelineAfter;$colToAttr)
  43. : (True) // alternativ ".md"
  44. collectionTo ($myCollectionToDumpOut;".md";$myListName;$myTimelineMiddle;$myTimelineBefore;$myTimelineAfter;$colToAttr)
  45. : (True) // alternativ ".txt"
  46. collectionTo ($myCollectionToDumpOut;".txt";$myListName;$myTimelineMiddle;$myTimelineBefore;$myTimelineAfter;$colToAttr)
  47. : (True) // alternativ ".tsv"
  48. collectionTo ($myCollectionToDumpOut;".tsv";$myListName;$myTimelineMiddle;$myTimelineBefore;$myTimelineAfter;$colToAttr)
  49. : (True) // alternativ ".xml"
  50. collectionTo ($myCollectionToDumpOut;".xml";$myListName;$myTimelineMiddle;$myTimelineBefore;$myTimelineAfter;$colToAttr)
  51. : (True) // alternativ ".json"
  52. collectionTo ($myCollectionToDumpOut;".json";$myListName;$myTimelineMiddle;$myTimelineBefore;$myTimelineAfter;$colToAttr)
  53. End case

github-small

Example html result lists

4Dv18R3Commands_716CMDsNotThreadsafe

4Dv18R3Commands_CMDsMemoryLeaks