Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rewrite code
Message
 
To
20/06/2006 04:34:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01130156
Message ID:
01130168
Views:
17
Sorry, Copy and paste problem:
LOCAL lnFor
thisform.text42.Value = thisform.list1.value
CLOSE all
SELECT 0
USE dnc
FOR lnFor  1 TO 15
    IF thisform.text42.Value = [Q]+TRANSFORM(lnFor)
       LOCATE FOR flag1 = m.lnFor
       ThisForm.Label1.Caption = q1
       ThisForm.Label2.Caption = q11
       EXIT
    ENDIF
NEXT
CLOSE all
USE answers
>hi,
>thank you very much,
>but still i have another problem , if my choice is q2, i need to change flag1 to 2,..q3 flag1 must be=3...etc
>thanks.
>>
>>LOCAL lnFor
>>thisform.text42.Value = thisform.list1.value
>>CLOSE all
>>SELECT 0
>>USE dnc
>>FOR lnFor  1 TO 15
>>    IF thisform.text42.Value = [Q]+TRANSFORM(lnFor)
>>       LOCATE FOR flag1=1
>>       ThisForm.Label1.Caption = q1
>>       ThisForm.Label2.Caption = q11
>>       EXIT
>>    ENDIF
>>NEXT
>>CLOSE all
>>USE answers
>>
>>
>>>hi all,
>>>
>>>i need help to rewrite this code under(another way),
>>>
>>> lcKeyField = thisform.list1.value
>>>         thisform.text42.Value= lcKeyField
>>>      if  thisform.text42.Value = UPPER("q1")
>>>           CLOSE all
>>>           USE dnc IN 0
>>>           SELECT dnc
>>>        LOCATE FOR flag1=1
>>>        ThisForm.Label1.Caption = q1
>>>        ThisForm.Label2.Caption = q11
>>>        ELSE
>>>           USE dnc IN 0
>>>           SELECT dnc
>>>    if  thisform.text42.Value = UPPER("q2")
>>>        LOCATE FOR flag1=2
>>>        ThisForm.Label1.Caption = dnc.q1
>>>        ThisForm.Label2.Caption = dnc.q11
>>>    ELSE
>>>        CLOSE all
>>>           USE dnc IN 0
>>>           SELECT dnc
>>>    if  thisform.text42.Value = UPPER("q3")
>>>        LOCATE FOR flag1=3
>>>        ThisForm.Label1.Caption = dnc.q1
>>>        ThisForm.Label2.Caption = dnc.q11
>>>    ELSE
>>>       CLOSE all
>>>           USE dnc IN 0
>>>           SELECT dnc
>>>    if  thisform.text42.Value = UPPER("q4")
>>>        LOCATE FOR flag1=4
>>>        ...
>>>        ...
>>>        .
>>>        .
>>>         CLOSE all
>>>           USE dnc IN 0
>>>           SELECT dnc
>>>          if  thisform.text42.Value = UPPER("q15")
>>>        LOCATE FOR flag1=15
>>>        .
>>>        .
>>>        .
>>>
>>>ENDIF
>>>ENDIF
>>>ENDIF
>>>ENDIF
>>>
>>> CLOSE all
>>>USE answers IN 0
>>>Select answers
>>>
>>>
>>>thanks
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform