PtokaX forum

PtokaX => Bugs => Topic started by: 6Marilyn6Manson6 on 17 May, 2006, 15:29:12

Title: Problem with getHubVersion() in PtokaX DC Hub 0.3.4.0h1 [debug] May 17 2006 06:3
Post by: 6Marilyn6Manson6 on 17 May, 2006, 15:29:12
This is my line:
disp = disp.." ?Hub PtokaX Version: "..getHubVersion().."\r\n"

and return:
?Hub PtokaX Version: PtokaX

In Scripting-Interface.txt, I see? ?getHubVersion()            - Return appname and version like name, ver = getHubVersion() -> name = "PtokaX", ver = "0.3.3.1" . Return only name not versione, It is a bug?
Title: Re: Problem with getHubVersion() in PtokaX DC Hub 0.3.4.0h1 [debug] May 17 2006 06:3
Post by: GeceBekcisi on 17 May, 2006, 15:38:30
it has 2 string returns,

use as name,version = getHubVersion()
Title: Re: Problem with getHubVersion() in PtokaX DC Hub 0.3.4.0h1 [debug] May 17 2006 06:3
Post by: 6Marilyn6Manson6 on 17 May, 2006, 15:44:18
Yes, I use this:

local name,version = getHubVersion()
disp = disp.." ?Hub Version:\t\t\t"..name.." "..version.."\r\n"


and this solution work. But I read:

getHubVersion()            - Return appname and version like name, ver = getHubVersion() -> name = "PtokaX", ver = "0.3.3.1"

I don't know.... :S
Title: Re: Problem with getHubVersion() in PtokaX DC Hub 0.3.4.0h1 [debug] May 17 2006
Post by: bastya_elvtars on 17 May, 2006, 16:03:03
If a function returns more values, then you have to query all return values before the desired one. Assume dummy() returns 5 values, if you only need the 5th, ylou still need to query the first 4, like: _,_,_,myvar=dummy()
(the underscore is a placeholder for variables. :-P)
Title: Re: Problem with getHubVersion() in PtokaX DC Hub 0.3.4.0h1 [debug] May 17 2006
Post by: 6Marilyn6Manson6 on 17 May, 2006, 16:17:25
Quote from: bastya_elvtars on 17 May, 2006, 16:03:03
If a function returns more values, then you have to query all return values before the desired one. Assume dummy() returns 5 values, if you only need the 5th, ylou still need to query the first 4, like: _,_,_,myvar=dummy()
(the underscore is a placeholder for variables. :-P)

Thanks for your explain at me :D
Title: Re: Problem with getHubVersion() in PtokaX DC Hub 0.3.4.0h1 [debug] May 17 2006
Post by: Psycho_Chihuahua on 17 May, 2006, 17:49:56
as Ptokax only gives the Version as PtokaX 0.3.4.0 i cheated in the InfoBot Script to add the Subversion String like h0 Lua 5.02 and such

PtxVers = "h0 Lua 5.02" -- PtokaX Version Substring
name, ver = getHubVersion()
"\tHub Version: \t"..name.." "..ver.." "..PtxVers.."\r\n"..

shows this way as:
Hub Version: PtokaX 0.3.4.0 h0 Lua 5.02


That way you have the Version Substring as well ;) (well 1 change every update is not that much work) ;)