COMBOBOX dont work with array of dates ?

COMBOBOX dont work with array of dates ?

Postby avista » Thu Oct 30, 2014 8:53 am

Hi,
I get hsis error

Time from start: 0 hours 0 mins 0 secs
Error occurred at: 10/30/2014, 09:52:24
Error description: Error BASE/2022 Argument error: ALLTRIM
Args:
[ 1] = D 01/01/2014

Stack Calls
===========
Called from: => ALLTRIM( 0 )
Called from: .\source\classes\COMBOBOX.PRG => (b)TCOMBOBOX:DEFAULT( 754 )
Called from: => ASCAN( 0 )
Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:DEFAULT( 754 )
Called from: .\source\classes\COMBOBOX.PRG => TCOMBOBOX:INITIATE( 694 )
Called from: => __OBJSENDMSG( 0 )
Called from: => HB_EXECFROMARRAY( 0 )
Called from: .\source\function\HARBOUR.PRG => OSEND( 287 )
Called from: => HB_EXECFROMARRAY( 0 )
Called from: .\source\function\HARBOUR.PRG => ASEND( 265 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:INITIATE( 631 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT( 876 )
Called from: => DIALOGBOXINDIRECT( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 274 )
Called from: combo3d1.prg => MAIN( 15 )

Source file

Code: Select all  Expand view
#include "fivewin.ch"

function main()

   local oDlg, cCombo := ctod("01/03/2014")
   local aItems := { ctod("01/01/2014"), ctod("01/03/2014"), ctod("01/05/2014") }

set cent on

   DEFINE DIALOG oDlg FROM 2, 2 TO 18, 60 TITLE "Test" ;
      STYLE nOr( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, 4 )

   @ 2, 2 COMBOBOX cCombo ITEMS aItems SIZE 200, 100

   ACTIVATE DIALOG oDlg CENTERED

return nil
 


Any solution ?

Best regards
User avatar
avista
 
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Re: COMBOBOX dont work with array of dates ?

Postby Marcelo Via Giglio » Thu Oct 30, 2014 11:33 am

Hello,

use a list of string for display the dates in combobox, when choose one of then, change CTOD(<choose date>) the selected date

regards

Marcelo
Marcelo Via Giglio
 
Posts: 1050
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: COMBOBOX dont work with array of dates ?

Postby FranciscoA » Fri Oct 31, 2014 1:25 am

Hi, try it this way:
local oDlg, cCombo := DtoC(ctod("01/03/2014"))
local aItems := { DtoC(ctod("01/01/2014")), DtoC(ctod("01/03/2014")), DtoC(ctod("01/05/2014")) }
Regards.
Francisco J. Alegría P.
Chinandega, Nicaragua.

Fwxh-MySql-TMySql
User avatar
FranciscoA
 
Posts: 2110
Joined: Fri Jul 18, 2008 1:24 am
Location: Chinandega, Nicaragua, C.A.

Re: COMBOBOX dont work with array of dates ?

Postby James Bott » Sat Nov 01, 2014 3:43 pm

If I remember correctly, comboboxes only work with strings,
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 96 guests