[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: SQR instr()



Title: RE: SQR instr()

Manoj

In another world (programming wise), I did manual wrapping by setting up a loop that tested the ascii value of each character in a string, starting at the value I selected for right margin and incrementing backward until I reached a space (chr 32).  You then just make a substring up to that position, write the substring and remove it from the main text, then repeat for the next line.

HTH
Bob

-----Original Message-----
From: Manoj Gurjar [mailto:mgurjar@HOTMAIL.COM]
Sent: Friday, November 05, 1999 2:40 PM
To: Multiple recipients of list SQR-USERS
Subject: Re: SQR instr()


Let me tell you what exactly I want to accomplish:

I think PeopleSoft SQRs are not very good in handling NOTEs,
in SalesOrder, Invoice, PO etc forms.

In those case, I have NOTE in string variable $NOTE, which
might have variable multiple lines.

I uses WRAP #width #depth with PRINT.
I get #lines-reqd to print $NOTE using Wrapdepth().

Now, say I check page break such that it will do NEW-PAGE
if #current-line + #lines-reqd is greater then some reference value (say 60
lines/page) according to Form. This kind of checking, keeps possibilities of
not using max possible lines can be printed on a form page and does page
break leaving few lines blank at the bottom sometimes.

I want to print one line of $NOTE at a time and do check for page break so
that I can print upto line 60. Handling one line of
certain width (#width say 70 chars) as a time.

For this, I require a function like instr() which can give
me position of first SPACE from right side.

I can do this writing while loop etc..

Thought if somebody might have better idea.

Thanks,
Manoj
>From: "Love, Kristin" <klove@MSA.COM>
>Reply-To: SQR-USERS@list.iex.net
>To: Multiple recipients of list SQR-USERS <SQR-USERS@list.iex.net>
>Subject: Re: SQR instr()
>Date: Fri, 5 Nov 1999 12:27:59 -0500
>
>How about using the position of the first M for the offset value?
>instr($source,'M',instr($source,'m',0))
>
>?? Didn't try it....
>
>:) Kristin
>
> > -----Original Message-----
> > From: Manoj Gurjar [SMTP:mgurjar@HOTMAIL.COM]
> > Sent: Friday, November 05, 1999 12:01 PM
> > To:   Multiple recipients of list SQR-USERS
> > Subject:      SQR instr()
> >
> > Hi Guys,
> >
> > I need same functionality as INSTR() function,
> > BUT with one more added functionality which can give
> > me a position for a sub_value from end of the source_value.
> >
> > Say for eg: $source = 'Today M is M Friday.'
> > I want instr() to give me a position of 'M' just before 'Friday'.
> >
> > Is there any simple solution. I tried giving negative offset
> > thinking it will start searching from end. No luck.
> >
> > I can achive doing some more coding. Is there any real
> > easy solution, which can save me extra coding.
> >
> >
> > FROM MANUAL:
> > INSTR
> > Returns the numeric position of sub_value in source_value or zero (0) if
> > not
> > found.  The search begins at offset offset_value.  This function returns
>a
> > float value.
> >
> > Syntax: dst_var =       instr(source_value, sub_value, offset_value)
> >
> >
> > Thanks in advance,
> > Manoj
> >
> > ______________________________________________________
> > Get Your Private, Free Email at http://www.hotmail.com

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com