Partial passwords

Bruce Easton bruce at stn.com
Tue Dec 11 12:07:01 PST 2007


Walter Vaughan wrote Tuesday, December 11, 2007 11:13 AM:
[..]
>
> Correct. And I really don't want an edit. I wanted a way to whenever a
> field was displayed it showed ###'s but was stored as the actual values.
>
[..]
I was hoping to keep the rewrite down to changing an edit.
[..]

Well I know you were not looking for a lot of coding Walter, but curiosity
got the best of me a bit here, so I'll post what I came up with.
It has the following features:

-display CC# with mask showing only last digits (when not entering
a new CC#) - i.e., "************4356"
-prompt user for to verify correct entry of CC# (in form
####-####-####-####)
before saving
-show "(No CC# on File)" when CC# field is blank
-allows entry/update/removal of CC# within a fairly small area on the screen

I two dummy fields to allow entry/changing/removing a card#.

Could still use code to check format of various types of cards
accepted.  This code uses field 1 as the stored CC#.  You would
need to protect access to changing browse to prevent viewing CC#
that way.

To try it out create a test file w/CC# as field 1 and a test screen
where dummy field "*cx" is at 5,4 and dummy field "!cd" is at 5,9,
otherwise modify lines 11 and 15 for input and msgbox.

  1  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 'CC# entry/update/removal
       Then: end
  2  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
@entsel  If:
       Then: gosub showcc; end
  3  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
showcc   If:     '*** subroutine to show masked cc value
       Then: cw=1{""
  4  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: cw eq ""     'no cc# entered
       Then: cd="(No CC# on File)";display; return
  5  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:
       Then: cl(2,.0)=len(cw)
  6  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:     'build expr to show masked cc#
       Then: cd(16,*,g)=repeat("*",cl-"4"){mid(cw,cl-"3","4")
  7  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:
       Then: display; return
  8  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:
       Then: cx(1,*)  'place to stand to trigger cc prc
  9  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
@wefcx   If:
       Then: showctr("23") "     \kB-Change/Clear Credit Card#         "
 10  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:
       Then: display; end
 11  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
@wblcx   If:
       Then: showctr("23") "Enter CC # (leave blank and Enter to Clear)"
 12  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:
       Then: cd=""; display; input("5","8") cc(16,*) ""
 13  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: @sk eq "BRKY"
       Then: gosub showcc; screen ,cx
 14  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: cc eq ""
       Then: cv(20,*)="Clear CC#?"; goto domsgb
 15  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:     '(i.e., if visa/mc, do this type of mask - could use edit
here)
       Then:
cv=mid(cc,"1","4"){"-"{mid(cc,"5","4"){"-"{mid(cc,"9","4"){"-"{mid(cc,"13","
4")
 16  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
domsgb   If:
       Then: msgbox("4","5") cv,"\r Y \r-OK  \r N \r-Reenter", "YN"
 17  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: @bk ne "Y"
       Then: pushkey "[DMAP]"; screen ,cx
 18  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:     'update real and show fields, go on to nxt fld
       Then: 1=cc; gosub showcc; end
 19  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:

Bruce


Bruce Easton
STN, Inc.






More information about the Filepro-list mailing list