ListTextCommands()

Archive of posts related to former distro versions. Be aware that posts here do not refer to the current distro and may not work.
Locked
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am

ListTextCommands()

Post by Gnafu »

Hi everyone,

I need to know what does it returns the function ListTextCommands().

I red the docs but if a copy of the result of this command will be helpfull for me.

(just a
var res:=ListTextCommands();
syslog(res);
)

I need to convert this command into something usable with the 096 version (i'm trying to fix the control pkg for 096).

I can't run the 097 on my pc, that's why i need someone-else's help.

Thanks in advance!!
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Post by CWO »

I think its something like this:

res[pkgname][cmdlevel].cmdname

and cmdname is also a struct with .dir and .script


its either that or I'm very close to it.

And its not possible to do this on 096 unless you actually create the entire variable manually.
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am

Post by Gnafu »

I was planning to create a cfg file and to use it to create it
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

Code: Select all

PolSys::ListTextCommands() - Returns a dict of a dict of structs.
                Dict 1 - Package names Dict 2 - Command levels Struct - .dir .script
                Example:
                  foreach package in ( commands )
                     Print("Pkg:"+_package_iter);
                     foreach level in ( package )
                        Print(" CmdLvl:"+_level_iter);
                        foreach command in ( level )
                           Print("     "+command);
                           SleepMS(2);
                        endforeach
                        SleepMS(2);
	             endforeach
	  	     SleepMS(2);
	          endforeach
Gnafu
Grandmaster Poster
Posts: 136
Joined: Thu Feb 02, 2006 7:29 am

Post by Gnafu »

Austin... thanks, but i've read that before...
and i noticed it was an "Exaple" so i was asking the true struct of the return...
Marilla

Post by Marilla »

The documentation quoted above tells you exactly what is returned, and the example shows you how you might use it to iterate through all the commands.

It returns a dictionary of dictionaries of structs.

The outer dictionary has as it's keys the names of the packages on the server. Each of the values of that dictionary is itself a dictionary of the command levels. Finally, each of the values of those entries are structs with .dir and .script members.

That's essentially exactly what the quoted text above says.
Locked