Topic
2 replies Latest Post - ‏2014-03-27T22:24:36Z by MyDeveloerWorks
MyDeveloerWorks
MyDeveloerWorks
41 Posts
ACCEPTED ANSWER

Pinned topic Incorrect format or value for date ( Exercise. 26. dxl course)

‏2014-03-27T11:27:14Z |

Hello,

Has anyone come across a dxl error with the Pizza example in the dxl training course?

Here it is cut down to minimum

DB  pizzaDB = create "Pizza box"
DBE oDateDBE = date(pizzaDB, 30, today, true)

void buttonCallback(DBE element)
{
    print "button callback"
      Date oDate = get(oDateDBE)

      print "haven't had a pizza since " oDate "\n"
}


DBE buttonDBE = button(pizzaDB,"Element", buttonCallback)
show(pizzaDB)

I get the error: (date is in Spanish)

button callback-R-E- DXL: <Line:7> incorrect format or value for date (jueves, 27 de marzo de 2014)

However if I make the following modification to oDateDBE

Date init = dateAndTime(today) 
DBE oDateDBE = date(pizzaDB, 30, init, true)

it works. but not for dateOnly(today) 

regards

Colm

Updated on 2014-03-27T11:36:21Z at 2014-03-27T11:36:21Z by MyDeveloerWorks
  • kourosh
    kourosh
    26 Posts
    ACCEPTED ANSWER

    Re: Incorrect format or value for date ( Exercise. 26. dxl course)

    ‏2014-03-27T20:29:55Z  in response to MyDeveloerWorks

    It's getting the date from your locale set in Windows Control Panel under the Region and Language settings. But even when I change my locale from English (US) to Spanish, the dialog displays correctly with the date in Spanish "jueves, 27 de marzo de 2014"  without any error like yours. What version of the DOORS client are you using? I tested this in DOORS 9.5.2.0.

    • MyDeveloerWorks
      MyDeveloerWorks
      41 Posts
      ACCEPTED ANSWER

      Re: Incorrect format or value for date ( Exercise. 26. dxl course)

      ‏2014-03-27T22:24:36Z  in response to kourosh

      Thanks for trying this.

      I have 8.3 I have a user who want to use my script on that version. I can try again tomrrow with DOORs 9.5.2

       

      I did make another test, using code from Mathias in an earlier post, which I will repeat here ( I also tried the months in Spanish)

      {
      Date d1 = date("2 November 2010", "dd MMMM yyyy")
      Date d2 = date("3 November 2010", "dd MMMM yyyy")
       
      print (d1 == d2) "\n"
      print (d1 != d2) "\n"
      print (d1 < d2) "\n".....

       

      I did not get "false , true, true". I got the opposite, even with the formatting. This is completey breaking a script I want to use to extract changed  attribute data from different time periods.