Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control of three options
Message
 
 
À
07/07/2011 11:32:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01517424
Message ID:
01517597
Vues:
41
>>>(1) I think there are 8 possibilities - from 0 to 7
>>>shift1 = 2 ^0
>>>shift2 = 2^1
>>>shift3 = 2^ 2
>>>
>>>
>>>(2) I'm afraid you'll have to use a container with 3 option buttons
>>>
>>>(3) Add an unvisible spinner to the container (range 0-7) and set the controlSource of the spinner to the field
>>>
>>>(4) add code to the container
>>> - refresh = setting the options on/off (easy with bittest(field, 0) , bittest(field, 1) , bittest(field, 2)
>>>
>>>(5) add code to the optionbuttons (interactive change) to set the value of the spinner accordingly
>>>
>>>_
>>
>>Your suggestion works like a charm. What amazes me is that you came up with the whole thing (design, bit operations, etc.) in less than 10 minutes. You are very smart. Thank you.
>
>
>You're welcome - and I have always liked bit operations (and, or, xor, not)
>
>BTW, this technique is very common - look for example at the MessageBox() parameters

I have used the MessageBox parameters but never thought of them as bit operations. It is like driving a car; I never thought that there is an internal combustion engine somewhere under the hood <g>
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform