[Gambas-user] gambas noob needs assistance(2 questions)

Benoit Minisini gambas at ...1...
Thu Sep 2 22:52:39 CEST 2004


On Thursday 02 September 2004 22:33, Chas.Bigham wrote:
> hi everyone. first, to the gambas development team: great job on gambas
> and thank you for a development environment i am familiar with. now i
> can learn more Basic coding and deploy apss and utilities i need for
> linux without having to scour the internet trying to find something that
> might meet my needs.
>
> but, since i'm a noob at "visual basic like" languages (did BASIC coding
> years ago(GWBASI and BASICA) and only an introductory course to VB in
> college) i'm afraid i am rather on the novice level and finding
> difficulties implementing some features of the app i am currently
> working on (gui4bdc. see http://gui4bdc.sourceforge.net for more info
> </end shameless plug>.
>
> i have two questions regarding features i would like to implement that
> i've not found covered well in either the gambas help docs, or were not
> covered at all in the Easy Gambas Doku(both of which have been
> invaluable resources up to now, as well as this mailing list). my first
> question regards how to kill a process id launched by my application. my
> application is a graphical front-end to a console app(Bit Defender) and
> thusly does this:
>
> code
> ---------------------------------------------------------------------------
>
> PUBLIC SUB btnScan_Click()
>     EXEC [ "bdc", $Option0, $Option1, $Option2, $PathToBeScanned ] FOR READ
> END
> --------------------------------------------------------------------------
>
> how can i get the process id of bdc and return it to my front-end so
> that i can enable a Stop Scan button, killing the bdc command and
> stopping it from scanning....
>

You must do 

DIM hProcess AS Process

EXEC [ "bdc", $Option0, $Option1, $Option2, $PathToBeScanned ] FOR READ AS 
hProcess

to get the a reference to the process object in hProcess. Then you can use all 
the methods and properties of the object.

See the MoviePlayer example that pilot mplayer the same way you want to pilot 
bdc.

>
> second question: in relation to the above EXEC statement, i would like
> to implement a Quarantine Viewer in my front-end, using a column view to
> display the contents of bdc's quarantine folders. bdc returns info that
> reads somethinmg like:
> "/home/shared/setup.exe Infected VirusName.W32.AA"
> what i want is to be able to parse that string into a columnview with 3
> headings: File, Status, and Infected With and the relevant bits given by
> bdc returned to each corresponding column. (ie: File:
> /home/shared/Setup.exe, Status: Infected, Infected With: VirusName.W32.AA)
>
> i've read through the mailing list and while i've found answers to some
> of other problems i was having, i've been unable to find a suitable
> answer for both of these problems. any help that anyone can offer is
> greatly and genuinely appreciated

To know hot to use a ColumnView, look at FPropertyProject.class in the IDE 
sources. A ColumnView example will be a good idea :-)

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list