FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour COMBOBOX dont work with array of dates ?
Posts: 301
Joined: Fri Jun 01, 2007 09:07 AM

COMBOBOX dont work with array of dates ?

Posted: Thu Oct 30, 2014 08: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 (fw): Select all Collapse
#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
Posts: 1088
Joined: Fri Oct 07, 2005 03:33 PM

Re: COMBOBOX dont work with array of dates ?

Posted: 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

Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM

Re: COMBOBOX dont work with array of dates ?

Posted: Fri Oct 31, 2014 01: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Re: COMBOBOX dont work with array of dates ?

Posted: Sat Nov 01, 2014 03:43 PM

If I remember correctly, comboboxes only work with strings,

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion