Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check for ***********************
Message
De
17/07/2000 13:43:36
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00389944
Message ID:
00393404
Vues:
20
>>Kind of along the same lines, I was trying to setup an environment for SQLSetProp(), using a table to manage the style of connection I need. What would you recommend for setting a variables type based on another column name?
>>
>>My table looks something like this:
>>
>>   cPropName         cPropType       cPropVal
>>   'Asynchronous'        l              .f.
>>   'Comment'             c              ''
>>   'ConnectTimeOut'      n               15
>>
>>
>>I figure'd I would scan through the table, and do SQLSetProp with each cPropValue:
>>
>>   SQLSetProp(nConnHandle,cPropName,cPropVal)
>>
>>
>>But since the cPropVal column is a char type, and my back end is expecting char/num/logical, things choke. I thought I'd make a little do case thing with transform() and cPropType but nothing is coming together.
>>
>>What do you think?
>
>Since you have the data type, you could use a SELECT CASE statement to examine the individual data types and set a the type variable accordingly. For example, VAL() for numerics, EVALUATE() for Booleans, etc.

Evaluate for them all - they'll just turn out into their proper data type. Type('eval(".f.")') gives you a "L", and Ttype('eval("1")') gives you a "N"; therefore Eval(".f.") does give you a real Boolean .f. and no problems.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform