我在access 2003中创建了这个语句 此语句是否有助于检查表A中的记录是否与表b相同? TABLEA是表b的新表,我想确保表b中的所有记录都在表A中。 其次我有这张桌子TABLEC。 如何在TABLEC中检查是否存在重复记录,这意味着所有字段值都相同? ...
提示:本站收集StackOverFlow近2千万问答,支持中英文搜索,鼠标放在语句上弹窗显示对应的参考中文或英文, 本站还提供 中文繁体 英文版本 中英对照 版本,有任何建议请联系yoyou2525@163.com。
这是我的 function 如果满足条件并且 function 返回 true 则启用按钮。 我添加了额外的 for 循环来查找重复项,现在它无法正常工作。 请指教我在哪里犯了错误?
enabled(): boolean {
for (let i: number = 0; i < this.entries.length; ++i) {
let strText: string = this.entries[i].textN;
let strValue: number = this.entries[i].valueN;
if (strText.includes('=') || strText.includes(',')) {
return false;
}
if (strText == null || strText == undefined || strText == '') {
return false;
}
if (!strValue || strValue % 1 !== 0) {
return false;
}
for (let j = i + 1; j < this.entries.length; ++j) {
if (strValue[i] === strValue[j]) {
return false;
}
}
}
return true;
}
问题可能在这里:
for (let j = i + 1; j < this.entries.length; ++j) {
if (strValue[i] === strValue[j]) {
return false;
}
}
我想你想要的是:
for (let j = i + 1; j < this.entries.length; ++j) {
if (this.entries[i].textN === this.entries[j].textN) {
return false;
}
}
strValue[i] 并不是要与 strValue[j] 进行比较
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.