Precisely Speaking
May 21, 2012, 06:34:57 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: So what's news with you?  Tell us about it in "Getting To Know You"!
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Limiting Input Length Question  (Read 1135 times)
TomJoyce
Newbie
*
Posts: 1


« on: October 07, 2010, 10:35:48 AM »

I have found just one method for limiting input length in SB+ fields: setting a negative value (eg -10) in Length of Field.  There is just one problem with this: it automatically exits the field when the length is reached.  Is there any way to prevent this from happening, akin to the INPUT x,10_ syntax in uniVerse and uniData?

Tom Joyce
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #1 on: October 07, 2010, 10:47:44 AM »

As far as I know there is no feature in SB+ that is analogous to the _ feature on the U2 BASIC INPUT statement.  Usually this is handled via validation; let the user enter what they're going to enter and then bark at them if it's too long.  Not quite as elegant, but any given user usually won't hit it more than a couple of times.
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
Tom Pellitieri
Rock Star
*****
Posts: 171


Tom Pellitieri - Toledo, Ohio


« Reply #2 on: October 08, 2010, 05:35:05 AM »

A global solution would be to change the Autoextend Field Length option to "N" in User Security.  This would affect all fields in all screens.  They would then need to use the Extend Field Length key (default appears to be Shift+End) to enter a longer value.

Of course, this is an "all or nothing" solution.  Also, the system just ignores anything beyond the field length, so someone might not notice that it's missing during data entry.

--Tom
Logged
davisd
Professional
***
Posts: 15


« Reply #3 on: October 08, 2010, 05:43:32 AM »

Negative length is supposed to move to the next field after the length is met, although there is at least one circumstance where it doesn't - if you are using it in a field in an mv grid, and you type all zeros, it doesn't auto-return out.

In addition to the other ideas, you can also clip the length of @VALUE in the validation process for the field.
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #4 on: October 08, 2010, 08:00:29 AM »

Really good ideas on this question!  Adding to what Tom said, if you disable the Auto-Extend Field Length system wide then you could data stack that extend length key in the Process Before on the prompts that you do want extended.  Something like this paragraph:

DATA "@12"

..and maybe call it "EXTEND.LENGTH" in /PD.P, then you could use EXTEND.LENGTH in any PB where the field should be extended. 

Probably more work than it's worth but definitely an interesting idea.  It does beg the question, tho.  Why isn't there a key that lets us disable the auto-extend field length?  I realize that with the new Xploding Architecture any changes to the fundamentals of SB+ are probably not going to happen, but I still wonder..
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
rhettler
Associate
**
Posts: 6


« Reply #5 on: October 11, 2010, 01:44:40 PM »

@USER.KEYS<1,6>=0 should turn auto extend length off
@USER.KEYS<1,6>=1 should turn auto extend length on
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #6 on: October 11, 2010, 02:13:39 PM »

...and that can be done on any prompt - like on a Process Before or Default process?
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
rhettler
Associate
**
Posts: 6


« Reply #7 on: October 11, 2010, 06:23:06 PM »

Yes.  Probably need to save off the user's personal setting into a work variable in the process before, set the flag as desired and then reset the variable to the user's original setting in the process after.
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #8 on: October 11, 2010, 07:35:38 PM »

Awesome, thanks!
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!