Sunday, 10 March 2019

Peoplecode to check if field contains spaces or punctuation


If All(PTSF_SRCH_ENGN.PTSF_SRCH_ENG_INS.Value) Then
   &Name = PTSF_SRCH_ENGN.PTSF_SRCH_ENG_INS.Value;
   &I = 1;
   If IsAlphaNumeric(&Name) = False Then
      While &I <= Len(&Name)
         /* Test to see if failure is because of _ or - or not*/
         &testchar = Substring(&Name, &I, 1);
         If (IsAlphaNumeric(&testchar) = True) Or
               (&testchar = "_") Or
               (&testchar = "-") Then;
            &I = &I + 1;
         Else
            Error (MsgGetText(78, 33, "no spaces or punctuation are allowed"));
            &I = Len(&Name);
            Break;
         End-If;
      End-While;
   Else
      /* test for number in first position*/
      &testnumberpos1 = Substring(&Name, 1, 1);
      If IsDigits(&testnumberpos1) = True Then
         Error (MsgGetText(78, 33, "no spaces or punctuation are allowed"));
         &I = Len(&Name);
      End-If;
   End-If;
End-If;

2 comments:

  1. Titanium Bong – The Art of the Deal - Titanium Arts
    The Titanium Bong is a Chinese-inspired and high-quality high quality casino black titanium product created for casino titanium wedding ring players, titanium scissors the most common titanium 200 welder form of casino gambling. titanium flat iron

    ReplyDelete