Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

.Net Cobol

$
0
0
In looking at the evaluate statement for the button click event, why does the evaluate txtEmailAddress::text::IsValidEmail() produce an error selection object does not match selection subject.  I put the set and evaluate validEmail in to show that it works.  I was trying to combine statements like you can do in C#.
 
method-id btnSubmit_Click final private (sender as object e as type System.EventArgs).
       local-storage section.
       01  validEmail type System.Boolean.
       
*       set validEmail = txtEmailAddress::Text::IsValidEmail()
*       evaluate validEmail
       
         evaluate txtEmailAddress::Text::IsValidEmail()
         when true
         //some code
         when false
         //some code
       end-evaluate
end method.
 
method-id IsValidEmail(s as string) returning validEmail as type Boolean extension
       local-storage section.
       try
           declare mailAddress = new type System.Net.Mail.MailAddress(s)
           set validEmail = true
       catch
           set validEmail = false
       end method.

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>