Category : Paradox DBMS
Archive   : SVOUTP.ZIP
Filename : PORTFOL.ACT

 
Output of file : PORTFOL.ACT contained in archive : SVOUTP.ZIP
;*************************************************************************
; Action Diagram
; Date : 03/03/89
; Time : 10:22:27 pm
;
; System : Paradox3 Toolkit Samples
; File Name : d:\paradox3\sampapp\portfol.sc
; By : Borland International
; Last modified 12/21/88 01:00:02 am
; Copyright (c) 1988 Borland International
;*************************************************************************

1 ; SCRIPT: PORTFOL.SC
2 ; Version: 3.0
3 ; Date: 04 November 1988
4 ;
5 ;
6 ; This script defines the procedures that display a summary of holdings
7 ; in a specific portfolio (as requested by the user). It functions
8 ; in a similar manner to HOLDINGS.
9
10 ÚÄÄÄPROC PortMenu()
11 ³ CLEAR
12 ³ PAINTCANVAS ATTRIBUTE 31 0,0,24,79
13 ³ STYLE ATTRIBUTE 30
14 ³ @5,0
15 ³ TEXT
16 ³ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
17 ³ º °°°° STOCKS APPLICATION °°°°°°°°°°°°°°°°°°°°°°°°° PORTFOLIO MENU °°°°°°°°°°° º
18 ³ ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
19 ³ º Auto Industry º Use Auto Industry Portfolio. º
20 ³ ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
21 ³ º Blue Chip º Use Blue Chip Portfolio. º
22 ³ ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
23 ³ º High Tech º Use High Tech Industry Portfolio. º
24 ³ ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÎÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
25 ³ º MainMenu º Exit Porfolio Menu and return to Main Menu. º
26 ³ ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
27 ³ ENDTEXT
28 ³ PAINTCANVAS ATTRIBUTE 78 6,7,6,24
29 ³ PAINTCANVAS ATTRIBUTE 46 6,52,6,65
30 ³ STYLE
31 ÀÄÄÄENDPROC
32
33 ÚÄÄÄPROC CLOSED SpecificPort()
34 ³ PRIVATE x
35 ³ Cursor OFF
36 ³ ÚÄÄÄIF (NOT AskPortName()) ; Get a portfolio name from user
37 ³ ³ THEN
37 <ÄÄÄÄÄÄÄÄÄÄÄRETURN ; User didn't supply name, so return
38 ³ ÀÄÄÄENDIF
39 ³ ÕÍÍÍWHILE (NOT Charwaiting()) ; For as long as user doesn't press key
40 ³ ³ CLEARALL ; | - clear the workspace
41 ³ ³ SpecQuery1() ; | - put the portfolio query on workspace
42 ³ ³ ÕÍÍÍWHILE (TRUE) ; |
43 ³ ³ ³ LOCK "Price" WL ; | - can we get the table?
44 ³ ³ ³ ÚÄÄÄIF (retval) THEN
44 ³ ³ <ÄÄÄÄÄÄÄÄÄÄÄQUITLOOP
44 ³ ³ ³ ÀÄÄÄENDIF ; | yes, so go on
45 ³ ³ ³ SLEEP 500 ; | no, so pause before retrying
46 ³ ³ ÀÄÄÄENDWHILE ; |
47 ³ ³ DO_IT! ; | - process the query
48 ³ ³ UNLOCK "Price" WL ; | - give up lock on table
49 ³ ³ CLEARALL ; |
50 ³ ³ VIEW "Answer" ; | - take the resultant ANSWER table and...
51 ³ ³ MOVETO [Total Share Price] ; |
52 ³ ³ MOVETO [Ticker] ; |
53 ³ ³ ECHO NORMAL ; | - turn on ECHO to see results
54 ³ ³ PROMPT "Portfolio for " + portname + " as of " + Time(),
55 ³ ³ "Total Portfolio value is $" +
56 ³ ³ FORMAT("W12,AL,EC",Csum("Answer", "Total Share Price")) +
57 ³ ³ " -- Press Any Key to Quit"
58 ³ ³ ECHO OFF ; | - turn off ECHO so user doesn't see next query
59 ³ ÀÄÄÄENDWHILE ; Return to top of the loop
60 ³
61 ³ ; If we drop out of above loop, user must have pressed a key
62 ³
63 ³ x = Getchar() ; Gobble up the keystroke
64 ³ CLEARALL ; And erase the workspace
65 ³ CLEAR ; ...and canvas
66 ÀÄÄÄENDPROC
67
68 ; SpecQuery1 puts the query that does all the work onto the workspace.
69 ; Note:
70 ; - the tilde variable ~portname supplies the portfolio name
71 ; - calc _p * _sh calculates total value for a stock
72
73 ÚÄÄÄPROC SpecQuery1()
74 ³
75 ³ QUERY
76 ³
77 ³ Price | TICKER | PRICE | LAST |
78 ³ | Check _tick | Check _p | Check |
79 ³
80 ³ Holding | PORTFOLIO | SYMBOL | SHARES |
81 ³ | ~portname | _tick | Check _sh, calc _p * _sh as Total Share Price |
82 ³
83 ³ ENDQUERY
84 ÀÄÄÄENDPROC
85
86 ; AskPortName does the job of requesting and accepting from the user the
87 ; name of the portfolio to display a summary of.
88
89 ÚÄÄÄPROC AskPortName()
90 ³ PRIVATE n,Nams,Prompts
91 ³ ; First we must get the names of the Portfolios
92 ³ MENU {Ask} SELECT "Holding" ; HOLDING table has names of portfolios
93 ³ MOVETO [Portfolio] ; Portfolio names are in Portfolio Field
94 ³ CHECK ; So CHECK that field
95 ³ DO_IT! ; and perform a query to get names into table
96 ³ n = Nrecords("Answer") ; User has n portfolios (names now in Answer)
97 ³ ARRAY Nams[n+1] ; Create an array to put the names into
98 ³ ARRAY Prompts[n+1] ; And another array to store prompts for names
99 ³ ÕÍÍÍSCAN ; SCAN through each record of Answer to fill arrays
100 ³ ³ Nams[ Recno() ] = [Portfolio]
101 ³ ³ Prompts[ Recno() ] = "Use the " + [Portfolio] + " portfolio"
102 ³ ÀÄÄÄENDSCAN
103 ³ Nams[n+1] = "MainMenu"
104 ³ Prompts[n+1] = "Exit out of Portfolio Menu and return to Main Menu"
105 ³ CLEARALL
106 ³
107 ³ CANVAS OFF
108 ³ PortMenu() ; Print Portfolio Menu Box
109 ³ CANVAS ON
110 ³ SHOWARRAY Nams Prompts 111 ³ TO Portname ; Display portfolio names in a Paradox-style menu
112 <ÄÄÄÄÄÄÄRETURN(Portname <> "Esc" and Portname <> "MainMenu")
113 ³
114 ÀÄÄÄENDPROC


  3 Responses to “Category : Paradox DBMS
Archive   : SVOUTP.ZIP
Filename : PORTFOL.ACT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/