mIRC Home    About    Download    Register    News    Help

Print Thread
#186245 19/09/07 09:40 PM
Joined: Mar 2004
Posts: 27
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2004
Posts: 27
Hi all,
So I'm working with a DLL for MySQL. The DLL basically returns 3 arguments plus data...so this:

Code:
echo 4 -a $dll(mysql.dll,labels,0)


...works without problem... for example it returns
Code:
1 016 Labels 0


And doing this one works as well:
Code:
echo 4 -a $gettok($dll(mysql.dll,labels,0),4,32)

which returns 0 when sticking with the above example.

I'm trying to set an alias...
Code:
alias mysql_status { return $gettok($dll(mysql.dll,labels,0),4,32) }


For some reason this returns a 1...all the time.

And when I try to do it with the Rows property of the DLL (instead of labels) ...it returns blank...even though it works perfectly using //echo -a $gettok() in the editbox.

Am I using the return command incorrectly?
Could the DLL be returning something different if it's called inside an alias? I think I'm overthinking it.

Any help would be appreciated smile

Thanks,
AltReality

AltReality #186263 20/09/07 01:56 AM
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
It should work fine if you are using: echo 4 -a $mysql_status

However, if it's not working fine, you can try changing your alias from: alias mysql_status { return $gettok($dll(mysql.dll,labels,0),4,32) }
to: alias mysql_status { var %labels = $dll(mysql.dll,labels,0) | return $gettok(%labels,4,32) }

Note: Make sure you have -no- other aliases called "mysql_status" otherwise you may be using a different alias, and not the one you're intending to use.

Rand #186368 21/09/07 06:18 PM
Joined: Mar 2004
Posts: 27
A
Ameglian cow
OP Offline
Ameglian cow
A
Joined: Mar 2004
Posts: 27
Thanks for the reply...
I tried what you suggested, and it still didn't work..then I figured out the problem.
Somehow I had in the aliases section: mysql_status return 1
I have no idea how that got there....it makes no sense to me.
Anyway..

Thanks for the reply..it's all working now.
-AltReality


Link Copied to Clipboard