Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using IF with LIKE
Message
De
14/10/2014 15:23:38
Lutz Scheffler (En ligne)
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
14/10/2014 14:50:51
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01609335
Message ID:
01609344
Vues:
60
>Hello comunity
>
>I need help about using na IF condition with LIKE
>
>for exemple on my code i have:
>IF LIKE('0.600/*',bi.ref)
> replace qtt with 1
>ELSE
>return
>ENDIF
>
>Note the field bi.ref = '0.600/1182'
>the problem is my IF with LIKE never work and i don´t know how to solve this problem.
>
>Many thanks,
>Luis Santos

Whats wrong with it?
CLEAR
CREATE CURSOR bi (ref c(10))
INSERT INTO bi VALUES ('A')			 &&no match
INSERT INTO bi VALUES ('0.600/1182') &&match
INSERT INTO bi VALUES ('0.600/')     &&match
INSERT INTO bi VALUES ('0.600')      &&no match

SCAN
 IF LIKE('0.600/*',bi.ref) THEN
  ?bi.ref
 ENDIF &&LIKE('0.600/*',bi.ref)
ENDSCAN
runs prettty fine.

@Craig
Function LIKE() is part of VFP.
(VFP)SQL has its own (for example, with other quantifiers). You can use function LIKE(), but with problems on rushmore, for what I remember.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform