Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String comparaison
Message
From
22/06/2022 06:43:11
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01684533
Message ID:
01684537
Views:
54
>*Cursor with unique list of string
>CREATE CURSOR c_UniqueString (cStr C(50))
>
>*Cursor where we want to find all unique string from.
>CREATE CURSOR c_Data (cCode C(40), cdesc C(50))
>
>INSERT INTO c_data (ccode, cDesc) VALUES ("ARIA", "Ariane")
>INSERT INTO c_data (ccode, cDesc) VALUES ("GALA", "Gala")
>
>SET EXACT ON
>SET ANSI ON
>
>*First column
>SELECT DISTINCT CAST(RTRIM(cCode) AS V(40)) as string FROM c_data WHERE !ISNULL(cCode) INTO CURSOR c_DistinctCode
>
>INSERT INTO c_UniqueString (cStr) SELECT string FROM c_DistinctCode WHERE string NOT IN (SELECT cStr FROM c_UniqueString)
>
>*Second column
>SELECT DISTINCT CAST(RTRIM(cdesc) AS V(40)) as string FROM c_data WHERE !ISNULL(cdesc) INTO CURSOR c_DistinctDesc
>
>INSERT INTO c_UniqueString (cStr) SELECT string FROM c_DistinctDesc WHERE string NOT IN (SELECT cStr FROM c_UniqueString)
>
>*We should have 4 values in c_UniqueString, but we are missing Gala in lower case. The NOT IN does not take into account Lowercase and UpperCase.
>
>Any work around ?

I get all four, so sounds like some setting is different. Here are my settings after running your code. (To get yours for comparison, open the Debugger, then Tools | Options, Shift-OK.)

