Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Please HELP!!!
Message
 
 
To
09/10/1999 12:23:39
Coann Teng
Computer Infobase System S/B
Kuala Lumpur, Malaysia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00274609
Message ID:
00274639
Views:
29
Hi Coaan. Instead make a more generic function like this.
FUNCTION Totalmf()
  PARAMETERS pcRace, pcSex

  lnCount = 0  
  SELECT emp
  COUNT TO lnCount FOR ;
          emp.Resign = .F. AND ;
          emp.Race = pcRace AND ;
          emp.Sex = pcSex 

RETURN lnCount
This code allows you to reuse the routine for any new races (or genders) that are needed. You would use it call it once for each race and gender needed.

>Can anyone tell me what wrong on this code
>
>------------------------------------------------------------------
>
>Function Totalmf
>
>tmm=0
>tmf=0
>tcm=0
>tcf=0
>tim=0
>tif=0
>tom=0
>tof=0
>
>Sele Emp
>Set Filter To Resign = .f.
>Go Top
>
>Do While !Eof()
>Do Case
> Case Sex='M' .And. Race ='Malay'
> Tmm=tmm+1
>
> Case Sex='F' .And. Race = 'Malay'
> tmf=tmf+1
>
> Case Sex='M' .And. Race='Chinese'
> tcm=tcm+1
>
> Case Sex='F' .And. Race='Chinese'
> tcf=tcf+1
>
> Case Sex='M' .And. Race='India'
> tim=tim+1
>
> Case Sex='F' .And. Race='India'
> tif=tif+1
>
> Case Sex='M' .And. Race='Other'
> tom=tom+1
>
> Case Sex='F' .And. Race='Other'
> tof=tof+1
>EndCase
>Skip
>EndDo
>
>Return (tmm,tmf,tcm,tcf,tim,tif,tom,tof)
>EndFunc
>------------------------------------------------------------------
>
>
>
>The Error Message when compile is : -
>Return (tmm,tmf,tcm,tcf,tim,tif,tom,tof)
>Error in line 107: Function name is missing ).
Previous
Reply
Map
View

Click here to load this message in the networking platform