Subject Re: tib_date without datasource connection
Author mmenaz
--- In IBObjects@y..., "Ronaldo Rezende Vilela Luiz" <ronaldinho79@b...> wrote:
> Can I use the tib_date without connect to a datasource?

Yes, simply leave datasource/field properties empty (not assigned).
Then the control will use a fixed edit mask in the form of:
'!99' + DateSeparator + '99' + DateSeparator + '9999;1; '
(i.e. usually !99/99/9999;1;)

>
> I can make an select between 2 dates and use this control to user choose the
> dates.
> And the tib_edit ?
> How can I take the value entered in the tib_date and tib_edit ?

For IB_Date usage I've code like this (sorry, it's in intalian, but you can easely understand it)

In a general usega pascal unit I have:
// this takes a string and removes all no numeric chars
// developed for currency manipulation, useful for dates as well
function StrDepuraNumero( Numero : string ) : string;
var
x : integer;
begin
Result := '';
for x := 1 to Length( Numero ) do
begin
if (Numero[x] in ['0'..'9', '-', DecimalSeparator ]) then
Result := Result + Numero[ x ];
end;
end;

and then in my program:

if StrDepuraNumero(edtStartingDate.Text)<>'' then
tmpDate := StrToDate(edtStartingDate.Text);

I was planning to add a ".Value" property to the control, but I've not implemented it yes...
Regards
Marco Menardi