我试图在数据库中找到相同的登录 id 用户。
首先,我将每个用户都放到跳过列表中,然后我想逐个比较。我的问题是如何获得 Skiplist 上的关键值。
我的一段代码在这里:
for lUser in userList do {
string uName = lUser.name
string uEmail = lUser.email
string uSys = lUser.systemLoginName
string uAdr = lUser.address
outBuf += uName sep uSys sep uEmail sep uAdr
outBuf += "\n"
// Here I have to add some code, I can put the values but not get again or compare
// I need some for loop and get every key value
put(skiplist,count,uSys)
print count
print "\n"
count++
}
有人可以为此提供提示,我是这种语言的新手。提前致谢。
编辑:现在它正在工作
pragma runLim,0
string sep = ";"
string dbName = getDatabaseName
print "\n" "List of doors user in database " getDatabaseName ": \n\n"
int count = 0
User lUser
Group lGroup
Skip skiplist = create
for lUser in userList do {
string uName = lUser.name
string uEmail = lUser.email
string uSys = lUser.systemLoginName
string uAdr = lUser.address
if(null uSys)
{
print uName " doesn't have a System Name.\n"
} else {
bool flagDuplicate = false
string nameDuplicate = ""
string s = ""
for s in skiplist do {
if(s == uSys) {
flagDuplicate = true
nameDuplicate = (string key skiplist)
break
}
}
if(flagDuplicate) print "Users '" uName "' and '" nameDuplicate "' have the same System Name (" uSys ").\n"
else put(skiplist,uName,uSys)
}
}
pragma runLim,0
这一行是为了避免执行时间警告。