Programming question

Richard Kreiss rkreiss at verizon.net
Fri Jun 2 10:06:17 PDT 2017


> -----Original Message-----
> From: Filepro-list [mailto:filepro-list-
> bounces+rkreiss=verizon.net at lists.celestial.com] On Behalf Of WILLIAM LUCCA
> via Filepro-list
> Sent: Friday, June 2, 2017 11:40 AM
> To: Richard D. Williams <richard at appgrp.net>; filepro-list at lists.celestial.com
> Subject: Re: Programming question
> 
> Perhaps I don't have the full picture here, but why not just make 2 separate
> options on the Filepro menu, "New Owner" and "New Resident" and call the
> appropriate program (and screen) directly from the menu line.
> 

This is what I currently doing. 

1. first program - select option
2. After option selected, program branches via chain, to the proper input program.
3. Program loads and loads the associated screen.

The issue I had was using Screen "name",Ad (address field).

According to the manual, that line should have loaded either the New_Resident or New_owner screen and put the cursor into the address field(ad).  This didn't work.

However, changing the code to 	switchto (name);pushkey "u" put the cursor into filed ad on that screen as this is the first field in the upper left of the screen.

My question was/us why didn't the screen command work as explained in the filePro manual.

>From the 5.8 manual

Description:

On the Automatic table, SCREEN is used to access one screen rather than another, and make this screen the default screen. The default screen is the screen Input processing and @KEY processing will returns to when an END statement is encountered.

1) When a SCREEN command is encountered during Input or @KEY processing, the user is put into update mode on the designated screen. When the user presses <ESC> to record the input on this screen, processing will resume with the command immediately following the SCREEN command.

2) When a SCREEN command is encountered during @WLF or @WEF processing, the user is put into update mode on the designated screen. When the user presses <ESC> to record the input on this screen, processing ends. @WLF and @WEF processing are not considered Input processing. These routines run independently from Input processing, and do not affect the position of the Input processing's execution pointer. Each @WLF and @WEF routine has its own pointer, and processing ends for these special routines only when one of the specific @WLF, @WEF "closing" commands is encountered. SCREEN is one of these commands.

Restrictions:

If there is more than one SCREEN statement on an automatic processing table, only the last SCREEN statement encountered is performed.

SCREEN can only be used on Input and Automatic processing tables.

I may have my own answer to this problem, When I chained out, my processing was not in input processing mode, I was just in the "inquire" more with filePro waiting for a key to be pressed.  Therefore, I needed to use SWITCHTO and PUSHKEY to get the user to input mode. (See #1 above)

Richard



> 
> 
> 
>     On Friday, June 2, 2017 10:55 AM, Richard D. Williams via Filepro-list <filepro-
> list at lists.celestial.com> wrote:
> 
> 
>  Richard,
> 
> I can't give you a direct answer, I would not recommend using "chain".
> 
> I would use "call" and popup  the correct screen for each option.
> 
> Hope this helps,
> 
> Richard D. Williams
> 
> On 6/1/2017 10:11 AM, Richard Kreiss via Filepro-list wrote:
> > I have written an application for my community and are using some
> programming techniques I do not normally use.
> >
> > The database of residents already exists in filePro as I updated the records
> from an Excel import of current residents.
> >
> > When a unit is sold and there is a new owner and/or other residents moving
> into a home, I wrote  Library routines to handle this.
> >
> > >From a menu option the user is presented with a 2 menu options
> >
> > \fp\rclerk library -s Blank -x start_new_resident -y !!
> >
> >
> > 1.      New Owner
> >
> > 2.      New Resident
> >
> > When an option is selected, the program chains to the proper input
> > program
> >
> >
> > 1.      New_owner
> >
> > 2.      New_resident
> >
> > The initial programming is the same for both except for the screen used for
> input.
> >
> > Question: Program had to change screens from blank to either the new_owner
> screen or the new_resident screen.
> >
> > Code:
> >
> > If: @sn ne "new_owner"
> > Then: SCREEN "new_Owner",AD
> > This code doesn't place the cursor in field AD (address).  The cursor just sits
> waiting for <U> to be pressed. I have tried pushkey "U" before and after the
> screen command.
> >
> > The filePro manual states that using screen "name",Field # in an input table will
> put the cursor in the field specified.  Why is this not working?
> >
> > The code that does work is:
> > If: @sn ne "new_owner"
> > Then: swithto "new_owner";pushkey "U"
> >
> > The reason for two separate programs is that the new owner program will
> delete all the peripheral files associated with that owner but leave the files that
> are associated with the unit(home).
> >
> > Richard Kreiss



More information about the Filepro-list mailing list