Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Findkey 4.22b6
Mon, Feb 27 2006 3:02 PMPermanent Link

"Allan Brocklehurst"
Hi;
Stats D7

V4.22B6



problem findkey

fieldA(20 char)

fieldB(50 char)

FileLayouts.indexName := TRX ( fieldA+fieldB)



TRX_X := PadRight('ADMIT', 20, ' ');



In dbsys the lookup works great no need to pad the Fields



example1 =======================

This code bombs

ss :=  TRX_X + PadRight(EclipsysTable.FieldDefs[n].Name, 50, ' ');

value for ss := 'ADMIT               '+'NSHIS_ID
';

Length  of ss ----> 70

if FileLayouts.FindKey([ss]) then

begin

---- there appears to be a successful find but  I get the first occurrence
of 'ADMIT' set of records , not the proper record

end

example 2 ===============================

value for ss := 'ADMIT '+'NSHIS_ID                                  ';

Length  of ss ---- > 65

There is an unsuccessful find

Example 3===============================

value for ss := 'ADMIT '+'NSHIS_ID ';

Length  of ss ----> 13

There is an unsuccessful find



Any suggestion would be , as usual, greatly appreciated



Allan







Tue, Feb 28 2006 8:52 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Allan,

<< fieldA(20 char)
fieldB(50 char)

FileLayouts.indexName := TRX ( fieldA+fieldB) >>

You cannot use FindKey with concatenated strings in an attempt to represent
the concatenated index fields.  You need to specify them separately like
this:

if FileLayouts.FindKey([TRX_X,EclipsysTable.FieldDefs[n].Name]) then

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Feb 28 2006 10:09 AMPermanent Link

"Allan Brocklehurst"
Tim;
for god's sake.
Sorry to waste you time on this one

Allan

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:1023F40A-A749-44BE-9C0A-FA84B40CA629@news.elevatesoft.com...
> Allan,
>
> << fieldA(20 char)
> fieldB(50 char)
>
>  FileLayouts.indexName := TRX ( fieldA+fieldB) >>
>
> You cannot use FindKey with concatenated strings in an attempt to
represent
> the concatenated index fields.  You need to specify them separately like
> this:
>
> if FileLayouts.FindKey([TRX_X,EclipsysTable.FieldDefs[n].Name]) then
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
>

Wed, Mar 1 2006 10:36 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Allan,

<< for god's sake. Sorry to waste you time on this one >>

No problem at all. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Image