Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Left Function in RB

edited January 2006 in General
Hi all

Trying to do something like the following:

If Left({table.field},3) = 'aaa' Then
'Main'
Else
'Secondary';

In other words, I'm trying to find out the first three letters of the
field name and based on these three letters assign it either main or
secondary.

Works using the Left Function in Crystal, just unsure how to achieve the
same in RB (v7.03 Enterprise Edition).

Many thanks in advance,
Bert?



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited January 2006
    Hi Bert,

    Are you using RAP? If so, it is better to post your question in the RAP
    newsgroup to help us understand your issue easier. The corresponding Delphi
    routine to the "Left" function you speak of is the LeftStr function. This
    is not natively available in RAP so you would need to create a pass-thru
    function in order to use it. Another option would be to use the Copy
    routine which is built into RAP. Something like the following would be like
    calling the LeftStr function...

    if (Copy(Report.DataPipeline['MyField'], 0, 3)) = 'aaa' then
    ...

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited January 2006
    Many thanks Nico

    Yes, using RAP and will post there in future.

    Still a newbie and the pass-thru functions look a bit over my head at the
    moment!

    Will try the Copy Routine, looks like it could do what I need.

    Regards,
    Bert

    Delphi
    This
    like
    the



    --- posted by geoForum on http://delphi.newswhat.com
  • edited January 2006
    > Will try the Copy Routine, looks like it could do what I need.

    don't be afraid of them--they are pretty slick once you start.

    Ed Dressel
    Team DM
This discussion has been closed.