2
0

simplewdx.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. -- Simple example of how to write wdx-scripts
  2. function ContentSetDefaultParams(IniFileName,PlugApiVerHi,PlugApiVerLow)
  3. --Initialization code here
  4. end
  5. function ContentGetSupportedField(Index)
  6. if (Index == 0) then
  7. return 'FieldName0','', 8; -- FieldName,Units,ft_string
  8. elseif (Index == 1) then
  9. return 'FieldName1','', 8;
  10. elseif (Index == 2) then
  11. return 'FieldName2','', 8;
  12. end
  13. return '','', 0; -- ft_nomorefields
  14. end
  15. function ContentGetDefaultSortOrder(FieldIndex)
  16. return 1; --or -1
  17. end
  18. function ContentGetDetectString()
  19. return '(EXT="TXT") | (EXT="INI")'; -- return detect string
  20. end
  21. function ContentGetValue(FileName, FieldIndex, UnitIndex, flags)
  22. if (FieldIndex == 0) then
  23. return "FieldValue0"; -- return string
  24. elseif (FieldIndex == 1) then
  25. return "FieldValue1";
  26. elseif (FieldIndex == 2) then
  27. return "FieldValue2";
  28. end
  29. return nil; -- invalid
  30. end
  31. --function ContentGetSupportedFieldFlags(FieldIndex)
  32. --return 0; -- return flags
  33. --end
  34. --function ContentStopGetValue(Filename)
  35. --end