delphi
_PREFIJOSCORTOS: Array[0..4] of string = ('414', '412', '416', '426', '424');
La idea es poder hacer lo siguiente.
delphi
cPrefijo := Copy(cTelefono, 1, 3); if cPrefijo in stPrefijosCortos then
Alguna idea???
Posted 30 December 2011 - 04:15 PM
_PREFIJOSCORTOS: Array[0..4] of string = ('414', '412', '416', '426', '424');
cPrefijo := Copy(cTelefono, 1, 3); if cPrefijo in stPrefijosCortos then
Posted 30 December 2011 - 04:24 PM
cPrefijo:= Copy(cTelefono, 1, 3); if StrToIntDef(cPrefijo,0) in [414, 412, 416, 426, 424] then
var prefijos: set of integer; begin prefijos:= [414, 412, 416, 426, 424]; cPrefijo:= Copy(cTelefono, 1, 3); if StrToIntDef(cPrefijo,0) in prefijos then
Posted 30 December 2011 - 04:30 PM
Posted 30 December 2011 - 05:08 PM
function Dentro(Str, Lista: String): Boolean; begin with TStringList.Create do try Commatext:= Lista; Result:= Indexof(Str) >= 0 ; finally Free; end; end; begin if Dentro('0416','0414,0412,0416,0426,0424') then ShowMessage('Lo encontre'); end;
Posted 02 January 2012 - 10:20 AM
function Estaen(Prefijo: String; Lista: Array of String): Boolean; var nIdx: Integer; begin Result := False; for nIdx := 0 to Length(Lista) - 1 do begin if Lista[nIdx] = Prefijo then begin Result := True; Break; end; end; end;