This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
* Utilities - Variety of commonly used methods
Define_Com Class(#OC_RP_DemoUtilities) Name(#Utilities)
Define Field(#w_char) Type(*CHAR) Length(1)
Define Field(#w_token) Reffld(#STD_TEXT)
Define Field(#wlstListCount) Reffld(#ListCount)
Def_List Name(#w_tokenlist) Fields(#w_token) Counter(#wlstListCount) Type(*WORKING) Entrys(*MAX)
* Iterate through the items in the string, using a ~ as the separator and including blank items.
#OC_Ref_EmailAddress := #ADDR10
Clr_List Named(#w_tokenlist)
For Each(#Word) In(#Utilities.SplitString( #addr10 "~" True ))
#w_token := #Word.AsNativeString
Add_Entry To_List(#w_tokenlist)
Endfor
If Cond(#wlstListCount *GT 0)
* use first token for email address
Get_Entry Number(1) From_List(#w_tokenlist) Ret_Status(#IO$STS)
#OC_Ref_EmailAddress := #w_token
Clr_List Named(#w_tokenlist)
Endif