Im looking to write an if statement as follows:
If the string begins with "abc" then changecompany to 1
If not then changecompany to 2.
Im new to c/al so I do not know how to do this.
*This post is locked for comments
Hi,
Do like as follow:
TextToCompareWith := 'abc'; IF COPYSTR(MyString,1,STRLEN(TextToCompareWith)) = TextToCompareWith THEN MyRec.CHANGECOMPANY('MyCompanyName 1') ELSE MyRec.CHANGECOMPANY('MyCompanyName 2');
For more details have a look:
[View:https://msdn.microsoft.com/en-us/library/dd338929.aspx:750:50]
[View:https://msdn.microsoft.com/en-us/library/dd338944.aspx:750:50]
André Arnaud de Cal...
291,965
Super User 2025 Season 1
Martin Dráb
230,836
Most Valuable Professional
nmaenpaa
101,156