正如我在标题中所写,组件import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import Template from './src/components/Template';
export default class App extends React.Component {
constructor(props) {
super(props);
this.foo= "this is a test";
}
changeMe = () => {
this.foo = 'changed';
}
componentDidMount(){
this.changeMe();
}
render() {
return (
<Template foo={this.foo} />
);
}
}
尤其是其方法Locate存在问题。如果搜索的字符串中有重音,则返回的值始终为false,并且TLocateOption中没有处理重音的选项。有没有人找到解决这个问题的方法?
谢谢!
---编辑------------------------------------------- -------------------------------------------------- ----------------------------
TClientDataSet
// in a method
ClientDataSetTournee.open;
// in an other method that I call after in a separate thread
// libtor equals 'ANTONY_CLSH TOURNÉE 1 (VACANCES)'
if ClientDataSetTournee.Locate('LIBTOR', libtor, []) then
begin
// data found
end
else
begin
myShowMessage('Erreur', 'Erreur interne : tournée introuvable' );
exit;
end;
已填充,这要感谢ClientDataSetTournee
从服务器获取数据,并且当libtor具有此值时,将显示错误消息。
答案 0 :(得分:0)
这很好。
计划Project129;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
Datasnap.DBClient,
Data.DB;
procedure DoTest;
var
dataSet: TClientDataSet;
varFieldDef: TFieldDef;
begin
dataSet := TClientDataSet.Create(nil);
try
with dataSet.FieldDefs.AddFieldDef do
begin
Name := 'Name';
DataType := ftString;
end;
dataSet.CreateDataSet;
dataSet.Append;
dataSet.FieldByName('Name').AsString := 'TOURNÉE 1 (VACANCES)';
dataSet.Post;
if dataSet.Locate('Name', 'TOURNÉE 1 (VACANCES)', []) then
WriteLn('Found')
else
WriteLn('Not found');
ReadLn;
finally
dataSet.Free;
end;
end;
begin
DoTest;
end.
应用程序的输出为“找到”