Assign Variable = Self:Screen-Value

paulwesterman

New Member
Is there a way to assign a variable the screen-value the user inputs without explicitly making the assignment to the underlying variable. In other words, I have a screen with several fill-in fields and I wonder if there some type of code similiar to:

on leave anywhere do:
if self:type = 'fill-in'
then assign self:value = self:screen-value
end.

to assign the underlying variable v-value, v-other-value, etc, etc, etc the value of the user input

instead of writing

on leave of v-value do:
assign v-value = self:screen-value.
end.

on leave of v-other-value do:
assign v-other-value = input v-other-value.
end.

etc, etc, etc.

I realize that 'value' is an attribute of the clipboard system handle but I don't know what the right code would be.

I am using Progress Version 9.1D07 - character.
 
Something has to trigger the assign, doesn't it? screen values don't automatically get assigned, so yes you do have to do it on idividual basis.

Why do you need to assign all screen values right after they've been entered other than you need to validate them right away? You could do everything on 'save-record'.
You can group all the variables into one pre-processor name (&scoped-define)
and in this case you'll only need 1 line of code:
assign {&variable-name}.
And then do your validation?
 
I do entry validation on the leave of the field with the code:
on leave anywhere do:
if self:type = 'fill-in'
and self:screen-value = ''
then do:
message self:label ' cannot be blank'.
apply 'entry' to self.
end.
end.

and this does just fine for me in most cases. I also have used one update procedure to assign all the variables - I was just looking for a shortcut.

Thanks,
Paul
 
Back
Top