Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ascan exact in select-sql
Message
From
30/12/2004 13:22:49
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00973127
Message ID:
00973351
Views:
20
>Fabio,
>
>I changed the example a bit. All results are as expected with SET ANSI ON. They are weird if SET ANSI OFF. The REPLACE command always returns the correct result. Agree?
>
local array laTmp[5]
>laTmp[1]='abc'
>laTmp[2]='cde'
>laTmp[3]='temx'
>laTmp[4]='tem'
>laTmp[5]=''
>acopy( laTmp, laTmpX )
>dimension laTmpX[ 6 ]
>ains( laTmpX, 1 )
>laTmpX[1] = '-'
>
>create cursor c_tmp ( pk I,cString c(4), OFFOFF c(4), OFFON c(4), ONOFF c(4), ONON c(4) )
>insert into c_tmp values (1, 'abc ','','','','' )
>insert into c_tmp values (2, 'tem ','','','','' )
>insert into c_tmp values (3, ''    ,'','','','' )
>insert into c_tmp values (4, 'xxx ','','','','' )
>
>SET ANSI OFF
>SET EXACT OFF
>*REPLACE ALL OFFOFF WITH laTmpX[ 1 + ascan( laTmp, rtrim( cString ), -1, -1, 0, 7 )]
>UPDATE c_tmp SET OFFOFF=laTmpX[ 1 + ascan( laTmp, rtrim( cString ), -1, -1, 0, 7 )]
>
>SET ANSI OFF
>SET EXACT ON
>*REPLACE ALL OFFON WITH laTmpX[ 1 + ascan( laTmp, rtrim( cString ), -1, -1, 0, 7 )]
>UPDATE c_tmp SET OFFON=laTmpX[ 1 + ascan( laTmp, rtrim( cString ), -1, -1, 0, 7 )]
>
>SET ANSI ON
>SET EXACT OFF
>*REPLACE ALL ONOFF WITH laTmpX[ 1 + ascan( laTmp, rtrim( cString ), -1, -1, 0, 7 )]
>UPDATE c_tmp SET ONOFF=laTmpX[ 1 + ascan( laTmp, rtrim( cString ), -1, -1, 0, 7 )]
>
>SET ANSI ON
>SET EXACT ON
>*REPLACE ALL ONON WITH laTmpX[ 1 + ascan( laTmp, rtrim( cString ), -1, -1, 0, 7 )]
>UPDATE c_tmp SET ONON=laTmpX[ 1 + ascan( laTmp, rtrim( cString ), -1, -1, 0, 7 )]
>
>LOCATE
>browse LAST NOWAIT
Agree, more immediate.
Previous
Reply
Map
View

Click here to load this message in the networking platform