1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question Is This A Bug? Can't Pass Unknown Value "?" To The Add Method.

Discussion in 'Development' started by Cecil, Oct 11, 2017.

  1. Cecil

    Cecil 17+ years progress programming and still learning.

    Ref:
    OpenEdge 11.6.3
    Windows 10 Pro

    The following example code fails with the errors 13843 and 14457.

    Code (progress):
    1. USING Progress.Json.ObjectModel.JsonObject.
    2. DEFINE VARIABLE oJson       AS class JsonObject    NO-UNDO.
    3.  
    4. oJson = NEW JsonObject().
    5.  
    6. oJson:Add("blarNumber",  12345).
    7. oJson:Add("blarString", "asdasda").
    8. oJson:Add("blarUnkown", ?).
    Error Message:
    Screen Shot 10-12-17 at 02.53 PM.PNG
    In the documentation it says passing a value of unknown will result in a JSON null value.

    Screen Shot 10-12-17 at 02.55 PM.PNG

    My workaround is to wrap the unknown value with an integer function. My question, is this a bug?
    If it is a bug, I guess it won't be fixed because it's been like this for too many revisions of OpenEdge.

    Code (progress):
    1. USING Progress.Json.ObjectModel.JsonObject.
    2. DEFINE VARIABLE oJson       AS class JsonObject    NO-UNDO.
    3.  
    4. oJson = NEW JsonObject().
    5.  
    6. oJson:Add("blarNumber",  12345).
    7. oJson:Add("blarString", "asdasda").
    8. oJson:Add("blarUnkown", INTEGER(?) ).
     
  2.  
  3. Rob Fitzpatrick

    Rob Fitzpatrick ProgressTalk.com Sponsor

    You never know until you try. I'd open a case with TS.
     
  4. Stefan

    Stefan Active Member

    You say integer, I say character and that's the problem, the signature determines which method is called.

    Which datatype does a literal unknown have?

    So you will need to help the compiler by either explicitly adding a function around the unknown or using a variable with a specified data type set to unknown.
     
  5. Cecil

    Cecil 17+ years progress programming and still learning.

    I guess you are right, the limitation is the compiler not knowing what data type the 'unknown value' is related to. Maybe, the documentation should be updated to reflect this querk of passing constant parameter values vs. variables vs. functions.
     

Share This Page