Hello
I have a browser based on view of two tables and locator. When I sort descending on the integer field from secondary related file and tipe for example, number 123, the procedure NetWebServerWorker._SetView treats this field as a string and adds to the where condition clause 'upper(field)<= '123z'.
SQL returns an error and the browser becomes a blank. The problem is in the following routine (the field is searched only in the primer table – netweb.clw).
FindField Routine
DATA
loc:fields long
CODE
If p_Field = '' then exit.
compile('***',_VER_C55)
! Clarion 5.5 or above only !
loc:record &= p_File{prop:record}
loc:fields = p_File{prop:fields}
loop x = 1 to loc:fields
! p_field is the label not the name of the field.
if clip(upper(p_File{prop:label,x})) = clip(upper(p_Field))
loc:field &= What(loc:record,x)
Loc:FieldLabel = self._SetLabel(p_File,x)
!do SetLabel
case(p_File{prop:type,x})
of 'LONG' orof 'ULONG' orof 'DECIMAL' orof 'PDECIMAL' orof 'BYTE' orof 'SHORT' orof 'USHORT' orof 'REAL' orof 'SREAL' orof 'DATE' orof 'TIME'
loc:numeric = 1
else
loc:numeric = 0
end
break
End
end
Searching through all the view tables solves my problem:
(font-weight:
bold are my changes)
FindField Routine
DATA
loc:fields long
FileRef &FILE
CODE
If p_Field = '' then exit.
compile('***',_VER_C55)
! Clarion 5.5 or above only !
!p_View
LOOP ii# = 1 TO p_View{PROP:Files}
FileRef &= p_View{PROP:File, ii#} loc:record &=
FileRef{prop:record}
loc:fields =
FileRef{prop:fields}
loop x = 1 to loc:fields
! p_field is the label not the name of the field.
if clip(upper(
FileRef{prop:label,x})) = clip(upper(p_Field))
loc:field &= What(loc:record,x)
Loc:FieldLabel = self._SetLabel(
FileRef,x)
!do SetLabel
case(
FileRef{prop:type,x})
of 'LONG' orof 'ULONG' orof 'DECIMAL' orof 'PDECIMAL' orof 'BYTE' orof 'SHORT' orof 'USHORT' orof 'REAL' orof 'SREAL' orof 'DATE' orof 'TIME'
loc:numeric = 1
else
loc:numeric = 0
end
break
End
end
Besides, added character 'z' in polish language is not the last in the alphabet, which is letter “ż” Maybe it could be read from the file environment (environment variable CLACOLSEQ - .env)
Regards,
Matthew