Home > database >  The great god help me replace to replace what's the problem? And I have a circulation problem..
The great god help me replace to replace what's the problem? And I have a circulation problem..

Time:09-29

Existing a DBF file, there are two fields, a lin_zhon_1, one is LDLX, I now think, according to a value different lin_zhon_1 LDLX fill in the different values,
Wrote a small program, but they are all replacement failure, still null values, a great god answers under the
The code is as follows:
The use?
The set talk off
REPLACE all lin_zhon_1 with IIF (EMPTY (lin_zhon_1), "0", lin_zhon_1)
GO the top
Scan
DO CASE
CASE VAL (allt (lin_zhon_1) & lt; 118 and VAL (allt (lin_zhon_1) & gt; 110
REPLACE all LDLX with "10"
CASE VAL (allt (lin_zhon_1) & lt; 128 and VAL (allt (lin_zhon_1) & gt; 120
REPLACE all LDLX with "20"
CASE VAL (allt (lin_zhon_1) & lt; 234 and VAL (allt (lin_zhon_1) & gt; 230
REPLACE all LDLX with "30"
CASE VAL (allt (lin_zhon_1))=240
REPLACE all LDLX with "40"
CASE VAL (allt (lin_zhon_1) & lt; 256 and VAL (allt (lin_zhon_1) & gt; 250
REPLACE all LDLX with "50"
OTHERWISE
REPLACE all LDLX with ""
ENDCASE
ENDSCAN
GO the top
Scan
DO CASE
CASE lin_zhon_1="0" and VAL (allt (di_lei_1)) & lt; 199
REPLACE all LDLX with "70"
CASE lin_zhon_1="0" and VAL (allt (di_lei_1)) & gt; 260
REPLACE all LDLX with "70"
ENDCASE
ENDSCAN

CodePudding user response:

Put all the REPLACE all removed all see how!

CodePudding user response:

reference 1st floor yrt888 response:
all the REPLACE all removed all to see how it goes!

+ 1

CodePudding user response:

Or remove the scan... Endscan, replace all three times can
 Replace all lin_zhon_1 with Evl [1] (lin_zhon_1, "0") & amp; & This article also don't 
Replace all LDLX with ICase (;
110 & lt; Val (lin_zhon_1) and Val (lin_zhon_1) & lt; 118, "10";
, 120 & lt; Val (lin_zhon_1) and Val (lin_zhon_1) & lt; 128, "20";
, 230 & lt; Val (lin_zhon_1) and Val (lin_zhon_1) & lt; 234, "30";
40, 240=Val (lin_zhon_1), "";
, 250 & lt; Val (lin_zhon_1) and Val (lin_zhon_1) & lt; 256, "50", "0")
Replace all LDLX with "70" For lin_zhon_1="0" and (Val (di_lei_1) & lt; 199 or Val (di_lei_1) & gt; 260)


  •  Tags:  
  • VFP
  • Related