Jump to content
UBot Underground

Table Search With Variables?


Recommended Posts

Hi all, I'm new around here, but I've been lurking for a bit. I've been playing with the program for a while now and have managed to do so much already!

 

I'm working on a bot for my job, auto enrolling students with data from a table. What I'd like to do is find the row of each student and from there pull their data into the form.

 

I have it set up where I just paste in the correct name and it saves it as a variable (as well as pulling the first and last name into their own variables), then I planned to search the table for the "Full Name" variable to find that person's row (wasn't sure where to go after that but I'm learning!)

 

The only problem is that table search isn't accepting my variable as search criteria. It always returns a row value of -1 unless I manually paste the student's name into it as straight text.

 

Is there a way around this, or am I on the wrong track entirely? Thank you for any help!!

Link to post
Share on other sites

Oh wow, you guys are fast around here!

Sorry, I should have thought to do that at first...

 

Here's what I had so far:

ui text box("Full Name",#Full name)
create table from file("",&Hill student info)
clear list(%Full Name)
add list to list(%Full Name,$list from text(#Full name,", "),"Delete","Global")
remove from list(%Full Name,1)
set(#Last name,$list item(%Full Name,0),"Global")
set(#First name,$list item(%Full Name,1),"Global")
set(#Student Position in Table,$plugin function("TableCommands.dll", "$table search", &Hill student info, $plugin function("TableCommands.dll", "$table search", &Hill student info, #Full name, "Row Index"), "Row Index"),"Global")
alert(#Student Position in Table)

I'm having trouble with this part here:

 

63f8c75240825c9ee0dbb9ffe99b8ca9.png

Link to post
Share on other sites

Try this:

set(#Student Position in Table,$plugin function("TableCommands.dll", "$table search", &Hill student info, #Full name, "Row Index"),"Global")

Instead of nesting your table search functions, that is probably the issue.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...