The SHOW statement gives you great flexibility in presenting information to the user at virtually any point during a filePro program. The basic syntax is very simple:
Syntax :
show "message"
This will place the message on Line 23 of the screen and center it for you. The message can not exceed 80 characters.
The "message" can be any expression allowed in filePro. For example, the "message" could be made up of the contents of a field.
show 14
This would simply put the contents of field 14 on the screen. It might be nicer to do it like this, though:
show "Field 14 contains"<14
This will print the text "Field 14 contains" and then leave one space and print the actual contents of field 14. The < operator is just that a "push left" operator. It tells filePro to push the next value one space away from the preceding text or value. There is another operator like <. It is {. This is called a "squeeze left" operator because it does not leave the one space the < does. It would squish the contents of field 14 right next to the letter "s" of the word contains.
If you wanted to print the content of several fields, you could do something like:
show 14<15<16
Assuming that these were City State and Zip fields, you might see:
Oakland NJ 07436
Again, the show command will mix and match text and expressions (a field is nothing but an expression, by the way, albeit a very simple one.) You could get elaborate, like this:
show 14{","<15<16
This would print the following on the screen:
Oakland, NJ 07436
There is one more important string operator (that is what the < and { are called). The third and final string operator is the &. It simply puts the values it is connecting next to each other without leaving a space, squishing out space or doing anything at all. The same show statement above done with the & instead of the < or { would do this:
show 14&","&15&16
Oakland ,NJ07436
Why? Because the contents of field 14 do not entirely fill up field 14. Usually a city field has about 15 characters in it and Oakland only takes up 7. The & operator tells filePro to just place the next expression "next" to the previous one, do not add or take away any spaces so it does. FilePro knows how long field 14 really is and that is what it uses when you use the & operator. The same is true for the literal "," which is only 1 character long, so the state field NJ butts right up against it. State fields are only two characters long so the zip field butts right up against that and we are left with the funny mish-mosh above. Using the < and { and the & correctly allows you to format output to look just about any way you want it to look. For example, you could do something like this:
show "The contents of field 14 15 and 16 are:" < 14 { "," < 16 & " and I live there!"
The formatting will follow your instructions to the letter. The "<" operator will also work on output reports that you design.
When you join two or more fields with the & operator, you are "concatenating the fields". This means you are joining the fields right next to each other without taking away or putting any extra spaces. If you join a 14 character field and a 25 character field in this way, you need a 29 character place to put them either screen, paper, or dummy variable.
Reverse Video inside SHOW .
Any part of the message can be shown in "reverse video" (highlighted) by using the reverse video codes inside the message area, as in:
show "Are you \rSure\r you want to delete this record? (y/n)"
Anything between the two \rs will show up highlighted.
SHOW(r,c) message
There is a valuable variation to the show command. You can assign the row and column on which the message will appear. When you do this, the message is NOT automatically centered anymore. You would use:
show("10","4") "Please enter a bigger number here."
And it would appear at that point on the screen.
SHOWCTR(r) "message" command.
If you want to center a message on a line other than line 23, use the showctr command.
showctr("10") "I am in the middle of the screen."
NOTE: SHOWCTR must have a line number specified.
IMPORTANT: You can use SHOW to stop the user dead in their tracks. They must acknowledge that they have read your show message by pressing ENTER. To do this, put an @ as the first character after the opening quote of your message text.
show " @ The balance due is TOO HIGH!"
This will print on the screen as follows:
The balance due is TOO HIGH!
Press ENTER to Continue
The word ENTER will be surrounded by a highlight. The user can not do anything else but press Enter if he wants to continue working.
If you were to have no message text, the @ still works, just put it inside quotes by itself:
show "@"
Produces
Press Enter to Continue
The use of the @ does not preclude mix and matching expressions to form your message text.
show "@The balance due is $"{22<"This is TOO HIGH!"
You can obtain more emphasis by issuing a BEEP command along with various messages. This keeps the user on his toes. Otherwise, they are likely to start ignoring things. Just put the command BEEP immediately before your SHOW statement.
If:
Then: beep ; show "@Call this guy up right now."
Clearing a SHOW statement
If you do not use the @ which will stop the user at the SHOW line and then automatically clear the show message, the text of your message will remain on the screen until you take it down (or until a variety of other things clear it.) For the most part, it is up to you to clear things that you put on the screen. If you are clearing the default show line (#23), you can just issue the command:
show ""
This, of course, means SHOW nothing, so the line is essentially rewritten with nothing anything that was there will be cleared.
If, on the other hand, you have shown something on a different part of the screen, you must clear it yourself with the same amount of spaces that your message used. In other words if you issue:
show("10","3") "Error, bad code"
Later, when you want to remove the show message from that location, you would have to do something like:
show("10","3") " " <=there are 15 spaces here
This would "cover up" the message with blanks.
There is a short hand for this using a dummy variable. You could assign a dummy variable the length of 15 and set this variable equal to nothing and then show that variable on the screen. This would accomplish exactly the same thing.
aa(15)="" ; show("10","3") aa
IMPORTANT
Please note that you can put more than one command on a "then" line as long as you separate them by semi-colons. Also note that SPACES are not important between commands. That is, you can use:
show "@Did you see this";show "@Are you sure?"
Or
show "@Did you see this?" ; show "@Are you sure?"
SHOW POPUP
This is the same as the SHOW command except that it puts your message inside a box that is centered on the screen. Everything works the same as the simple SHOW command, including the @ for stopping the user and making him press ENTER.
show popup "I m boxed in the middle."
The SHOW POPUP command can also place the box anywhere on the screen within the limitations of the row and column designations that will fit the whole box. The row and column designate the top left corner of the popup box.
Syntax
show popup(r,c) message
There is one more variation to SHOW POPUP. It allows you to number the boxes you put on the screen.
Show popup(r,c,popupnum) message
This means you can put several messages anywhere on the screen simultaneously. The number.
Clearing Show Popups
You must clear show popups with the CLEARS # command. You must issue the clears command with the number of the popup you are taking down (off the screen). If you overlap the show popups, they must be taken down in reverse order of the way they were put up.