Jump to content

karl Jonson

Members
  • Content Count

    24
  • Joined

  • Last visited

Community Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, This code not giving the result I'm expecting ? TRegEx.IsMatch(anyStr, '[A-Za-z0-9]{1,5}') Ab123 gives true Ab123456 gives true I expected Ab12345 would give false because input is longer than 5 Why ///Ab123456 is giving true ? I expected result to be false as /// don't match pattern ! TIA
  2. Hi, I am reading a database & adding to a file the following info: user_name, surname, date of birth, phone number One customer can have multiple records in db. Which is the best way to keep track of data I am adding to text file & make sure the data I am copying in it is unique Loop through records in db if combination user_name, surname, date of birth, phone number doesn't exist in text file then add else read next record TIA
  3. Hi, I have similar student data: FirstName LastName DOB DegreeType Course1 Course1StartDate Course2EndDate Also, I have rules similar to these: FirstName does not match pattern LastName does not match pattern Student age cannot be greater than 110 or less than 15 A language degree must have a least one language course A language course cannot be given for a non-laguage degree Course start date can't be after end date These are just examples. I have about 100 data fields & 50 rules. Which is the best way to validate student data against these rules ? If student data is valid add to xml if not then add to a list or erroneous records. TIA
  4. I have this procedure: procedure FindDuplicate(Qry : TADOQuery); The Qry contains just 1 column: "Codes" Which the most efficient way to check that "Codes" column doesn't contain any duplicates ? TIA
  5. karl Jonson

    Validation SQL query result

    I would like to do this: ValidateStudentAnswers(100) => result : valid ValidateStudentAnswers(101) => result : not valid
  6. karl Jonson

    Implement logic in TListView

    Hi, If I had these options in TListView: None Not Known OptionOne OptionTwo Which is the best way to implement this logic: 'None' option cannot be selected in conjunction with another options 'Not Known' option cannot be selected in conjunction with another options TIA
  7. Hi, I am trying to process results to this question: What optional subjects do you study? Results could be: 1 Option1 2 Option2 8 None 9 NotKnown I have the results in a SQL query result e.g. OptionCode 1 2 9 I would like to implement these rules on the query result: If duplicate codes then invalid result if 8 & another code then invalid result if 9 & another code then invalid result [Options table] 1 Option1 2 Option2 8 None 9 NotKnown [Answers table] Student Answer 100 1 100 2 101 1 101 9 Student 100 answers are valid. Student 101 answers are not valid because they break rule number3 Which is the best way to implement these 3 rules ? I want to do this: ValidateStudentAnswers(100) => result : valid ValidateStudentAnswers(101) => result : not valid TIA
  8. karl Jonson

    Defining a path variable in Seattle

    Hi, I downloaded a project which when I open it in Seattle it has in project options in output directory this: $(LocalEXE) It looks that it needs to link to C:\Project\DMS folder. How do I define $(LocalEXE) to point to DMS ? TIA
  9. karl Jonson

    XML validation

    These are the steps I had in mind: User clicks on "Generate XML" button App generates XML App validates XML A report containing errors is generated & displayed to user User goes through errors report, correct their data, then click on "Generate XML" again.
  10. karl Jonson

    XML validation

    There's no reason. That's something I need to consider. These are the steps I had in mind: User clicks on "Generate XML" button App generates XML App validates XML A report containing errors is generated & displayed to user User goes through errors report, correct their data, then click on "Generate XML" again.
  11. karl Jonson

    XML validation

    I would like to validate the XML in the generating app but not against an XSD schema. So my app generates the XML & as a last step I would like to validate the XML against a list of rules, e.g. A book must have an author. A book price cannot exceed $100 A book publisher must exist in a pre-defined list. A book ISBN must be unique .... Then generate a report at the end of validation which lists all errors found. Thanks.
  12. karl Jonson

    XML validation

    XML validation. I have an Object Pascal application which generates XML similar to this one: <book> <name>Anna Karenina</name> <author>Leo Tolstoy</author> <publisher>The Russian Messenger</publisher> <price>$16.79</price> </book> Which is the best way to add code which validates the above XML (in the generating app) ? I would like to make sure that: A book must have an author. A book price cannot exceed $100 TIA
  13. karl Jonson

    comma separated values in DBEdit

    I have a DBEdit linked to a integer-field in a table & everything works fine but now I'd like to allow user to enter many integers separated by commas in the DBEdit. So when user types 1,2,3 three records are inserted in the table & without the posting failing. How can I achieve this ? TIA
  14. karl Jonson

    TMemo instead of TLabel

    Hi, I'm using a procedure which uses a TLabel parameter & sets the caption of the label: prcedure GetString(param1: string; param2:string; myLabel: TLabel); Begin myLabel.caption := GetDescription() End Everything works fine & I don't want to break it as it's called from different places. Now I'd like to be able to sometimes pass it TMemo and display multiple lines in the TMemo component: myMemo.lines.Add(GetDescription()); I'd like to be able to say if component is TLabel then do this but if it's TMemo then do that. TIA
  15. karl Jonson

    TListView with check boxes

    Hi, Does anyone have a working logic for Tlistview with checkboxes where a user can multi select options similar to these: None Not Known OptionOne OptionTwo Thanks
×