VSCROLL :doesn't work (Second edition Programming in True BAsic ,stewart venit) -> explain bug V6.07 gold (below example)

I give lot input : you never see VSCROLL bar .

How can you solve this problem ?

! ************** An Employee Earnings Report **************
! by S. Venit & S. Schleiffers

! This program computes the net monthly income
! (gross salary - deductions) for a salesperson
! using a GUI Environment.

! Variables:
! BaseSalary ....... Salary before commissions are added
! Commissions ...... Amount of commissions earned
! Deduction1 ....... For federal tax
! Deduction2 ....... For state tax
! Deduction3 ....... For retirement contribution
! Deductions ....... Total deductions
! Employee$ ........ Name of salesperson
! GrossSalary ...... Base salary + commissions
! NetSalary ........ Gross salary - deductions
! Sales ............ Total sales by salesperson

! Edit Field Inputs as Strings:
! Employee$ ........ Employee name
! BSalary$ ......... Base Salary
! Sales$ ........... Total sales by salesperson

! ID Numbers for Elements:
! Window IDs ....... Wid, W2
! SText Box IDs .... Nm_Id, Bs_Id, S_Id
! Edit Field IDs ... Name_Id, Base_Id, Sales_Id
! Push Button IDs .. Outp_Id, Calc_Id, Quit_Id

! Subprograms:
! WelcomeMessage ... Displays a welcome message
! ComputeResults ... Calculates deductions and salary
! PrintResults ..... Displays the values of all variables

LIBRARY "TrueCtrl.trc"
CALL TC_Init
CALL TC_Win_Create (Wid,"CLOSE|SIZE|TITLE", .1, .9, .6, .9)
CALL TC_Win_SetTitle (Wid,"MAIN")
CALL TC_Win_Create (W2,"Title|Vscroll|Close", .1, .9, .1, .6)
CALL TC_Win_SetTitle (W2,"RESULTS")

CALL TC_Show (Wid)
CALL TC_Win_Active (Wid)

! Create Edit Field Controls
CALL TC_Stext_Create (Nm_Id,"Employee",.25,.4,.7,-99999)
CALL TC_Edit_Create (Name_Id, "", .4, .65, .7, -99999)
CALL TC_Stext_Create (Bs_Id,"Base Salary",.25,.4,.6,-99999)
CALL TC_Edit_Create (Base_Id, "", .4, .65, .6, -99999)
CALL TC_Stext_Create (S_Id,"Sales",.25,.4,.5,-99999)
CALL TC_Edit_Create (Sales_Id, "", .4, .65, .5, -99999)

! Create Push Button Controls
CALL TC_PushBtn_Create (Outp_id, "SHOW OUTPUT", .2,.45, .3, -99999)
CALL TC_PushBtn_Create (Calc_id, "CALCULATE", .45, .6, .3, -99999)
CALL TC_PushBtn_Create (Quit_id, "QUIT", .6, .75, .3, -99999)

CALL WelcomeMessage (W2)
CALL TC_Select (Name_Id)
DO
CALL TC_Event (0, Event$, Wid, X1, X2)
IF Event$ = "CONTROL DESELECTED" THEN
IF X2 = Sales_Id or X2 = Calc_Id THEN
CALL TC_Edit_GetText (Name_Id, Employee$)
CALL TC_Edit_GetText (Base_Id, BSalary$)
CALL TC_Edit_GetText (Sales_Id, Sales$)
LET BaseSalary = VAL(BSalary$)
LET Sales = VAL (Sales$)
CALL TC_Edit_SetText (Name_Id, "")
CALL TC_Edit_SetText (Base_Id, "")
CALL TC_Edit_SetText (Sales_Id,"")
CALL TC_Select (Name_Id)
CALL ComputeResults(BaseSalary, Sales, Commission, GrossSalary, &
& Deduction1, Deduction2, Deduction3, Deductions, NetSalary)
CALL TC_Win_Target (W2)
CALL PrintResults(Employee$, Sales, BaseSalary, Commission, &
& GrossSalary, Deduction1, Deduction2, Deduction3, Deductions, &
& NetSalary)
ELSE IF X2 = OutP_id THEN
CALL TC_Show (W2)
ELSE IF X2 = Quit_id THEN
EXIT DO
END IF
END IF
LOOP

