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

Giving Back! : Left & Right functions.



No rocket science here, but they may be useful.

A couple of useful procedures to get the left or right amount of characters
from a string.

Begin-Procedure Right($InStr, #InNum, :$OutStr)
  If #InNum >= Length ($InStr)
     Let $OutStr = $inStr
  Else
     Let $OutStr = SubStr($InStr, Length($InStr) - #InNum + 1, #inNum)
  End-If
End-Procedure

Begin-Procedure Left($InStr, #InNum, :$OutStr)
  If #InNum >= Length ($InStr)
     Let $OutStr = $inStr
  Else
     Let $OutStr = SubStr($InStr, 1, #inNum)
  End-If
End-Procedure



cheers, Jarrod.





----------------------------------------------------------------------------
This email contains information confidential to AAMI Limited.
If you are not the intended recipient, you must not disclose
or use the information contained in it. If you have received
this email in error, please notify us immediately by return email
and delete this email and any attached documents.
AAMI Limited is not responsible for any changes made to a document
other than those made by AAMI Limited or for the effect of the
changes on the documents meaning.
----------------------------------------------------------------------------