Board index » delphi » Ranges and Index

Ranges and Index

Working with a dBase table, I can set a range using a partial key eg

with Table1 do
  begin
  SetRangeStart;
  Table1.FieldByName('Surname').As String:= 'Jones';
  SetRangeEnd;
  Table1.FieldByName('Surname').As String:= 'Smith';
  ApplyRange
  end;

with an index of 'Name' which is defined as Surname+Initials

I need to limit the display on a Boolean field - 'Business', which
cannot be in an index expression in Delphi.

How can I do display only those records that have the business field
set to true?

Steve Jones
Gloscat, Electronics
UK

 

Re:Ranges and Index


In <815496220.21...@gcatohm.demon.co.uk> st...@gcatohm.demon.co.uk

Quote
(Steve Jones) writes:

>Working with a dBase table, I can set a range using a partial key eg

>with Table1 do
>  begin
>  SetRangeStart;
>  Table1.FieldByName('Surname').As String:= 'Jones';
>  SetRangeEnd;
>  Table1.FieldByName('Surname').As String:= 'Smith';
>  ApplyRange
>  end;

>with an index of 'Name' which is defined as Surname+Initials

>I need to limit the display on a Boolean field - 'Business', which
>cannot be in an index expression in Delphi.

>How can I do display only those records that have the business field
>set to true?

>Steve Jones
>Gloscat, Electronics
>UK

If I undersatnd correctly you are trying to display records of a file
with the contents of the field business = 'true'.  If this is so why
dont you test as follows:
while table1.fieldbyname('business').asString = 'true' do
...............

If your intention was any different please clarify and repost or E Mail
me.
Ben
Arrow

Other Threads