Recent

Author Topic: Opinions on best method to handle multiple value lookup in XML file and parse...  (Read 622 times)

MoCityMM

  • Jr. Member
  • **
  • Posts: 72
It's early in the morning so thinking is slow on this one and if I knew where to start, I would have tried to search for answer on the board here... so, maybe someone can point me the direction of the type of function/method I am looking for.

I have a XML file that contains the following child node:

<trigger type="Weekly" exact="false" at="7:00:00" duration="11:01:00" repetition="0:00:00" frequency="1" weeks="" weekdays="1" months="" dates=""/>

the 'weekdays' is what I am wanting to parse and looking for the best method to represent this information. The entries in 'weekdays' could be one entry or multiple entries, ie. 1 or 1, 2, 3, 4, 5, 6, 0

each entry corresponds to a week day: 1 = Monday, etc

XML node lookup and parse I can handle fairly easy.

Basic question is this: Better to use a const value(s) list in application, parse list and replace with 'Monday', etc or load an array with value(s)?

More of a performance question, simple best performance. TArrayOfString, maybe?

Suggestions?

Regards,
-Mo
« Last Edit: February 27, 2020, 12:46:37 pm by MoCityMM »

MoCityMM

  • Jr. Member
  • **
  • Posts: 72
Think I found what I am looking for: https://forum.lazarus.freepascal.org/index.php/topic,11259.msg56444.html#msg56444

Think I have it working (code attached)...

Is it possible to concatenate the enumeration values of TDay to a label in a loop?

Regards,
-Mo

« Last Edit: February 28, 2020, 02:57:18 am by MoCityMM »

 

TinyPortal © 2005-2018