RDMLX for S_211FMF
*
*
* COMPONENT: STD_FORM
*
*
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Height(309) Left(161) Top(118) Width(763)
* Grid with NASDAQ stock quotes
Define_Com Class(#PRIM_GRID) Name(#GRID_1) Columnbuttonheight(21) Displayposition(1) Height(209) Left(0) Parent(#PANL_1) Rowheight(22) Showbuttonselection(True) Showselection(True) Showsortarrow(True) Tabposition(1) Top(0) Width(760)
Define_Com Class(#PRIM_GDCL) Name(#CODE) Caption('Symbol') Captiontype(Caption) Displayposition(1) Parent(#GRID_1) Readonly(False) Source(#S_211VALU) Width(9)
Define_Com Class(#PRIM_GDCL) Name(#STOK_DES) Displayposition(2) Parent(#GRID_1) Source(#S_211CDES) Width(30)
Define_Com Class(#PRIM_GDCL) Name(#TODAY_HIGH) Captiontype(Label) Displayposition(3) Parent(#GRID_1) Source(#S_211THIG) Width(11)
Define_Com Class(#PRIM_GDCL) Name(#TODAY_LOW) Captiontype(Label) Displayposition(4) Parent(#GRID_1) Source(#S_211TLOW) Width(10)
Define_Com Class(#PRIM_GDCL) Name(#YEAR_HIGH) Captiontype(Label) Displayposition(5) Parent(#GRID_1) Source(#S_211YHIG) Width(12)
Define_Com Class(#PRIM_GDCL) Name(#YEAR_LOW) Captiontype(Label) Displayposition(6) Parent(#GRID_1) Source(#S_211YLOW) Width(12)
Define_Com Class(#PRIM_GDCL) Name(#LAST_SALE) Captiontype(Label) Displayposition(7) Parent(#GRID_1) Source(#S_211LAST) Width(14) Widthtype(Remainder)
* Refresh Prices button
Define_Com Class(#PRIM_PHBN) Name(#GETQUOTES) Buttondefault(True) Caption('Refresh Stock Prices') Displayposition(1) Height(28) Left(490) Parent(#PANL_2) Tabposition(1) Top(15) Width(119)
* Connect dialog
Define_Com Class(#VL_SAM003) Name(#VL_SAM003)
*
Define_Com Class(#PRIM_PANL) Name(#PANL_1) Displayposition(1) Height(209) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(0) Width(760)
Define_Com Class(#PRIM_PANL) Name(#PANL_2) Displayposition(2) Left(0) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(208) Width(760)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_1) Buttoncancel(True) Caption('Close') Displayposition(2) Height(28) Left(643) Parent(#PANL_2) Tabposition(2) Top(15) Width(109)
Define_Com Class(#PRIM_STBR) Name(#STBR_1) Displayposition(3) Height(24) Left(0) Messageposition(1) Parent(#COM_OWNER) Tabposition(3) Tabstop(False) Top(258) Width(755)
* 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)
* Working list to pass the symbols to NASDAQ interface
Def_List Name(#NASD_SYMB) Fields(#S_211VALU) Type(*WORKING)
Define Field(#W_ACTION) Type(*CHAR) Length(005)
* Prefil the grid with the default quote symbols
Evtroutine Handling(#com_owner.createinstance)
Execute Subroutine(FILL_QUOTE)
Invoke Method(#getquotes.setfocus)
Endroutine
Evtroutine Handling(#com_owner.Initialize)
Set Com(#com_owner) Caption(*component_desc)
*
Endroutine
* Clicked on Get Quotes button, if not connected show connect dialog. Otherwise, get the quotes.
Evtroutine Handling(#getquotes.Click)
If Cond('*sserver_connected = N')
Invoke Method(#VL_SAM003.uConnectModal)
Execute Subroutine(OP_CL_JSM) With_Parms(OPEN)
Endif
If Cond('*sserver_connected = Y')
Execute Subroutine(GET_QUOTES)
Endif
Endroutine
* 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.
Subroutine Name(GET_QUOTES)
Execute Subroutine(ADD_VALUES)
Use Builtin(CALL_SERVER_FUNCTION) With_Args(AS400 SET211Q Y Y #NASD_SYMB #NASQUOTES) To_Get(#S_RETCDA2)
If Cond('#s_retcda2 = OK')
Execute Subroutine(LOAD_QUOTE)
Endif
Endroutine
* Select the information from the returned working list and add to the grid. Where an invalid quote
* symbol was entered, alphanumeric fields are returned as blanks and numeric ones as zeros
* The first two entries from the NASD_SYMB list are the ones formatted as per Nasdaq service
* requirement, hence the first entry with stock information is number 3.
Subroutine Name(LOAD_QUOTE)
Clr_List Named(#GRID_1)
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(#GRID_1)
Endselect
*
Endroutine
Subroutine Name(ADD_VALUES)
*
Clr_List Named(#NASD_SYMB)
Selectlist Named(#GRID_1)
* Add symbols from Grid
Add_Entry To_List(#NASD_SYMB)
Endselect
*
Endroutine
* Select stock symbols from browselist and add them to the Name-Value working list to pass to the NASDAQ interface.
Subroutine Name(FILL_QUOTE)
*
Clr_List Named(#GRID_1)
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
* Prefill the entries
Subroutine Name(ADD_SHOWQ) Parms((#S_211VALU *RECEIVED) (#S_211CDES *RECEIVED))
Add_Entry To_List(#GRID_1)
Endroutine
Evtroutine Handling(#PHBN_1.Click)
Invoke Method(#com_owner.closeform)
Endroutine
Evtroutine Handling(#COM_OWNER.Closing) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Execute Subroutine(OP_CL_JSM) With_Parms(CLOSE)
Invoke Method(#VL_SAM003.uDisconnect)
Endroutine
* Call SETJSMO to issue a JSM open or close
Subroutine Name(OP_CL_JSM) Parms((#W_ACTION *RECEIVED))
Exchange Fields(#W_ACTION)
Use Builtin(CALL_SERVER_FUNCTION) With_Args(AS400 SETJSMO Y) To_Get(#S_RETCDA2)
Endroutine
*
End_Com
*
*
* COMPONENT: STD_FORM
*
*
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Height(309) Left(161) Top(118) Width(763)
* Grid with NASDAQ stock quotes
Define_Com Class(#PRIM_GRID) Name(#GRID_1) Columnbuttonheight(21) Displayposition(1) Height(209) Left(0) Parent(#PANL_1) Rowheight(22) Showbuttonselection(True) Showselection(True) Showsortarrow(True) Tabposition(1) Top(0) Width(760)
Define_Com Class(#PRIM_GDCL) Name(#CODE) Caption('Symbol') Captiontype(Caption) Displayposition(1) Parent(#GRID_1) Readonly(False) Source(#S_211VALU) Width(9)
Define_Com Class(#PRIM_GDCL) Name(#STOK_DES) Displayposition(2) Parent(#GRID_1) Source(#S_211CDES) Width(30)
Define_Com Class(#PRIM_GDCL) Name(#TODAY_HIGH) Captiontype(Label) Displayposition(3) Parent(#GRID_1) Source(#S_211THIG) Width(11)
Define_Com Class(#PRIM_GDCL) Name(#TODAY_LOW) Captiontype(Label) Displayposition(4) Parent(#GRID_1) Source(#S_211TLOW) Width(10)
Define_Com Class(#PRIM_GDCL) Name(#YEAR_HIGH) Captiontype(Label) Displayposition(5) Parent(#GRID_1) Source(#S_211YHIG) Width(12)
Define_Com Class(#PRIM_GDCL) Name(#YEAR_LOW) Captiontype(Label) Displayposition(6) Parent(#GRID_1) Source(#S_211YLOW) Width(12)
Define_Com Class(#PRIM_GDCL) Name(#LAST_SALE) Captiontype(Label) Displayposition(7) Parent(#GRID_1) Source(#S_211LAST) Width(14) Widthtype(Remainder)
* Refresh Prices button
Define_Com Class(#PRIM_PHBN) Name(#GETQUOTES) Buttondefault(True) Caption('Refresh Stock Prices') Displayposition(1) Height(28) Left(490) Parent(#PANL_2) Tabposition(1) Top(15) Width(119)
* Connect dialog
Define_Com Class(#VL_SAM003) Name(#VL_SAM003)
*
Define_Com Class(#PRIM_PANL) Name(#PANL_1) Displayposition(1) Height(209) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(0) Width(760)
Define_Com Class(#PRIM_PANL) Name(#PANL_2) Displayposition(2) Left(0) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(208) Width(760)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_1) Buttoncancel(True) Caption('Close') Displayposition(2) Height(28) Left(643) Parent(#PANL_2) Tabposition(2) Top(15) Width(109)
Define_Com Class(#PRIM_STBR) Name(#STBR_1) Displayposition(3) Height(24) Left(0) Messageposition(1) Parent(#COM_OWNER) Tabposition(3) Tabstop(False) Top(258) Width(755)
* 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)
* Working list to pass the symbols to NASDAQ interface
Def_List Name(#NASD_SYMB) Fields(#S_211VALU) Type(*WORKING)
Define Field(#W_ACTION) Type(*CHAR) Length(005)
* Prefil the grid with the default quote symbols
Evtroutine Handling(#com_owner.createinstance)
Execute Subroutine(FILL_QUOTE)
Invoke Method(#getquotes.setfocus)
Endroutine
Evtroutine Handling(#com_owner.Initialize)
Set Com(#com_owner) Caption(*component_desc)
*
Endroutine
* Clicked on Get Quotes button, if not connected show connect dialog. Otherwise, get the quotes.
Evtroutine Handling(#getquotes.Click)
If Cond('*sserver_connected = N')
Invoke Method(#VL_SAM003.uConnectModal)
Execute Subroutine(OP_CL_JSM) With_Parms(OPEN)
Endif
If Cond('*sserver_connected = Y')
Execute Subroutine(GET_QUOTES)
Endif
Endroutine
* 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.
Subroutine Name(GET_QUOTES)
Execute Subroutine(ADD_VALUES)
Use Builtin(CALL_SERVER_FUNCTION) With_Args(AS400 SET211Q Y Y #NASD_SYMB #NASQUOTES) To_Get(#S_RETCDA2)
If Cond('#s_retcda2 = OK')
Execute Subroutine(LOAD_QUOTE)
Endif
Endroutine
* Select the information from the returned working list and add to the grid. Where an invalid quote
* symbol was entered, alphanumeric fields are returned as blanks and numeric ones as zeros
* The first two entries from the NASD_SYMB list are the ones formatted as per Nasdaq service
* requirement, hence the first entry with stock information is number 3.
Subroutine Name(LOAD_QUOTE)
Clr_List Named(#GRID_1)
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(#GRID_1)
Endselect
*
Endroutine
Subroutine Name(ADD_VALUES)
*
Clr_List Named(#NASD_SYMB)
Selectlist Named(#GRID_1)
* Add symbols from Grid
Add_Entry To_List(#NASD_SYMB)
Endselect
*
Endroutine
* Select stock symbols from browselist and add them to the Name-Value working list to pass to the NASDAQ interface.
Subroutine Name(FILL_QUOTE)
*
Clr_List Named(#GRID_1)
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
* Prefill the entries
Subroutine Name(ADD_SHOWQ) Parms((#S_211VALU *RECEIVED) (#S_211CDES *RECEIVED))
Add_Entry To_List(#GRID_1)
Endroutine
Evtroutine Handling(#PHBN_1.Click)
Invoke Method(#com_owner.closeform)
Endroutine
Evtroutine Handling(#COM_OWNER.Closing) Options(*NOCLEARMESSAGES *NOCLEARERRORS)
Execute Subroutine(OP_CL_JSM) With_Parms(CLOSE)
Invoke Method(#VL_SAM003.uDisconnect)
Endroutine
* Call SETJSMO to issue a JSM open or close
Subroutine Name(OP_CL_JSM) Parms((#W_ACTION *RECEIVED))
Exchange Fields(#W_ACTION)
Use Builtin(CALL_SERVER_FUNCTION) With_Args(AS400 SETJSMO Y) To_Get(#S_RETCDA2)
Endroutine
*
End_Com