Subject | Re: tib_date without datasource connection |
---|---|
Author | mmenaz |
Post date | 2002-04-18T19:32:24Z |
--- In IBObjects@y..., "Ronaldo Rezende Vilela Luiz" <ronaldinho79@b...> wrote:
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;)
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
> 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;)
>For IB_Date usage I've code like this (sorry, it's in intalian, but you can easely understand it)
> 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 ?
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