HP3000-L Archives

November 2004, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Roy Brown <[log in to unmask]>
Reply To:
Roy Brown <[log in to unmask]>
Date:
Fri, 5 Nov 2004 09:19:14 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (70 lines)
In message <[log in to unmask]>, Brian Donaldson
<[log in to unmask]> writes
>Sorry for the non-OT postings. I'm sure this posting is interfering
>with all the wonderful post-election rhetoric going on :-)
>
>How can my app (Cobol program) change the length of a field
>programmatically via VCHANGEFIELD ?
>
>I have a field in a form that is defined in Formspec as CHAR for a length
>of 40.
>
>Regardless of whether this form is a parent or child form I have a need
>(depending on the situation) to change the CHAR 40 to CHAR 60.
>
>Can this be done with VCHANGEFIELD or do I have to create a new form
>that defines the field as CHAR 60 ?

The trouble with extending fields on the fly is that VPLUS is never sure
what it might push off the right hand side as a result :-)

So it doesn't do this sort of thing.

However, don't raise the bridge, lower the river; consider how, with a
60-character field or fields on the screen, you can limit input to 40
characters when required.

Suggestion (i):

On your form, add a second field contiguous with the first that is 20
characters long.

When you want to use it, highlight it and accept input in it. When you
do not, remove the enhancements and make it display only.
(VCHANGEFIELD will let you do these things, at least).

If, when the second field is in use, your user puts in less than 40
characters, then a tab will take him to the second field, slightly
unexpectedly looking like it's two-thirds of the way along the composite
field, instead of to the next field.

(Explain that tab is getting weaker as VPLUS ages, and can't jump as far
as it used to).

And you may have to tweak the validation rules a little.

Suggestion (ii):

Always have the 60-char field, but restrict input to no more than 40
characters when that is appropriate. VPLUS has a MINLEN, but never saw
the need for a MAXLEN, figuring that field size would do it.

However, I daresay you could write a MATCH criterion, or some such, that
would accept up to 40 characters but no more, and put it on an IF,
always assuming that the 40/60 criterion is available to the VPLUS form,
and not just  to your program code.

To help the user know what is in force, you could put a display field
above the 40/60 field, and toggle it between <------>  (40)  and
<-------------> (60) as appropriate.

And if you did, the VPLUS form could test that, to know whether to allow
 >40 characters or not at the right times.

--
Roy Brown        'Have nothing in your houses that you do not know to be
Kelmscott Ltd     useful, or believe to be beautiful'  William Morris

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2