Results 1 to 5 of 5

Thread: Edit object, line-by-line

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    SW Connecticut/NY area
    Posts
    9,181

    Default Edit object, line-by-line

    Back in the day when we used the old Edit and dbEdit objects, we had the ability to parse them line by line by using the following

    Code:
                Get line_count of (oQuery(Self)) to iLines
                For iCnt from 0 to (iLines -1)
                    Get Value of (oQuery(Self)) item iCnt to sTest  // would hold the value of each line in turn
    
                Loop
    But this no longer works with cDbTextEdit. Yes, Line_Count works well enough but I don't see a way to get the value of a single line, sTest holds the value of the entire object. I replaced the cdbTextEdit object with a good old dbEdit object and the above code worked as expected.

    Am I missing something or do I have to go back to the obsolete dbEdit object?
    Bob Worsley
    203-249-2633
    rlworsley at gmail.com

    Do or do not. There is no try. — Yoda

  2. #2
    Join Date
    Feb 2009
    Location
    Adelaide, South Australia
    Posts
    2,863

    Default Re: Edit object, line-by-line

    Hi Bob

    I think you just have to rethink how you require it to work.
    You can use split to array based on the cr/lf, or you can break it on fixed width or you can do word wrapping logic.

    So with the new one you have a lot more options... but it does require coding of what it is you exactly want (but it’s basic string coding).

    Kind regards
    Marco
    Marco Kuipers
    DataFlex Consultant
    28 IT Pty Ltd - DataFlex Specialist Consultancy
    DataFlex Channel Partner for Australia and Pacific region
    Adelaide, South Australia
    www.28it.com.au

  3. #3
    Join Date
    Feb 2009
    Location
    SW Connecticut/NY area
    Posts
    9,181

    Default Re: Edit object, line-by-line

    Hi Marco,
    You're probably right, I will have to rethink it if I continue to use that object. Too bad, the old way was quite easy but I don't want to use an obsolete object. Fixed width won't work but cr/lf should.

    Thanks for kicking me in the right direction...
    Bob Worsley
    203-249-2633
    rlworsley at gmail.com

    Do or do not. There is no try. — Yoda

  4. #4

    Default Re: Edit object, line-by-line

    Bob,

    Use

    Code:
    Get Line iLine to sLine
    instead of Get Value

    --
    Wil

  5. #5
    Join Date
    Feb 2009
    Location
    SW Connecticut/NY area
    Posts
    9,181

    Default Re: Edit object, line-by-line

    Thanks Wil, I missed that change for sure. The syntax makes much more sense than the old Get Value...
    Bob Worsley
    203-249-2633
    rlworsley at gmail.com

    Do or do not. There is no try. — Yoda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •