Precisely Speaking
May 18, 2012, 02:46:49 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: So what's news with you?  Tell us about it in "Getting To Know You"!
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: CONTROL record maintenance Screens  (Read 3214 times)
DeechVogt
Professional
***
Posts: 12


« on: May 08, 2008, 01:51:52 PM »

What is the best way to design a screen to work on a single control record item in a CONTROL record file.

I've see this done two different ways:

1.) Using Work field definitions and then populating them using a BASIC subroutine in the After Read Rec process slot.  In After Screen Accept process slot another BASIC routine to collect the work variables and write them to the file.

2.) Using regular field definitions and using the Key Source (If Not Inp) with @PARMS(1)<1>:"!CONTROL.REC.NAME"  and SB normal screen reads and writes to display and update the record.

I think it should be done using the 2nd method.  I'm thinking the 1st method was used because of lack of SB+ knowledge.  Are the advantages to the first method?

Thanks,

Deech

« Last Edit: May 09, 2008, 05:17:55 AM by DeechVogt » Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
*****
Posts: 1532



WWW
« Reply #1 on: May 09, 2008, 07:10:51 AM »

My personal opinion is to avoid complication whenever possible.  For this reason I would agree that #2 is the better way.  I've seen all levels of SB+ programmers find creative ways to include BASIC, simply under the assumption that there must be some BASIC somewhere, when really it's necessary only when it's necessary and a waste of effort otherwise.

The simplest approach here is a screen using ordinary field definitions just like any other screen, and if you don't want to prompt for the key, use the Key Source (if not Inp) as that's what it was designed to do.

So the only advantage I can see to the work field method would be the fulfillment of some masochistic fetish.  Otherwise, there's no reason to work that hard for a simple result.
Logged

-Kevin
Accidents "happen"; success, however, is planned and executed.
nmorgan
Professional
***
Posts: 40


Norman Morgan


WWW
« Reply #2 on: May 12, 2008, 01:12:27 PM »

Having looked at a lot of the code in Prelude over the last dozen years, I'd agree that they seem to have a penchant for "doing it the hard way".
Logged

My wife says her life is like a fairy tale.
She married a prince and he turned into a toad.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!