Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Percent help
Message
From
13/06/2001 15:01:07
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
13/06/2001 14:10:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00518977
Message ID:
00519007
Views:
17
This message has been marked as the solution to the initial question of the thread.
>Thank you,
>
>What happened if we select only ID# range from :
>
>11111
>22222
>33333
>
>in total out of 5 records , then the final percentage
>should look like this :
>
>1/3 = 33% passed but in the total of 5 records.
>
>reccount() give 5 but not 3 instead .
>
>Thanks again
>Paul

Paul,
I think I couldn't define it well.
create cursor myScores (id i, score1 c(1),score2 c(1),score3 c(1),score4 c(1))
for ix = 1 to 250
insert into myScores values (ix, ;
 iif(int(rand()*100)%2=0,'F','P'), ;
 iif(int(rand()*100)%2=0,'F','P'), ;
 iif(int(rand()*100)%2=0,'F','P'), ;
 iif(int(rand()*100)%2=0,'F','P'))
endfor
browse title 'All'

copy to mytext.txt type SDF
create cursor myPassed (id i,scores c(4))
append from myText.Txt for at('F',scores)=0 type SDF
brow title 'Passed'

lnPassed = reccount('myPassed')
lnTotal  = reccount('myScores')
lnPassedPct = lnPassed/lnTotal*100
lnFailedPct = (lnTotal-lnPassed)/lnTotal*100
 
? "Passed % :",lnPassedPct, " Failed % :",lnFailedPct
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform