From jredrejo at ...176... Fri Dec 8 17:24:10 2006 From: jredrejo at ...176... (=?ISO-8859-1?Q?Jos=E9_Luis_Redrejo?=) Date: Fri, 8 Dec 2006 17:24:10 +0100 Subject: [Gambas-devel] Problems with Process and bash replacement Message-ID: <8eb28a500612080824w5cebd699r8b2ed4f94f25b433@...178...> Hi all, in some distributions bash is being replaced by dash to speed up the start up of the system. It seems that bash is overbloated and things go faster using dash. So they are linking /bin/sh to /bin/dash instead of /bin/bash Testing it I've noticed is a little faster (not apreciable in fast computers but it's much better in slow ones). So the replacement could be a good thing.... unless you're a gambas programmer and use to be a SHELL fan. This code doesn't work properly using dash as replacement to bash: Dim stuffProcess AS Process TRY stuffProcess = SHELL ("whatever you like") TRY stuffProcess.Kill stuffProcess = NULL After executing it I can see as "sh" is killed, but "whatever you like" is still alive. Using bash, both sh & "whatever you like" are killed. I know this is not a real gambas bug, probably is due to the limitations of dash, but we are going to deal with it sooner or later, so if anybody has any idea on how to do it, or if Beno?t knows how to solve it thinking in the future, any help is welcome. P.S. I've checked that TRY stuffProcess = SHELL ("whatever you like") launch two processes, with consecutive id: "sh" with id = stuffProcess.id and "whatever you like" with id= StuffProcess.id +1, so this has worked for me: Dim stuffProcess AS Process dim idProcess as integer TRY stuffProcess = SHELL ("whatever you like") idProcess= stuffProcess.id TRY SHELL("kill -9 " & cstr(stuffProcess.id)) TRY SHELL("kill -9 " & cstr(stuffProcess.id +1 )) stuffProcess = NULL But, obviously this is just rubbish and I wouldn't like to have to use it, and even I'm not sure it will work the same with different systems or distributions. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Karl.Reinl at ...16... Fri Dec 8 22:21:24 2006 From: Karl.Reinl at ...16... (Charlie Reinl) Date: Fri, 8 Dec 2006 17:21:24 -0400 Subject: [Gambas-devel] CONST and transaltion Message-ID: <200612081721.24522.Karl.Reinl@...16...> Salut Beno?t, on Version 1.9.46 it is not possible to declare CONST xxx as String and make that translateabele. this CONST YW_NOT_VAILABLE AS String = ("not available") is not possible. Amicalment Charlie From bdragon at ...185... Tue Dec 12 03:31:49 2006 From: bdragon at ...185... (Brandon Bergren) Date: Mon, 11 Dec 2006 20:31:49 -0600 (Central Standard Time) Subject: [Gambas-devel] Can't checkout tree on Win32 -- Invalid filename Message-ID: Hi. It's been a while ;) I was checking out the SVN tree today in preperation for taking another shot at compiling on Windows. I couldn't finish the checkout. There's a file 2.0/trunk/help/help/help?en in the tree. Windows can't handle files with a ? in the file name, and I can't seem to force my client to ignore it (Probabaly something to do with the checkout being incomplete still) Would it be possible to rename or remove that file? Thanks, Brandon Bergren (That crazy disappearing Windows porter guy ;) -- >From the mailer of |_|0|_| B R A N D O N B E R G R E N |_|_|0| T e c h n i c a l |0|0|0| G e n e r a l i s t ( C S ) From gambas at ...1... Tue Dec 12 20:51:09 2006 From: gambas at ...1... (Benoit Minisini) Date: Tue, 12 Dec 2006 20:51:09 +0100 Subject: [Gambas-devel] Problems with Process and bash replacement In-Reply-To: <8eb28a500612080824w5cebd699r8b2ed4f94f25b433@...178...> References: <8eb28a500612080824w5cebd699r8b2ed4f94f25b433@...178...> Message-ID: <200612122051.09296.gambas@...1...> On Friday 08 December 2006 17:24, Jos? Luis Redrejo wrote: > Hi all, > in some distributions bash is being replaced by dash to speed up the start > up of the system. > It seems that bash is overbloated and things go faster using dash. > So they are linking /bin/sh to /bin/dash instead of /bin/bash > > Testing it I've noticed is a little faster (not apreciable in fast > computers but it's much better in slow ones). > So the replacement could be a good thing.... unless you're a gambas > programmer and use to be a SHELL fan. > > This code doesn't work properly using dash as replacement to bash: > > Dim stuffProcess AS Process > TRY stuffProcess = SHELL ("whatever you like") > TRY stuffProcess.Kill > stuffProcess = NULL > > > After executing it I can see as "sh" is killed, but "whatever you like" is > still alive. Using bash, both sh & "whatever you like" are killed. > > I know this is not a real gambas bug, probably is due to the limitations of > dash, > but we are going to deal with it sooner or later, so if anybody has any > idea on how to do it, or if Beno?t knows how to solve it > thinking in the future, any help is welcome. > Apparently, this is a bash behaviour that kill all its children when receiving a SIGKILL signal. The question is why don't dash have the same behaviour? -- Benoit Minisini From gambas at ...1... Tue Dec 12 21:49:48 2006 From: gambas at ...1... (Benoit Minisini) Date: Tue, 12 Dec 2006 21:49:48 +0100 Subject: [Gambas-devel] CONST and transaltion In-Reply-To: <200612081721.24522.Karl.Reinl@...16...> References: <200612081721.24522.Karl.Reinl@...16...> Message-ID: <200612122149.49011.gambas@...1...> On Friday 08 December 2006 22:21, Charlie Reinl wrote: > Salut Beno?t, > > on Version 1.9.46 it is not possible to declare CONST xxx as String and > make that translateabele. > > this > > CONST YW_NOT_VAILABLE AS String = ("not available") > > is not possible. > > Amicalment > Charlie > This has been fixed in the svn. -- Benoit Minisini From gambas at ...1... Tue Dec 12 21:51:05 2006 From: gambas at ...1... (Benoit Minisini) Date: Tue, 12 Dec 2006 21:51:05 +0100 Subject: [Gambas-devel] Can't checkout tree on Win32 -- Invalid filename In-Reply-To: References: Message-ID: <200612122151.05248.gambas@...1...> On Tuesday 12 December 2006 03:31, Brandon Bergren wrote: > Hi. It's been a while ;) > > I was checking out the SVN tree today in preperation for taking another > shot at compiling on Windows. > > I couldn't finish the checkout. There's a file 2.0/trunk/help/help/help?en > in the tree. Windows can't handle files with a ? in the file name, and I > can't seem to force my client to ignore it (Probabaly something to do with > the checkout being incomplete still) > > Would it be possible to rename or remove that file? > > Thanks, > > Brandon Bergren (That crazy disappearing Windows porter guy ;) I forgot Windows in this story :-) I need to fix the help file generator so that '?' characters are replaced by something else... Stay tune! Regards, -- Benoit Minisini From gambas at ...538... Sat Dec 16 19:27:13 2006 From: gambas at ...538... (MV) Date: Sat, 16 Dec 2006 19:27:13 +0100 Subject: [Gambas-devel] Feature request for TextView Message-ID: <200612161927.13961.gambas@...538...> Hello, While toying around various widgets, I noticed what seems to be a gap between WebBrowser and TextView : in the webbrowser component, you can display images with an URL (eventually pointing at the local FS), and in a TextView you can only display images out of the local FS by supplying a hard link in the tag. But unless I'm making a mistake, there's no way to supply an image from memory to neither, and WebBrowser won't even display a page out of a String. I tried to look at the code, but I don't really know C++ nor Qt. What I understood is TextView can fetch external references embedded into a document from a MimeSourceFactory call, and that you can provide the default factory with "handles" on memory stored images for future reference. So I wondered if it would be extremely difficult to add any Image declared with a name to the default MimeSourceFactory, so that a trivial rewrite of the String holding the html-like text would point to the Image in memory, instead of requiring the use of a local disk cache ? Hope I was clear enough, -- Manuel Viet From gambas at ...1... Sat Dec 16 20:00:11 2006 From: gambas at ...1... (Benoit Minisini) Date: Sat, 16 Dec 2006 20:00:11 +0100 Subject: [Gambas-devel] Feature request for TextView In-Reply-To: <200612161927.13961.gambas@...538...> References: <200612161927.13961.gambas@...538...> Message-ID: <200612162000.11351.gambas@...1...> On Saturday 16 December 2006 19:27, MV wrote: > Hello, > > While toying around various widgets, I noticed what seems to be a gap > between WebBrowser and TextView : in the webbrowser component, you can > display images with an URL (eventually pointing at the local FS), and in a > TextView you can only display images out of the local FS by supplying a > hard link in the tag. But unless I'm making a mistake, there's > no way to supply an image from memory to neither, and WebBrowser won't even > display a page out of a String. > > I tried to look at the code, but I don't really know C++ nor Qt. What I > understood is TextView can fetch external references embedded into a > document from a MimeSourceFactory call, and that you can provide the > default factory with "handles" on memory stored images for future > reference. > > So I wondered if it would be extremely difficult to add any Image declared > with a name to the default MimeSourceFactory, so that a trivial rewrite of > the String holding the html-like text would point to the Image in memory, > instead of requiring the use of a local disk cache ? > > Hope I was clear enough, Sorry, but it is too complicated to do. In the future, maybe it will be possible to go further, by using the equivalent of TextView in QT 4, and the rich text viewer of GTK+. What is the problem with putting a temporary Image in a temporary file in /tmp ? -- Benoit Minisini From gambas at ...538... Sat Dec 16 20:21:15 2006 From: gambas at ...538... (MV) Date: Sat, 16 Dec 2006 20:21:15 +0100 Subject: [Gambas-devel] Feature request for TextView In-Reply-To: <200612162000.11351.gambas@...1...> References: <200612161927.13961.gambas@...538...> <200612162000.11351.gambas@...1...> Message-ID: <200612162021.15438.gambas@...538...> Le samedi 16 D?cembre 2006 20:00, Benoit Minisini a ?crit?: > Sorry, but it is too complicated to do. Well, I had a feeling that wasn't going to cut it... Too bad... > What is the problem with putting a temporary Image in a temporary file > in /tmp ? None at all, save the necessity to keep tab on a local cache, and code some clean up routines ; it was just a matter of avoiding an uncessary step, and keeping user code tight and powerful. Plus it would have been possible to nicely 'tag' contents with stock icons and such, for instance. I understand it's just about eye candy, but bringing immediate eye candy to the casual programmer is half the fun of Gambas, the other half being the great harnessing of very powerful functionnalities. But I don't underestimate the complexity of your job bringing all those features to us, it was just a thought it might be possible without a lot of work. I'd really love to be able to help in actual coding, but I'm far from being skilled enough. -- Manuel From Karl.Reinl at ...16... Sun Dec 17 12:00:23 2006 From: Karl.Reinl at ...16... (Charlie Reinl) Date: Sun, 17 Dec 2006 07:00:23 -0400 Subject: [Gambas-devel] IDE Debug/Environment Message-ID: <200612170700.23398.Karl.Reinl@...16...> Salut Beno?t, in the IDE Debug/Environment is not finished! Amicalment Charlie From gambas at ...1... Sun Dec 17 12:08:21 2006 From: gambas at ...1... (Benoit Minisini) Date: Sun, 17 Dec 2006 12:08:21 +0100 Subject: [Gambas-devel] IDE Debug/Environment In-Reply-To: <200612170700.23398.Karl.Reinl@...16...> References: <200612170700.23398.Karl.Reinl@...16...> Message-ID: <200612171208.21546.gambas@...1...> On Sunday 17 December 2006 12:00, Charlie Reinl wrote: > Salut Beno?t, > > in the IDE Debug/Environment is not finished! > > Amicalment > Charlie > I know... -- Benoit Minisini From Karl.Reinl at ...16... Wed Dec 27 00:07:57 2006 From: Karl.Reinl at ...16... (Charlie Reinl) Date: Wed, 27 Dec 2006 00:07:57 +0100 Subject: [Gambas-devel] Aktivating editor-windows in IDE Message-ID: <200612270007.57649.Karl.Reinl@...16...> Salut Beno?t, what I wana to is, to unset/set Breakpoints from FDebugInfo.lstBreak by a dblclick. In my testing IDE that works fine. My problem is to switch back to the editor-windows, which where open when I dblclicked. FDebugInfo.lstBreak is a ColumnView in my IDE/FDebugInfo.form now. sLastLine = lstStack[0].Text --- some code to set/unset the breakpoint, which works xArgs = Scan(sLastLine, "*.*.*") hWin = Project.OpenFile(Project.FindPath(CStr(xArgs[0])), CInt(xArgs[2])) switchs back to that editor-window, but the editor-window is grey (not enabled) and the only way I found, was to set the ReadOnly of that editor-window to TRUE. But that cause problems, I can't close that project no more after. Do you have any hint for me ? Amicalment Charlie From gambas at ...1... Wed Dec 27 00:21:16 2006 From: gambas at ...1... (Benoit Minisini) Date: Wed, 27 Dec 2006 00:21:16 +0100 Subject: [Gambas-devel] Aktivating editor-windows in IDE In-Reply-To: <200612270007.57649.Karl.Reinl@...16...> References: <200612270007.57649.Karl.Reinl@...16...> Message-ID: <200612270021.17116.gambas@...1...> On Wednesday 27 December 2006 00:07, Charlie Reinl wrote: > Salut Beno?t, > > what I wana to is, to unset/set Breakpoints from FDebugInfo.lstBreak by a > dblclick. > > In my testing IDE that works fine. > > My problem is to switch back to the editor-windows, which where open when I > dblclicked. > > FDebugInfo.lstBreak is a ColumnView in my IDE/FDebugInfo.form now. > > sLastLine = lstStack[0].Text > > --- some code to set/unset the breakpoint, which works > > xArgs = Scan(sLastLine, "*.*.*") > hWin = Project.OpenFile(Project.FindPath(CStr(xArgs[0])), > CInt(xArgs[2])) > > switchs back to that editor-window, > but the editor-window is grey (not enabled) and the only way I found, was > to set the ReadOnly of that editor-window to TRUE. > But that cause problems, I can't close that project no more after. > > Do you have any hint for me ? > > Amicalment > Charlie > While debugging, every editor window is read-only. Anyway, breakpoint management is now a full mess: there are functions for setting, toggling breakpoints everywhere. You made a "clear all breakpoints" functions, whereas this function already exists in FDebugInfo. And so on... Things must be redone cleanly: I will do that by putting everything in the Design module. I think I will put all breakpoints in a string array. Regards, -- Benoit Minisini From gambas at ...1... Wed Dec 27 11:42:17 2006 From: gambas at ...1... (Benoit Minisini) Date: Wed, 27 Dec 2006 11:42:17 +0100 Subject: [Gambas-devel] Aktivating editor-windows in IDE In-Reply-To: <200612270007.57649.Karl.Reinl@...16...> References: <200612270007.57649.Karl.Reinl@...16...> Message-ID: <200612271142.17769.gambas@...1...> On Wednesday 27 December 2006 00:07, Charlie Reinl wrote: > Salut Beno?t, > > what I wana to is, to unset/set Breakpoints from FDebugInfo.lstBreak by a > dblclick. > > In my testing IDE that works fine. > > My problem is to switch back to the editor-windows, which where open when I > dblclicked. > > FDebugInfo.lstBreak is a ColumnView in my IDE/FDebugInfo.form now. > > sLastLine = lstStack[0].Text > > --- some code to set/unset the breakpoint, which works > > xArgs = Scan(sLastLine, "*.*.*") > hWin = Project.OpenFile(Project.FindPath(CStr(xArgs[0])), > CInt(xArgs[2])) > > switchs back to that editor-window, > but the editor-window is grey (not enabled) and the only way I found, was > to set the ReadOnly of that editor-window to TRUE. > But that cause problems, I can't close that project no more after. > > Do you have any hint for me ? > > Amicalment > Charlie > Some points: - Maybe the '.debug' settings file should be renamed as '.settings', because we may store non debugging related settings in it in the future. - Please use full names when defining public identifiers in the source code: ClearBreakpoints is better than ClearBkp for example. Regards, -- Benoit Minisini From Karl.Reinl at ...16... Wed Dec 27 15:13:54 2006 From: Karl.Reinl at ...16... (Charlie Reinl) Date: Wed, 27 Dec 2006 15:13:54 +0100 Subject: [Gambas-devel] Aktivating editor-windows in IDE In-Reply-To: <200612271446.25121.gambas@...1...> References: <200612270007.57649.Karl.Reinl@...16...> <200612271142.17769.gambas@...1...> <1167222996.5332.2.camel@...548...> <200612271446.25121.gambas@...1...> Message-ID: <1167228835.5332.13.camel@...548...> Am Mittwoch, den 27.12.2006, 14:46 +0100 schrieb Benoit Minisini: > On Wednesday 27 December 2006 13:36, you wrote: > > Am Mittwoch, den 27.12.2006, 11:42 +0100 schrieb Benoit Minisini: > > > On Wednesday 27 December 2006 00:07, Charlie Reinl wrote: > > > > Salut Beno?t, > > > > > > > > what I wana to is, to unset/set Breakpoints from FDebugInfo.lstBreak > > > > by a dblclick. > > > > > > > > In my testing IDE that works fine. > > > > > > > > My problem is to switch back to the editor-windows, which where open > > > > when I dblclicked. > > > > > > > > FDebugInfo.lstBreak is a ColumnView in my IDE/FDebugInfo.form now. > > > > > > > > sLastLine = lstStack[0].Text > > > > > > > > --- some code to set/unset the breakpoint, which works > > > > > > > > xArgs = Scan(sLastLine, "*.*.*") > > > > hWin = Project.OpenFile(Project.FindPath(CStr(xArgs[0])), > > > > CInt(xArgs[2])) > > > > > > > > switchs back to that editor-window, > > > > but the editor-window is grey (not enabled) and the only way I found, > > > > was to set the ReadOnly of that editor-window to TRUE. > > > > But that cause problems, I can't close that project no more after. > > > > > > > > Do you have any hint for me ? > > > > > > > > Amicalment > > > > Charlie > > > > > > Some points: > > > > > > - Maybe the '.debug' settings file should be renamed as '.settings', > > > because we may store non debugging related settings in it in the future. > > > > OK. should I make it ? so I can also rename ClearBkp to > > ClearBreakpoints. > > But If you want, you also can do it ? > > > > I will do it. I'm working on redesigning breakpoint management... > > Regards, I found a Bug in FDebugInfo.class I made at : PUBLIC SUB cvwWatch_Activate() - DIM sText AS String = cvwObject.Item.Text (BUG) + DIM sText AS String = cvwWatch.Item.Text IF Right(sText) = ":" THEN RETURN Design.Command("#X" & sText & "\t" & sText) did you start or can I commit it. Amicalment Charlie From gambas at ...1... Wed Dec 27 15:15:22 2006 From: gambas at ...1... (Benoit Minisini) Date: Wed, 27 Dec 2006 15:15:22 +0100 Subject: [Gambas-devel] Aktivating editor-windows in IDE In-Reply-To: <1167228835.5332.13.camel@...548...> References: <200612270007.57649.Karl.Reinl@...16...> <200612271446.25121.gambas@...1...> <1167228835.5332.13.camel@...548...> Message-ID: <200612271515.22799.gambas@...1...> On Wednesday 27 December 2006 15:13, Charlie Reinl wrote: > Am Mittwoch, den 27.12.2006, 14:46 +0100 schrieb Benoit Minisini: > > On Wednesday 27 December 2006 13:36, you wrote: > > > Am Mittwoch, den 27.12.2006, 11:42 +0100 schrieb Benoit Minisini: > > > > On Wednesday 27 December 2006 00:07, Charlie Reinl wrote: > > > > > Salut Beno?t, > > > > > > > > > > what I wana to is, to unset/set Breakpoints from > > > > > FDebugInfo.lstBreak by a dblclick. > > > > > > > > > > In my testing IDE that works fine. > > > > > > > > > > My problem is to switch back to the editor-windows, which where > > > > > open when I dblclicked. > > > > > > > > > > FDebugInfo.lstBreak is a ColumnView in my IDE/FDebugInfo.form now. > > > > > > > > > > sLastLine = lstStack[0].Text > > > > > > > > > > --- some code to set/unset the breakpoint, which works > > > > > > > > > > xArgs = Scan(sLastLine, "*.*.*") > > > > > hWin = Project.OpenFile(Project.FindPath(CStr(xArgs[0])), > > > > > CInt(xArgs[2])) > > > > > > > > > > switchs back to that editor-window, > > > > > but the editor-window is grey (not enabled) and the only way I > > > > > found, was to set the ReadOnly of that editor-window to TRUE. > > > > > But that cause problems, I can't close that project no more after. > > > > > > > > > > Do you have any hint for me ? > > > > > > > > > > Amicalment > > > > > Charlie > > > > > > > > Some points: > > > > > > > > - Maybe the '.debug' settings file should be renamed as '.settings', > > > > because we may store non debugging related settings in it in the > > > > future. > > > > > > OK. should I make it ? so I can also rename ClearBkp to > > > ClearBreakpoints. > > > But If you want, you also can do it ? > > > > I will do it. I'm working on redesigning breakpoint management... > > > > Regards, > > I found a Bug in FDebugInfo.class I made > > at : > > PUBLIC SUB cvwWatch_Activate() > > - DIM sText AS String = cvwObject.Item.Text (BUG) > + DIM sText AS String = cvwWatch.Item.Text > > IF Right(sText) = ":" THEN RETURN > Design.Command("#X" & sText & "\t" & sText) > > did you start or can I commit it. > > Amicalment > Charlie > You can commit. I will solve conflicts later. -- Benoit Minisini From Karl.Reinl at ...16... Wed Dec 27 18:58:36 2006 From: Karl.Reinl at ...16... (Charlie Reinl) Date: Wed, 27 Dec 2006 18:58:36 +0100 Subject: [Gambas-devel] Aktivating editor-windows in IDE In-Reply-To: <200612270021.17116.gambas@...1...> References: <200612270007.57649.Karl.Reinl@...16...> <200612270021.17116.gambas@...1...> Message-ID: <1167242316.5155.11.camel@...548...> Am Mittwoch, den 27.12.2006, 00:21 +0100 schrieb Benoit Minisini: > On Wednesday 27 December 2006 00:07, Charlie Reinl wrote: > > Salut Beno?t, > > > > what I wana to is, to unset/set Breakpoints from FDebugInfo.lstBreak by a > > dblclick. > > > > In my testing IDE that works fine. > > > > My problem is to switch back to the editor-windows, which where open when I > > dblclicked. > > > > FDebugInfo.lstBreak is a ColumnView in my IDE/FDebugInfo.form now. > > > > sLastLine = lstStack[0].Text > > > > --- some code to set/unset the breakpoint, which works > > > > xArgs = Scan(sLastLine, "*.*.*") > > hWin = Project.OpenFile(Project.FindPath(CStr(xArgs[0])), > > CInt(xArgs[2])) > > > > switchs back to that editor-window, > > but the editor-window is grey (not enabled) and the only way I found, was > > to set the ReadOnly of that editor-window to TRUE. > > But that cause problems, I can't close that project no more after. > > > > Do you have any hint for me ? > > > > Amicalment > > Charlie > > > > While debugging, every editor window is read-only. > > Anyway, breakpoint management is now a full mess: there are functions for > setting, toggling breakpoints everywhere. You made a "clear all breakpoints" > functions, whereas this function already exists in FDebugInfo. And so on... > > Things must be redone cleanly: I will do that by putting everything in the > Design module. I think I will put all breakpoints in a string array. > > Regards, > Let me explain my idea behind : short := comfort longer : = - The added 'clear all breakpoints' is to have the possibility to do that, if the FDebugInfo window is not yet available, means before starting to debug. - The new possibility to switch on/off the breakpoints in FDebugInfo.lstBreak is to have an easy way to stop or not in the next step. e.g. you loop , in that loop a function is called, where a breakpoint is set, but you only want to see if that function is called with the value 'toto' In FDebugInfo.lstBreak when you start to debug, you see all the set breakpoints with an Check-Icon. If you dblclick the Icon change to UnChecked, the breakpoint is set to False (stripped) but the entry for that breakpoint keeps staying in FDebugInfo.lstBreak. So if the value in example is 'toto' you can switch on the breakpoint by an simple dblclick. Amicalment Charlie From chintanraoh at ...176... Sat Dec 30 12:00:46 2006 From: chintanraoh at ...176... (chintan rao) Date: Sat, 30 Dec 2006 16:30:46 +0530 Subject: [Gambas-devel] gb.options Message-ID: Hi I have made a component using getopt function here is the GB_DESC GB_DECLARE("GetOptions", sizeof(COPTIONS)), GB_METHOD ( "_new", NULL, COPTIONS_new, "(Options)s[(Argument)String[];]" ), GB_METHOD ( "_free", NULL, COPTIONS_free, NULL ), GB_METHOD ( "_get" ,"v",COPTIONS_get,"(Option)s" ), GB_METHOD ( "NextOption","s",COPTIONS_next,NULL ), GB_METHOD ( "OptionArgument","s",COPTIONS_opt_arg,NULL ), GB_METHOD ( "RestOfArgs","String[]",COPTIONS_rest,NULL ), GB_METHOD ( "GetErrorOption","s",COPTIONS_invalid,NULL ), GB_METHOD ( "GetArgument","String[]",COPTIONS_getarg,"(Option)s"), GB_PROPERTY_READ ("CommandLineArgs","String[]",COPTIONS_cmdline), I have made it non-static which i think is right(hopefully). NextOption works like getopt function. OptionArgument is optarg. GetErrorOption is optopt. RestOfArgs gives the remaining arguments after running getopt. _get function does not follow getopt template for example DIM opt AS NEW GetOptions("h:elo") if argument not specify assumes agument as command line options Options["h"] -> returns the last argument associated with 'h' if any othewise returns 0 Options["e"] -> returns 1 if the 'e' option is specified, and 0 otherwise. Options["z"] -> returns 0 opt.GetArgument("h") returns all the arguments assosiated with 'h' opt.CommandLineArgs returns the command line options Example 1(getopt style) ' Gambas module file PUBLIC SUB Main() DIM opt AS NEW GetOptions(":h:elo") DIM c AS String PRINT "command line args:\"" & opt.CommandLineArgs.Join(" ") & "\"" c = opt.NextValidOption() PRINT opt.OptionArgument() IF c = "" BREAK ENDIF SELECT CASE c CASE "h" PRINT "option h" & " the corresponding argument is\"" & opt.OptionArgument() & "\"" CASE "e" PRINT "option e" CASE "l" PRINT "option l" CASE "o" PRINT "option o" CASE "?" PRINT "error parsing the arguments" PRINT "invalid option " & opt.GetErrorOption() CASE ":" PRINT "error parsing the arguments" PRINT "no arguments to option " & opt.GetErrorOption() END SELECT WEND IF opt.RestOfArgs().Count <> 0 PRINT "Rest of the arguments are \"" & opt.RestOfArgs().Join(" ") & "\"" ENDIF END Example 2 (using "_get") ' Gambas module file PUBLIC SUB Main() DIM opt AS NEW GetOptions("hevo:") IF opt["?"] = 1 PRINT "error parsing the arguments" ENDIF IF opt["h"] = 1 PRINT "Help" ENDIF IF opt["e"] = 1 PRINT "Execute" ENDIF IF opt["v"] = 1 PRINT "Verbose" ENDIF IF opt["o"] <> 1 AND opt["o"] <> 0 PRINT "Ouput to " & opt["o"] ENDIF END I wonder should i return all the valid options found as a String[] all at once Hoping this interface is alright If there should be a static interface i think it should be for command line arguments in particular Chintan Rao H OPEN at ...549... -------------- next part -------------- An HTML attachment was scrubbed... URL: