Subject RE: [IBO] Defining field lengths in IBO4
Author Riho-Rene Ellermaa
void __fastcall TFForCorresp::DSourceDataChange(TIB_StatementLink *Sender,
TIB_Statement *Statement, TIB_Column *Field)
{
if(DSource->Dataset->FieldByName("ACCOUNT")->AsString=="5")
SWIFT->MaxLength=5;
if(DSource->Dataset->FieldByName("ACCOUNT")->AsString=="2")
SWIFT->MaxLength=2;
}

Nothing...

Riho-Rene Ellermaa
senior programmer
Hansabank

> -----Original Message-----
> From: Geoff Worboys [mailto:geoff@...]
> Sent: Friday, August 31, 2001 11:33 AM
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] Defining field lengths in IBO4
>
>
> > Added MaxLength to INT file, recompiled IBO and set
> > the MyField->MaxLength=3
> > in StateChanged event, but nothing visible happened.
> > I still could enter more characters.
>
> Try it in the DataChange event (since you will presumably
> want to change the maxlength according to the current row
> properties anyway).
>
> The problem with using StateChange is that it is in
> StateChange that IBO does its automatic maxlength reset, so
> whether or not your setting "takes" depends on the order of
> creation of the various datalinks. Whereas DataChange is
> called AFTER statechange and so it should give the desired
> result (I think :-)
>
> Geoff Worboys
> Telesis Computing
>
>
> ------------------------ Yahoo! Groups Sponsor
> ---------------------~--> Secure your servers with 128-bit
> SSL encryption! Grab your copy of VeriSign's FREE Guide:
> "Securing Your Web Site for Business." Get it Now!
> http://us.click.yahoo.com/n7RbFC/zhwCAA/yigFAA/PhFolB/TM
>
> --------------------------------------------------------------
> -------~->
>
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>