Menu

DateTime in browse

Help
2012-01-09
2013-03-18
  • nenad cikic

    nenad cikic - 2012-01-09

    I have the file with datetime inner group definition, as you know since you kindly implemented the datetime postgre type.

    blagajnicke_transakcije FILE,DRIVER('ODBC'),OWNER('wmj'),NAME('blagajnicke_transakcije'),PRE(bt),CREATE,BINDABLE,THREAD
    Record                   RECORD,PRE()
    serijski_broj               STRING(10)
    datum_i_vrijeme_transakcije STRING(8)
    datum_i_vrijeme_transkacijeG GROUP,OVER(datum_i_vrijeme_transakcije)
    datum                         DATE
    vrijeme                       TIME
                                END

    When I put the datum_i_vrijeme_transkacijeG.datum in the browse I get generated
    PROJET(bt:datum)

    The problem is that c2j refuses to compile with the message clarionCompileError: expected ')' near line….
    I suppose c2j does not recognize inner group fields.

    Thanks
    Nenad

     
  • Andrew Barnham

    Andrew Barnham - 2012-01-09

    Should be working.

    I added test into compiler that works. See below

    Make sure compiler and runtime are up2date. You may need to tweak compiler to refer to latest runtime (1.92-SNAPSHOT)

    src/test/java/org/jclarion/clarion/compile/CompileRealFileTest.java

            ClassLoader cl = compile(
                    "   program\n",
                    "Franch               FILE,DRIVER('ODBC'),OWNER('c8'),NAME('testdate'),PRE(PSI),BINDABLE\n",
                    "PrimaryKey               KEY(PSI:ID),NAME('pkey'),PRIMARY\n",
                    "dateKEY                  KEY(PSI:timeStampField),DUP,NAME('datekey'),OPT\n",
                    "Record                   RECORD,PRE()\n",
                    "id                          LONG,NAME('id')\n",
                    "timeStampField              string(8),NAME('timeStampField')\n",
                    "timeStampGroup                         group,over(timeStampField)\n",
                    "date                                           long\n",
                    "time                                           long\n",
                    ".\n",
                    "                         END\n",
                    "                     END\n",
                    "\n",
                    "   code\n",
                    "   create(franch)\n",
                    "   open(franch)\n",
                    "   assert(errorcode()=0,'#1')\n",

                    "   psi:id=1\n",
                    "   psi:timeStampGroup.date=today()\n",
                    "   psi:timeStampGroup.time=clock()\n",
                    "   add(franch)\n",

                    "   clear(franch)\n",
                    "   assert(psi:timeStampGroup.date=0,'#2')\n",
                    "   assert(psi:timeStampGroup.time=0,'#3')\n",

                    "   set(psi:dateKEY)\n",
                    "   next(franch)\n",
                    "   assert(psi:timeStampGroup.date=today(),'#4')\n",
                    "   assert(abs(psi:timeStampGroup.time-clock())<200,'#5')\n",
                    "   next(franch)\n",
            "");

     
  • nenad cikic

    nenad cikic - 2012-01-09

    Please note that you do not have in your test case the following prefix:date
    In my case i may in clarion do either
       bt:datum=today()
       bt:datum_i_vrijeme_TransakcijeG.datum=today()

    and both will compile in clarion.
    But just the second line will compile in c2j. And it is the first line that the browse templstes generate, in PROJECT(… and also in update form.
    I have updated the compiler to the latest. If you think I will update also the runtime to the latest (I have few local changes due to coratian launguages and some features not implemented so I prefer to update runtime on file basis, but if you think i have missed something i will update from root).

    Thanks
    Nenad

     
  • Andrew Barnham

    Andrew Barnham - 2012-01-09

    Prefix handling between c2j and clarion are not consistent.  Prefixless groups is something c2j cannot at this time handle.  to fix would need to modify compiler to copy symbols from groups which are not prefixed into parent scope. I am a little reluctant to do this because it may break some of my own code.  Maybe could be done with a switch which I disable in my app.

     
  • nenad cikic

    nenad cikic - 2012-01-10

    OK, no problem, I will use procedure local parameters for this. It is just one browse and one form that i have to change so no big deal.
    Have you managed to look at the "Oddity after CloseFiles" thread? If you do not have time I will just pay attention to open all needed tables. Anyway the most important thing is that c2j behaves consistently, i.e. that does not expose random behaviour, and I am very happy with that.

    Thanks
    Nenad

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.