home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.paradox      To crash or not to crash, asks Borland      9,834 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,670 of 9,834   
   Jim Moseley to All   
   Re: DateTimeStamp   
   23 Mar 09 09:07:30   
   
   6edd6d3a   
   From: jmose@mapson.attglobal.net   
      
   OzPaul,   
      
   Why not just recreate the format every time you open your app?  I just had   
   to do the same to handle Aussie dates, using the code below in my main   
   library's   
   open() method.  It is just for a Date format called 'tripmdy', but can probably   
   be expanded for DateTime:   
      
   var   
      fmtDyn,   
      arShow array[] string   
      ar array[] string   
      arNum array[] longInt   
      i SmallInt   
   endVar   
      
   set tripmdy date format to US, Euro, or Aussie version   
   arShow.addLast("M")   
   arShow.addLast("D")   
   arShow.addLast("Y")   
      
   dt = date(1,2,3)  ; mdy=1/2/3, dmy=2/1/3, ymd=3/1/2   
   dtStr = string(dt)   
   dtStr.breakApart(ar,"/.,|:")   
   maxI = ar.size()   
   formatName = "tripmdy"	   
   curfmt = formatGetSpec(formatName)   
      
   arNum.empty()   
   for i from 1 to maxI   
      arNum.addLast(longInt(ar[i]))   
   endFor   
      
   if arNum.size() = 3 then   
      buildFmt = "DM1D1Y2O"   
               + "(%" + arShow[arNum[1]]   
               + "/%" + arShow[arNum[2]]   
               + "/%" + arShow[arNum[3]]   
               + ")"   
      formatName = "tripmdy"	   
      ok = formatExist(formatName)   
      if ok then   
         ok = formatDelete(formatName)   
      endif   
      if ok then   
         ok = formatAdd(formatName, buildFmt)   
      endif   
      if not ok then   
         errorShow("Format problem")   
      endif   
   endif   
      
      
   HTH,   
   Jim Moseley   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca