View Single Post
07-26-13, 10:04 PM   #10
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by AnrDaemon View Post
You refer to
Code:
local argv = { strsplit(" ", strtrim(msg)) }
?
Then how do you suggest I prepare it? I have no idea, how many words will be in parameters.
According to the code you posted, your code only supports two parameters, and the first one must always be "quest". If your code actually supports other commands, you'll have to post your real code for a real example of how to do it without making tables left and right, but it's definitely possible, just the way I showed you in the code I posted.

Originally Posted by AnrDaemon View Post
"self" Is always the first argument passed to class function. Where do you see it as second?
In the code you posted, you named the second variable received by your slash command handler function "self".

Originally Posted by AnrDaemon View Post
I never Show() it in first place. However, I can set OnShow = Hide, if you insist.
Calling SetHyperlink on the tooltip automatically shows it. You just don't see it appear because you didn't give it a position, so it's appearing in a nonexistent location. Just call :Hide() on it, which is the proper method of "cleaning up" a tooltip after you've read it.

Originally Posted by AnrDaemon View Post
That is a part of real code, a part of real slashcommand handler. (There's lots more of unrelated stuff handled, I just extracted the relevant block for demonstration.)
Posting random parts of your code is nothing but a huge waste of time for anyone who tries to help you. If you want help, post your entire, actual code. We aren't mind readers. We can't magically know that what you posted is only 10% of your code, or what is in the other 90% of your code. Clearly you do not actually want help, so I'm done trying to help you. Maybe someone else has more patience for your time-wasting than I do. Good luck.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote