🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2568

Re: Field-level validation in dialog/edit?

#2568
From: Glenn Wallace
Date: Sat, 11 May 1991 00:59
35 lines
2178 bytes
In article <24676@well.sf.ca.us>, al@well.sf.ca.us (Alfred Fontes) writes:
> Does anybody have an opinion about the fastest and simplest way to check
> the format of data typed into edit controls?  For example, making sure
> that a number is actually a floating-point number within the required
> range?  Is there any source code around to perform this kind of checking?
> 
> Al Fontes
> al@well.sf.ca.us
> uunet!apple!well!al

Funny you should mentions this... we just recently asked MS about it.

Their suggestion was to sub-class the edit control, and handle
the keystrokes there and filter them, but it still sounds kinda messy.
Of course, you can also either write your own edit control (cough!)
or validate on termination of the dialog (not user-friendly).

We wanted an edit field, with an almost (gasp) cobol like picture
clause.

They also suggested we use the Excel "cell" format definition standard
and translate the cobol pic clauses to that.

But overall, no big help as to how to code it.

+-------------------+-----------------------------------------+
| Glenn Wallace     | Net: drift@qut.edu.au                   |
| Drift Project     | Fone: +61 7 837-7126 Fax: +61 7 221-0173|
| Telecom Australia | Snail: 11th Flr 144 Edward St.,         |
+-------------------+        Brisbane, Q4000 Australia        |
|                                                             |
| Disclaimer - The opinions expressed must be my own, because |
|              Telecom is a statuatory authority and as such, |
|              is not capable of having opinions.             |
+-------------------------------------------------------------+
Technical Details
Message-ID: <1991May10.195911.28738@qut.edu.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!rochester!crdgw1!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!brolga!bunyip.cc.uq.oz.au!qut.edu.au!drift
References: <24676@well.sf.ca.us>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!rochester!crdgw1!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!brolga!bunyip.cc.uq.oz.au!qut.edu.au!drift
From: drift@qut.edu.au (Glenn Wallace)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Field-level validation in dialog/edit?
Message-ID: <1991May10.195911.28738@qut.edu.au>
Date: 11 May 91 00:59:11 GMT
References: <24676@well.sf.ca.us>
Distribution: comp
Organization: Queensland University of Technology
Lines: 35