Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/13/21 in all areas

  1. Vincent Parrett

    Delphi Package Manager - choices?

    Nice in theory, not really doable though - they are all so different because we all have different ideas.
  2. Fr0sT.Brutal

    Where is Ctrl-F3 coming from?

    Also have something alike here Haven't tested with something newer than XE2 though
  3. Fr0sT.Brutal

    General JSON question

    In general, you can't losslessly map a wider set of values to a tight one (well, thanks Cap'n Obvious). Integer is MinInt..MaxInt and JSON value is MinInt..MaxInt + null + undefined/non-existing. So you either got to make assumptions based on subject (f.e.x, if you're reading naturals - -1 could indicate any missing/invalid value) or to check actual value before each assignment (if JSONDoc.GetValue(..)).
  4. Achim Kalwa

    read integer value from database, best practice ?

    Which Database system do you use? Which connection components? If the field in the database is declared as "Integer", it should never contain a Space character. It could be NULL, which means it doesn't contain any value. Most database access components will translate NULL to the value 0, so an empty field should not raise an exception. Which value do you expect in case the field is NULL? To be save, you can test for empty fields yourself: var F : TField; F := Qry.FindField('IntegerField'); if Assigned(F) and (not F.IsNull) then aObject.IntValue := F.AsInteger else aObject.IntValue := -1; // or whatever value you choose in case of an empty field.
×