Page 1 of 1

Tutorial / Guide on display information on a workstation (Green Screen)

Posted: Fri Apr 01, 2022 6:51 pm
by sotis
Hello everyone,

I am looking for a beginner friendly Tutorial / Guide (if any) that describes with examples the relevant LANSA commands that can be used to
Display/ Request / user input, etc information on a workstation, in other words any resource that shows how to create a program that displays - receives information to and from the user on a workstation preferably with examples.

all the best,
Sotiris

Re: Tutorial / Guide on display information on a workstation (Green Screen)

Posted: Fri Apr 01, 2022 11:41 pm
by Dino
Hi Sotiris,

Are you going to create them using Visual LANSA or are you working directly in a green screen with an old green screen development license?
What version of LANSA are you currently using?

You can create them in Visual LANSA, and in the past you were able to create them also directly in the green screen.

They are called Process (like menus) and Functions (the actual options/programs), they have to be rdml (uncheck "Enabled for rdmlx" when creating the functions if you want to be able to display a green screen), the functions belong to a process,
functions.jpg
functions.jpg (18.18 KiB) Viewed 5275 times
they have limitations in the data types that can be used while coding in RDML (Alpha, Signed, Decimal or Packed only), and uses a few other old commands like DISPLAY, REQUEST, POP_UP (same as DISPLAY just as a window), SET_MODE, IF_KEY, etc. the tables you can use need to be also "rdml" tables, meaning, using only the data types indicated before and when created in the repository unchecked the "Enabled for rdmlx", and several details more.

A good set of examples of functions code can still be found under PROCESS starting with PSL in the LANSA Repository, those are examples of how to request information, maintain, use popups, prompts, create reports, etc.
functions2.jpg
functions2.jpg (107.46 KiB) Viewed 5275 times
You can find detailed information on DISPLAY, REQUEST, POP_UP, SET_MODE, IF_KEY and other commands under the technical guide in docs.lansa.com with examples how to use:
https://docs.lansa.com/15/en/lansa015/i ... play_e.htm
https://docs.lansa.com/15/en/lansa015/i ... mode_e.htm

Note that for creating of functions, you can use the old templates still available (use the ones starting with FR for full programs, BB for subsets of code)

Those commands, DISPLAY, REQUEST, POPUP are very powerful commands. Basically you tell them what fields to request or display, and they will automatically build the screen, using the descriptions/labels in the repository, they can have functions keys activated that allow you to change mode (like F21=Change and the mode goes from display to change), handle the F4=Prompt automatically, the F1, and if a next INSERT/UPDATE/DELETE command reports a validation error, it is reported automatically back to the screen, which will highlight the fields with error and show you the messages. nowadays... more code is needed to create the same kind of things when working in multilayer web applications...
functions3.jpg
functions3.jpg (160.76 KiB) Viewed 5275 times

Re: Tutorial / Guide on display information on a workstation (Green Screen)

Posted: Sat Apr 02, 2022 12:36 am
by sotis
Hello Dino,

thank you for your answer.
Currently we are using LANSA 13.

I have been provided by my organization with a template as a starting point but there are several small details that is hard to find the relevant documentation.

For example the following field is defined:

DEFINE FIELD(#PB$INST) Type(*Char) Inp_ATR(PBIN) Output_Atr(PBIN)

What is the meaning of the $ sign (if any) in the field definition?

best,
Sotiris

Re: Tutorial / Guide on display information on a workstation (Green Screen)

Posted: Sat Apr 02, 2022 12:41 am
by Dino
That $ sign... was just a valid character at some time to be used in a field name. no particular significance. not allowed anymore in the repository, just in the code of a program for backward compatibility, I guess.