SET TALK OFF
SET NOTIFY OFF
SET CLOCK OFF
&& RecentlyUsedFiles = 6
&& DisplayCount = 15
SET COMPATIBLE OFF
SET PALETTE ON
SET BELL OFF
SET SAFETY OFF
SET ESCAPE ON
SET LOGERRORS ON
SET KEYCOMP TO WINDOWS
SET CARRY OFF
SET CONFIRM OFF
SET BROWSEIMECONTROL OFF
SET STRICTDATE TO 0
&& TabOrdering = 0
&& ResWidth = -1
&& ResHeight = -1
&& GridHorz = 12
&& GridVert = 12
&& ScaleUnits = 0
&& FormSetLib =
&& FormSetClass =
&& FormsLib =
&& FormsClass =
SET EXACT ON
SET NEAR OFF
SET ANSI ON
SET LOCK OFF
SET EXCLUSIVE OFF
SET MULTILOCKS ON
SET HEADINGS ON
SET DELETED ON
SET OPTIMIZE ON
SET UNIQUE OFF
SET CPDIALOG OFF
SET REFRESH TO 1,1.000
SET ODOMETER TO 100
SET BLOCKSIZE TO 64
SET REPROCESS TO 10
SET COLLATE TO ""
&& SCCProvider =
STORE "D:\FOX\VFP 9\SCCTEXT.PRG" TO _SCCTEXT
&& ProjectHookLib =
&& ProjectHookClass =
&& CrsBuffering = 1
&& CrsMethodUsed = 1
&& CrsWhereClause = 3
&& CrsFetchSize = 100
&& CrsMaxRows = -1
&& CrsNumBatch = 1
&& CrsUseMemoSize = 255
&& SQLDispLogin = 1
&& SQLTransactions = 1
&& SQLConnectTimeOut = 15
&& SQLIdleTimeOut = 0
&& SQLQueryTimeOut = 0
&& SQLWaitTime = 100
SET DEFAULT TO "d:\writing\confs\vff\vff2021 october\examples"
&& TMPFILES = c:\users\tamar\appdata\local\temp
SET PATH TO
&& HelpTo = d:\fox\vfp 9\dv_foxhelp.chm
&& HelpCollection =
SET HELP ON
SET HELP COLLECTION
SET HELP TO "d:\fox\vfp 9\dv_foxhelp.chm"
&& ResourceTo = c:\users\tamar\appdata\roaming\microsoft\visual foxpro 9\foxuser.dbf
SET RESOURCE ON
SET RESOURCE TO "c:\users\tamar\appdata\roaming\microsoft\visual foxpro 9\foxuser.dbf"
STORE "D:\FOX\VFP 9\WIZARD.APP" TO _WIZARD
STORE "D:\FOX\VFP 9\BUILDER.APP" TO _BUILDER
STORE "" TO _MENUDESIGNER
STORE "D:\FOX\VFP 9\CONVERT.APP" TO _CONVERTER
STORE "D:\FOX\VFP 9\GENMENU.PRG" TO _GENMENU
STORE "D:\FOX\VFP 9\BROWSER.APP" TO _BROWSER
STORE "D:\FOX\VFP 9\GALLERY.APP" TO _GALLERY
STORE "" TO _INCLUDE
STORE "D:\FOX\VFP 9\BEAUTIFY.APP" TO _BEAUTIFY
STORE "" TO _GETEXPR
STORE "D:\FOX\VFP 9\GENHTML.PRG" TO _GENHTML
STORE "D:\FOX\VFP 9\VFPSTART.PRG" TO _STARTUP
STORE "D:\FOX\VFP 9\SAMPLES\" TO _SAMPLES
STORE "D:\FOX\VFP 9\COVERAGE.APP" TO _COVERAGE
STORE "D:\FOX\VFP 9\TASKLIST.APP" TO _TASKLIST
STORE "D:\FOX\VFP 9\OBJECTBROWSER.APP" TO _OBJECTBROWSER
STORE "C:\USERS\TAMAR\APPDATA\ROAMING\MICROSOFT\VISUAL FOXPRO 9\FOXCODE.DBF" TO _FOXCODE
STORE "D:\FOX\VFP 9\FOXCODE.APP" TO _CODESENSE
STORE "C:\USERS\TAMAR\APPDATA\ROAMING\MICROSOFT\VISUAL FOXPRO 9\FOXTASK.DBF" TO _FOXTASK
STORE "D:\FOX\VFP 9\VFPXTAB.PRG" TO _GENXTAB
STORE "D:\FOX\VFP 9\FOXREF.APP" TO _FOXREF
STORE "D:\FOX\VFP 9\TOOLBOX.APP" TO _TOOLBOX
STORE "D:\FOX\VFP 9\TASKPANE.APP" TO _TASKPANE
STORE "D:\FOX\VFP 9\REPORTBUILDER.APP" TO _REPORTBUILDER
STORE "D:\FOX\VFP 9\REPORTPREVIEW.APP" TO _REPORTPREVIEW
STORE "D:\FOX\VFP 9\REPORTOUTPUT.APP" TO _REPORTOUTPUT
SET SYSFORMATS OFF
SET SECONDS ON
SET CENTURY ON
&& CurrSymbol = $
SET CURRENCY LEFT
SET CURRENCY TO "$"
SET HOURS TO 12
SET DATE TO AMERICAN
SET DECIMALS TO 2
SET FDOW TO 1
SET FWEEK TO 1
SET MARK TO "/"
SET SEPARATOR TO ","
SET POINT TO "."
&& DebugEnvironment = 0
SET TRBETWEEN OFF
STORE 0.00 TO _THROTTLE
&& DebugOutputFileName =
&& TraceFontName = Courier New, 14, N, 1
&& WatchFontName = MS Sans Serif, 12, N, 1
&& LocalsFontName = MS Sans Serif, 12, N, 1
&& OutputFontName = MS Sans Serif, 12, N, 1
&& CallstackFontName = MS Sans Serif, 12, N, 1
&& TraceNormalColor = RGB(0,0,0,255,255,255), Auto, Auto
&& TraceExecutingColor = RGB(255,255,0,0,0,0), NoAuto, Auto
&& TraceCallstackColor = RGB(0,0,0,240,240,240), Auto, Auto
&& TraceBreakpointColor = RGB(255,0,0,0,0,0), NoAuto, Auto
&& TraceSelectedColor = RGB(255,255,255,0,0,0), Auto, Auto
&& WatchNormalColor = RGB(0,0,0,255,255,255), Auto, Auto
&& WatchSelectedColor = RGB(255,255,255,0,0,0), Auto, Auto
&& WatchChangedColor = RGB(255,0,0,255,255,255), NoAuto, Auto
&& LocalsNormalColor = RGB(0,0,0,255,255,255), Auto, Auto
&& LocalsSelectedColor = RGB(255,255,255,0,0,0), Auto, Auto
&& OutputNormalColor = RGB(0,0,0,255,255,255), Auto, Auto
&& OutputSelectedColor = RGB(255,255,255,0,0,0), Auto, Auto
&& CallstackNormalColor = RGB(0,0,0,255,255,255), Auto, Auto
&& CallstackSelectedColor = RGB(255,255,255,0,0,0), Auto, Auto
&& BookmarkColor = RGB(0,255,255,0,0,0), NoAuto, Auto
&& ShortcutColor = RGB(0,0,255,0,0,0), NoAuto, Auto
&& EditorCommentString = *!*
&& BackgroundCompile = 0
&& ParensHighlightDuration = 1500
&& RptGridHorz = 12
&& RptGridVert = 12
&& RptScaleUnits = 255
&& RptExprBuilderAlias = 1
&& RptBehavior = 80
&& RptFont = Calibri, 12, N, 1
Previous
Reply
Map
View

Click here to load this message in the networking platform