CALL TC_Cleanup
END

! *************** WelcomeMessage Subprogram ***************
!
SUB WelcomeMessage (W2)

! This subprogram displays a welcome message

CALL TC_WIN_Target (W2)
PRINT TAB(25); " FINEST FILM COMPANY"
PRINT
PRINT TAB(25); "Employee Earnings Report"
PRINT
PRINT

END SUB

! *************** ComputeResults Subprogram ***************
!
SUB ComputeResults (BaseSalary, Sales, Commission, GrossSalary, &
& Deduction1, Deduction2, Deduction3, Deductions, NetSalary)

! This subprogram uses the BaseSalary and Sales figures to
! compute the salesperson!s Commission, GrossSalary, indiv-
! dual and total deductions (Deduction1, Deduction2,
! Deduction3, and Deductions) and NetSalary.

! Variables:
! CommissionRate ..... Commission rate
! FederalRate ........ Federal tax withholding rate
! StateRate .......... State tax withholding rate
! RetirementRate ..... Retirement contribution rate

READ CommissionRate, FederalRate, StateRate, RetirementRate
LET Commission = Sales * CommissionRate
LET GrossSalary = BaseSalary + Commission
LET Deduction1 = GrossSalary * FederalRate
LET Deduction2 = GrossSalary * StateRate
LET Deduction3 = (GrossSalary - 500) * RetirementRate
LET Deductions = Deduction1 + Deduction2 + Deduction3

LET NetSalary = GrossSalary - Deductions

! The data listed represents the following rates: commission,
! federal and state withholding, and retirement contribution

DATA .12, .25, .05, .065

END SUB

! **************** PrintResults Subprogram ****************
!
SUB PrintResults (Employee$, Sales, BaseSalary, Commission, &
& GrossSalary, Deduction1, Deduction2, Deduction3, Deductions, &
& NetSalary)

! This subprogram displays the values of all variables
! listed as parameters.

! Variable:
! Format$ ..... Format string for PRINT USING

PRINT
LET FormatTx$ = "<###############: $##,###.## "
LET Format$ = ">################: $##,###.## "
PRINT TAB (8);"Employee: "; Employee$,
PRINT USING FormatTx$: " Sales",Sales
PRINT
PRINT TAB(15); "Income"; TAB(47); "Deductions"
PRINT
PRINT USING Format$: "Base Salary", BaseSalary;
PRINT USING Format$: "Federal Tax", Deduction1
PRINT USING Format$: "Commissions", Commission;
PRINT USING Format$: "State Tax", Deduction2
PRINT USING Format$: "Gross Salary", GrossSalary;
PRINT USING Format$: "Retirement", Deduction3
PRINT TAB(37);
PRINT USING Format$: "Total", Deductions
PRINT
PRINT TAB(10); "Net salary is ";
PRINT USING "$##,###.##": NetSalary

END SUB

Comments

re: NO SCROLL BARS

I'm hoping for some confirmation here by others--especially Big John whose editor clearly has working scroll bars....BUT....

I'm not sure the TC_WIN_CREATE call has ever worked to create scroll bars even though the manual suggests that it does. Adding "VSCROLL|HSCROLL|" to the option$ in the call seems to do nothing. Clearly the program you are using never attempts to use the scroll bar (and doesn't need to as there is nothing to scroll to) but I suspect that what you need to do is actually create the scroll bar as shown in the DEMVSBAR demo program that we've discussed before.

Again--confirmation or denial from someone else that
TC_Win_CREATE (id,"Title|Size|Close|Vscroll|Hscroll",etc)
does NOT actually create visible vertical or horizontal scroll bars? It is possible the Win_Create call makes room in the window for the bars but one still has to separately use the TC_Sbar calls to setup and monitor the bars.

rwt