Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rewrite code
Message
From
20/06/2006 03:35:30
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Rewrite code
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01130156
Message ID:
01130156
Views:
53
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
Next
Reply
Map
View

Click here to load this message in the networking platform