Re: String Functions in MF

From: Rick Smith (ricksmith_at_mfi.net)
Date: 09/29/04


Date: Tue, 28 Sep 2004 23:20:07 -0400


"Robert Wagner" <robert@wagner.net.yourmammaharvests> wrote in message
news:br4kl01ul70eofiuq2k91me7sqk2fsk5ba@4ax.com...
> On Tue, 28 Sep 2004 21:00:24 -0400, "Rick Smith" <ricksmith@mfi.net>
> wrote:
>
> > I cannot tell whether the original poster intended
> >only single words, as in the example, or a generalized
> >method, as indicated by 'Is there any TRIM type function ...'.
> >
> >Given that the original poster stated 'Micro Focus Net
> >Express version 3.1', if it is true there is no 'TRIM type
> >function' for that product or in standard COBOL, the only
> >EXACT answer is no. Anything beyond that is
> >speculation about intent.
>
> Since the original poster was seeking a C-like solution, why not
> advise him to call the C trim() function? Perhaps followed by calls to
> strcpy() and strcat().

Perhaps the original poster was seeking a BASIC-like
solution. Mr Wagner, I checked some of my sources and
find no trim() function in C. I did find a RTRIM$ Function
in QuickBasic 4.5 that 'Returns a string with the trailing
(right-hand) spaces removed.' The function may exist in
other BASIC implementations.

> Calling C functions from Cobol is trivial. Just do it. You don't need
> anything special.

Perhaps using a facility from BASIC is not so trivial.

Both C-style and Pascal-style strings are rather
straight-forward to implement in COBOL. BASIC-style
strings may be implemented in COBOL; but there are,
as I see it, problems with garbage collection and
compaction.



Relevant Pages

  • Re: Another stab at Cantor
    ... Very droll, Georgie. ... The original poster then talks about continuing this process via the ... If you are trying to Re-write those instructions to ... all possible strings. ...
    (sci.math)
  • Re: Why Five Strings
    ... Either the strings are closer together or the neck is wider. ... I don't plan to go to a 6 or higher myself, but (like the original poster) ...
    (alt.guitar.bass)
  • Re: Strings for acoustic bass guitar?
    ... The original poster asked what kind of strings people recommend. ... I answered that I like bronze strings, I explained why I like them. ... You answered that you like flats and why you liked them. ... should lighten up the same I would anyone else with a disability. ...
    (alt.guitar.bass)
  • subroutine storage can be used by another?
    ... I think the original poster was using assembler subroutines because they ... with "arbitrary" DCB attributes. ... COBOL, but playing with DCB attributes in a COBOL program is NOT something ...
    (bit.listserv.ibm-main)
  • Re: String Functions in MF
    ... > Since the original poster was seeking a C-like solution, ... Answer - because the original poster was asking how to do something *IN COBOL*. ...
    (comp.lang.cobol)