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

.Net Code

$
0
0

 I was wondering if there is any advantage over one of these .net methods versus the other.  In the second one, I modeled it after a C# method using .net Cobol syntax of course.  They both function the same, but wanted an opinion if one was better than the other in regards to best practices.

 

First Method.

method-id IsStrongPassword public.
local-storage section.
01 cond-value condition-value.
procedure division using by value tro as type TO_NewUser, t as type TextBox returning strongPassword as type Boolean.
set cond-value = type Regex::IsMatch(tro::Password, type HospitalManagementSoftware.Properties.Settings::Default::pword).
evaluate cond-value
when false
invoke type MessageBox::Show("Please enter a stronger password.", #Title)
invoke t::SelectAll()
when other
set strongPassword to true
end-evaluate
end method.

 

Second Method.


method-id IsStrongPassword(tro as type TO_NewUser, t as type TextBox) returning strongPassword as type Boolean public.
local-storage section.
01 cond-value condition-value value type Regex::IsMatch(tro::Password, type HospitalManagementSoftware.Properties.Settings::Default::pword).
evaluate cond-value
when false
invoke type MessageBox::Show("Please enter a stronger password.", #Title)
invoke t::SelectAll()
when other
set strongPassword to true
end-evaluate
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>