[futurebasic] Re: [FB] Re: : in "Switching to..."

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2002 : Group Archive : Group : All Groups

From: Jim <teeitup98@...>
Date: Tue, 08 Oct 2002 16:15:57 -0800
Thank you Ken.  

I hoped that I had a typo because I thought I had understood (at least a
little) about describing records.  I will have to practice more.

DIM cBal AS Double
cBal = customerRecord.customerBalance(100)

The above statement put the value of customer #100 into the variable cBal.


I'm on again.

I will have more questions, no doubt.  Thank you for the help.

Jim

on 10/7/2002 5:04 AM, Ken Shmidheiser at kshmidheiser@... wrote:

> Jim, posing a very good question, asked:
> 
>> I am trying to return to FB and am reading the "Switching to .. " book which
>> came with my update.
>> 
>> On page 29 in the greyed section:
>> 
>> DIM cBal AS Double
>> cBal = customerRecord.customerBalance(100)
>> 
>> This is supposed to reflect the "account of customer number 55".
>> 
>> If this does do that, how do I reflect the account of customer 25?
>> 
>> Is it possible that I have a typo here?
>> 
>> I need help.
>> 
>> Thank you.
> 
> Jim,
> 
> Sharp eyes!
> 
> Indeed it's a typo. You might want to try the following demo as
> proof. (I did not attempt to fill the arrays, just enough for the
> demo.)
> 
> Glad you're coming back. FB^3 is growing stronger with each release.
> 
> Ken
> 
> begin record myData
> dim customerName    as str63
> dim customerBalance as double
> end record
> 
> dim customerRecord(1000) as myData
> 
> customerRecord.customerName(25) = "Jim"
> customerRecord.customerName(50) = "Ken"
> customerRecord.customerName(51) = "Tom"
> customerRecord.customerName(52) = "Sue"
> customerRecord.customerName(53) = "Harry"
> customerRecord.customerName(54) = "Bill"
> customerRecord.customerName(55) = "Fred"
> customerRecord.customerName(56) = "David"
> customerRecord.customerName(57) = "Mary"
> customerRecord.customerName(58) = "Jill"
> customerRecord.customerName(59) = "Dick"
> 
> customerRecord.customerBalance(25) = 524.64
> customerRecord.customerBalance(50) = 124.98
> customerRecord.customerBalance(51) =   6.54
> customerRecord.customerBalance(52) =  92.27
> customerRecord.customerBalance(53) =  26.19
> customerRecord.customerBalance(54) =   0.00
> customerRecord.customerBalance(55) = 845.61
> customerRecord.customerBalance(56) =  57.43
> customerRecord.customerBalance(57) = -21.89
> customerRecord.customerBalance(58) =   5.00
> customerRecord.customerBalance(59) =  -4.15
> 
> dim r as rect
> setrect( r, 0, 0, 200, 450)
> window 1,"",@r,_docNoGrow
> 
> dim cName  as str63
> dim cBal   as double
> dim i      as integer
> 
> for i = 25 to 59
> cName = customerRecord.customerName(i)
> cBal  = customerRecord.customerBalance(i)
> long if cName = ""
> xelse
> print "Data for Customer No."; i; ":"
> print cName; "'s balance is:", using "$#,###.##"; cBal; chr$(13)
> end if
> next i
> 
> print:print "Click mouse to end"
> 
> do
> handleevents
> until fn button
> 
> --
> To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>
> 
>