RDML for SET211W

LANSA

RDML for SET211W
* =======================================================
* Process ........: SET_211
* Function .......: SET211W
* Created on .....: 19/10/01 at 11:41:13
* Description ....: Function Skeleton
* Version.........: 1
*
* Full Description:
*
* This Lansa for the Web function shows a browselist
* with stock symbols for 5 popular NASDAQ stocks:
* IBM (IBM), Microsoft (MSFT), Sun Microsystems (SUNW),
* Apple Computers (AAPL) and Compaq (CPQ).
* You can overwrite any of these symbols by typing over
* them. Click the 'Refresh Prices' button to call the
* NASDAQ interface SET211Q and obtain the stock prices
* from the NASDAQ service. The stock symbols are passed
* in the working list #NASD_SYMB.
*
* Disclaimer: The following material is supplied as an
* example only. No warranty is expressed or implied.
*
* ======================================================*
Function Options(*DIRECT *WEBEVENT)
*
Define Field(#S_211DESC) Reffld(#STD_DESCL) Input_Atr(LC)
*
Define Field(#S_CLICKED) Type(*CHAR) Length(030) Default('FORM.INITIALIZE')
* Working list to pass the symbols to NASDAQ interface
Def_List Name(#NASD_SYMB) Fields(#S_211VALU) Type(*WORKING)
* Browselist to type in the Stock symbol
Def_List Name(#S_211CODE) Fields((#S_211VALU *INPUT) #S_211CDES #S_211THIG #S_211TLOW #S_211YHIG #S_211YLOW #S_211LAST) Counter(#LISTCOUNT)
* Fields for outbound working list with NASDAQ quotes.
* This list is returned by JSM with the Stock quotes
Def_List Name(#NASQUOTES) Fields(#S_211ISSU #S_211THIG #S_211TLOW #S_211YHIG #S_211YLOW #S_211LAST) Type(*WORKING)
*
Group_By Name(#PANELDATA) Fields((#S_CLICKED *HIDDEN) (#S_211DESC *NOID) (#S_211REFR *NOID))
*
Clr_List Named(#NASQUOTES)
*
* Add quotes symbols of the stocks to inquire
* and display the browselist
Case Of_Field(#S_CLICKED)
When Value_Is('= FORM.INITIALIZE')
* first time select stock symbols from browselist and add
* them to the Name-Value working list to pass to the
* NASDAQ interface.
Execute Subroutine(FILL_QUOTE)
Otherwise
* Call SETJSMO to open JSM
Execute Subroutine(OP_CL_JSM) With_Parms(OPEN)
* Subsequent times, select from the browselist and add
* to the NASD_SYMB working list.
Execute Subroutine(FILL_NAMVA)
* Call the NASDAQ interface function passing the
* NASD_SYMB working list and the NASDAQ Quotes
* working list that will be returned with the Stock
* information. If the list is blank, it will get the
* prices of the default stocks shown the first time
Execute Subroutine(PAS_NAMVAL)
* Select the information from the returned working list
* and add to the browselist. Where an invalid quote
* symbol was entered, alphanumeric fields are returned
* as blanks and numeric ones as zeros
Execute Subroutine(LOAD_QUOTE)
* Close JSM
Execute Subroutine(OP_CL_JSM) With_Parms(CLOSE)
*
Endcase
*
Request Fields(#PANELDATA) Browselist(#S_211CODE) Exit_Key(*NO) Menu_Key(*NO) Prompt_Key(*NO)
*
Subroutine Name(PAS_NAMVAL)
Call Process(*DIRECT) Function(SET211Q) Exit_Used(*NEXT) Menu_Used(*NEXT) Pass_Lst(#NASD_SYMB #NASQUOTES)
Endroutine
*
Subroutine Name(FILL_NAMVA)
Execute Subroutine(ADD_VALUES)
*
If Cond('#listcount = 0')
Execute Subroutine(FILL_QUOTE)
Execute Subroutine(ADD_VALUES)
Endif
Endroutine
*
Subroutine Name(ADD_VALUES)
Selectlist Named(#S_211CODE) Get_Entrys(*NOTNULL)
* Add input symbols to working list to exchange with
* NASDAQ interface
Add_Entry To_List(#NASD_SYMB)
Endselect
*
Endroutine
*
Subroutine Name(FILL_QUOTE)
*
Clr_List Named(#S_211CODE)
Execute Subroutine(ADD_SHOWQ) With_Parms(IBM 'Symbol of IBM Stock')
Execute Subroutine(ADD_SHOWQ) With_Parms(MSFT 'Symbol of Microsoft Stock')
Execute Subroutine(ADD_SHOWQ) With_Parms(SUNW 'Symbol of Sun Microsystems Stock')
Execute Subroutine(ADD_SHOWQ) With_Parms(AAPL 'Symbol of Apple Stock')
Execute Subroutine(ADD_SHOWQ) With_Parms(CPQ 'Symbol of Compaq Stock')
*
Endroutine
*
* Select from the returned list with stock information
* and add to the browselist.
* Get the Stock symbol from the symbols working list
Subroutine Name(LOAD_QUOTE)
Clr_List Named(#S_211CODE)
Change Field(#LISTENTRY) To(0)
Selectlist Named(#NASQUOTES)
Change Field(#LISTENTRY) To('#listentry + 1')
Get_Entry Number(#LISTENTRY) From_List(#NASD_SYMB)
Change Field(#S_211CDES) To(#S_211ISSU)
Add_Entry To_List(#S_211CODE) With_Mode(*DISPLAY)
Endselect
*
Endroutine
*
Subroutine Name(ADD_SHOWQ) Parms((#S_211VALU *RECEIVED) (#S_211CDES *RECEIVED))
Add_Entry To_List(#S_211CODE) With_Mode(*DISPLAY)
Endroutine
*
Subroutine Name(OP_CL_JSM) Parms((#W_ACTION *RECEIVED))
Define Field(#W_ACTION) Type(*CHAR) Length(005)
Group_By Name(#S_EXCHFLD) Fields(#S_JSMSTS #S_JSMMSG #W_ACTION)
Exchange Fields(#S_EXCHFLD)
Call Process(*DIRECT) Function(SETJSMO) Exit_Used(*NEXT) Menu_Used(*NEXT)
Endroutine
*