Code
1 function GetUserrole: Boolean;
2 var ATeams: TStrings;
3 i:Integer;
4 begin
5 Result:=false;
6 i:=0;
7 ATeams:=TStringList.Create;
8 try
9 ATeams.Text:=ListLoginUserRoles;
10 if ATeams.Count>0 then
11 for i:=0 to ATeams.Count-1 do begin
12 if StrToIntDef(ATeams.Names[i], 0)=43 then begin //StrToIntDef判断一个文本框里输入的字符串能不能转换为integer类型,如果能,则返回转换后的整型数据,如果不能,则返回整数0,
13 Result:=true;
14 break;
15 end;
16 end;
17 finally
18 ATeams.Free;
19 end;
20 end;
1 function GetUserrole: Boolean;
2 var ATeams: TStrings;
3 i:Integer;
4 begin
5 Result:=false;
6 i:=0;
7 ATeams:=TStringList.Create;
8 try
9 ATeams.Text:=ListLoginUserRoles;
10 if ATeams.Count>0 then
11 for i:=0 to ATeams.Count-1 do begin
12 if StrToIntDef(ATeams.Names[i], 0)=43 then begin //StrToIntDef判断一个文本框里输入的字符串能不能转换为integer类型,如果能,则返回转换后的整型数据,如果不能,则返回整数0,
13 Result:=true;
14 break;
15 end;
16 end;
17 finally
18 ATeams.Free;
19 end;
20 end;