[Gambas-user] Inbuilt function to check if a string contains a valid number

2011-07-26 Thread vikram
Hi,

Is there an inbuilt function in Gambas 2 (2.21) to check if a string contains a 
valid number?


Thanks,
Vikram Nair
--
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Using Character constants in Gambas

2011-03-08 Thread vikram
Hi Caveat,

Thanks, that is a lot simpler :)

Best Regards,
Vikram Nair



  
--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Using Character constants in Gambas

2011-03-08 Thread vikram
Hi Caveat,

Thanks, that is a lot simpler :)

Best Regards,
Vikram Nair



  
--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Using Character constants in Gambas

2011-03-07 Thread vikram
Hi,

I am working on an application in which I reuse the same dialog for performing 
different tasks. I have a PUBLIC INTEGER variable(named dialogType) in the 
dialog's .class file. When creating instances of this dialog I set the 
DialogInstance.dialogType to the value(0,1,2,...) which indicates the purpose 
of the dialog. The value of DialogInstance.dialogType is used within the dialog 
to decide what to do with the user input.

I am using numeric values to indicate the dialog type. This isn't very elegant. 
I am looking for the Gambas equivalent of doing a #define CHARCONST value in C.

I have tried using a Collection.

DIM DialogType AS NEW Collection
DialogType[SomeType0] = 0
DialogType[SomeType1] = 1
DialogType[SomeType2] = 2
DialogType[SomeType3] = 3
DialogType[SomeType4] = 4

I am thinking of placing the collection's definition in a Module and then using 
it to replace the numeric constants:
DIM DialogInstance as DialogName
DialogInstance = NEW DialogName
DialogInstance.dialogType = ModuleName.DialogType[SomeType0]
'current code
'DialogInstance.dialogType = 0

Is there a better way of using character constants in Gambas?

Gambas 2.21/Debian 6

Thanks,
Vikram Nair



  
--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Copying to GNOME's clipboard

2011-02-14 Thread vikram
Hi,

I am using Gambas 2.21(gb.gtk) on Debian Squeeze(GNOME). I am trying to copy 
text from my application onto GNOME's clipboard. 

I did try using Clipboard.Copy to copy onto the Clipboard the text copied only 
remains on the clipboard for as long as the gambas application is running. The 
moment the gambas application is closed the clipboard is cleared.

How can i make the text in the clipboard persist even after the gambas 
application is closed?

Thanks in advance,
Best Regards,
Vikram Nair



 

Finding fabulous fares is fun.  
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel 
bargains.
http://farechase.yahoo.com/promo-generic-14795097
--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Application logging using SHELL

2011-01-20 Thread vikram
Thank you both for the replies.
I am going to try using SHELL.

Regards,
Vikram Nair



  
--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Feature request

2011-01-20 Thread vikram
Hi,

I am not sure if its a little late for this but having shrink/expand buttons 
for code in the IDE would be nice. You know the little + - signs that let you 
shrink or expand loops and functions.

P.S.: I've not used Gambas3 yet, so please ignore this mail if it's already got 
this feature.

Regards,
Vikram




  
--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] using echo command within EXEC

2011-01-19 Thread vikram
Hi,

I am using Gambas 2.21, on Debian Squeeze. I am trying to keep a log of the 
things my application does, for instance events like forms opening, errors can 
be logged.

I am thinking of using the SHELL with echo command to write to a log file. 

For example, using SHELL i would use:
SHELL echo \Form1 Entered\Logfile

Could this cause the application to be a resource hog? The only other way I can 
think of to do logging is to use File I/O but that would be a lot of work when 
compated to using SHELL, plus I don't know it will prove to be more of a 
resource hog than using SHELL.

Help!

Thanks in advance,
Regards,
Vikram Nair



  
--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Application logging using SHELL

2011-01-19 Thread vikram
Hi,

I am using Gambas 2.21, on Debian Squeeze. I am trying to keep a log of the 
things my application does, for instance events like forms opening, errors can 
be logged.

I am thinking of using the SHELL with echo command to write to a log file.

For example, using SHELL i would use:
SHELL echo \Form1 Entered\Logfile

Could this cause the application to be a resource hog? The only other way I can 
think of to do logging is to use File I/O but that would be a lot of work when 
compated to using SHELL, plus I don't know it will prove to be more of a 
resource hog than using SHELL.

Help!

Thanks in advance,
Regards,
Vikram Nair

@Mods: kindly delete the earlier thread titled using echo command within 
EXEC, i had sent it with a wrong subject by mistake.



  
--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Difference in SpinBox behavior between gb.gtk gb.qt

2011-01-05 Thread vikram
Hi,

The SpinBox control when used in an application using the gb.gtk component 
allows the user to input values that are larger than it's MaxValue property. 
Say the MaxValue for a SpinBox is 100, the user can enter 999 and click the 
button to move to the next form, the SpinBox now automatically changes the 
value to 100. This is good because junk values won't get saved, but the problem 
is that there is no way of extracting the value with SpinBox.Value to show the 
user an error message that the value he wanted(999) is not valid!

If on the other hand the application uses the gb.qt component the user cannot 
enter any value greater than 100, the SpinBox control wouldn't let him! Is 
there anyway the same can be achieved in applications using the gb.gtk 
component?

Regards,
Vikram Nair




  

SpinBoxIssue2GTK.tar.gz
Description: GNU Zip compressed data


SpinBoxIssue2TQ.tar.gz
Description: GNU Zip compressed data
--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Button - Default Property - Doubt

2011-01-03 Thread vikram
Hi,

Thanks for the reply on the Spinbox issue :) 

Heres another issue i faced recently, I had set the default property for a 
button on one of the forms of my project. This would allow the user to press 
the enter key instead of clicking the said button. Trouble is that even if 
another button has focus when the user presses Enter, the button with the 
default event set still gets called. With other controls this behavior is 
intended, for instance if the user presses enter while the focus is at a 
textbox the default button being called is what is expected, but if the user 
uses Tab to navigate to another button and then presses Enter then shouldn't 
that button's click function be executed?

I have attached a sample project for your reference.

Is there any way to avoid this?

OS: Debian Squeeze (GNOME)

GB.GTK component used.

Gambas version 2.21



Best Regards,
Vikram




  

DefaultButtonIssue.tar
Description: Unix tar archive
--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Displaying the same form n times

2010-12-21 Thread vikram
Thank you very much :)

--- On Tue, 12/21/10, vikram austin...@yahoo.com wrote:

From: vikram austin...@yahoo.com
Subject: 
To: self austin...@yahoo.com
Date: Tuesday, December 21, 2010, 4:21 AM

just use .ShowModal insteed of .show

2010/12/20 vikram austin...@yahoo.com:
 Hi,

 Thanks a lot for your response :)
 This opens all the IP
 Input dialogs at one go. It would be better if the IP input dialogs
 were displayed one after the other. Maybe theres a way to link one dialog's 
 Open event to another's Close event, or maybe there is some other way to do 
 this.

 Thanks again,
 Vikram

 --- On Mon, 12/20/10, vikram austin...@yahoo.com wrote:

 From: vikram austin...@yahoo.com
 Subject: [Gambas-user] Displaying the same form n times
 To: austin...@yahoo.com
 Date: Monday, December 20, 2010, 6:52 AM

 PUBLIC SUB Button1_Click()

  DIM count AS Integer
  dim hForm as IPinput
  ascount = txtAScount.Text        'Point 1  '''never use underscore
 in names and str to int is automatic

  FOR count = 1 TO ascount
    hForm = New IPinput
    hForm.show

  NEXT
 END



 in IP Input form add :

 STATIC PUBLIC aIP as NEW STRING[]



 PUBLIC SUB Button_Clic()

 IPInput.aIP.Add(txtInput.Text)

 END










 2010/12/20 vikram austin...@yahoo.com:
 Hi,

 I have two forms in my application, the first one asks how many Application 
 Servers to configure, and then displays second one(IP input dialog) for each 
 Application Server. For example if there are 5 Application Server, the IP 
 input
  dialog is displayed 5 times.

 I was thinking of calling the IP input dialog from a FOR loop within the 
 first form,

 PUBLIC SUB Button1_Click()

   DIM count AS Integer

   ascount = CInt(txt_AScount.Text)        'Point 1

   FOR count = 1 TO ascount
     IPinput.show

   NEXT
 END

 There are two things I am unsure of here:
 1.the number of IP Addresses to be entered is to decided
 at runtime, I was thinking of storing all IP Addresses entered via the IP 
input dialog into a String array. But there is no
  way of deciding what the size of the string array should be till Point 
 1(marked in code), and it is not possible syntactically to define an array 
 at that point in code.
 2.The FOR loop for displaying the IP input dialog is not displaying the form
  ascount times. It only displays it once.

 This probably not as complex as it seems, but i am stuck at this point 
 trying to find a solution to this :( I am attaching a sample project with 
 this mail for your reference.

 Any help would be greatly appreciated.

 Thanks in advance,
 Vikram




 --
 Lotusphere 2011
 Register
 now for Lotusphere 2011 and learn how
 to connect the dots, take your collaborative environment
 to the next level, and enter the era of Social Business.
 http://p.sf.net/sfu/lotusphere-d2d
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user





 --
 Fabien Bodard







 --
 Lotusphere 2011
 Register now for Lotusphere 2011 and learn how
 to
 connect the dots, take your collaborative environment
 to the next level, and enter the era of Social Business.
 http://p.sf.net/sfu/lotusphere-d2d
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user




-- 
Fabien Bodard



  


  
--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Displaying the same form n times

2010-12-20 Thread vikram
Hi,

Thanks a lot for your response :)
This opens all the IP
Input dialogs at one go. It would be better if the IP input dialogs
were displayed one after the other. Maybe theres a way to link one dialog's 
Open event to another's Close event, or maybe there is some other way to do 
this.

Thanks again,
Vikram

--- On Mon, 12/20/10, vikram austin...@yahoo.com wrote:

From: vikram austin...@yahoo.com
Subject: [Gambas-user] Displaying the same form n times
To: austin...@yahoo.com
Date: Monday, December 20, 2010, 6:52 AM

PUBLIC SUB Button1_Click()

  DIM count AS Integer
  dim hForm as IPinput
  ascount = txtAScount.Text'Point 1  '''never use underscore
in names and str to int is automatic

  FOR count = 1 TO ascount
hForm = New IPinput
hForm.show

  NEXT
END



in IP Input form add :

STATIC PUBLIC aIP as NEW STRING[]



PUBLIC SUB Button_Clic()

IPInput.aIP.Add(txtInput.Text)

END










2010/12/20 vikram austin...@yahoo.com:
 Hi,

 I have two forms in my application, the first one asks how many Application 
 Servers to configure, and then displays second one(IP input dialog) for each 
 Application Server. For example if there are 5 Application Server, the IP 
 input
 dialog is displayed 5 times.

 I was thinking of calling the IP input dialog from a FOR loop within the 
 first form,

 PUBLIC SUB Button1_Click()

   DIM count AS Integer

   ascount = CInt(txt_AScount.Text)        'Point 1

   FOR count = 1 TO ascount
     IPinput.show

   NEXT
 END

 There are two things I am unsure of here:
 1.the number of IP Addresses to be entered is to decided at runtime, I was 
 thinking of storing all IP Addresses entered via the IP input dialog into a 
 String array. But there is no
  way of deciding what the size of the string array should be till Point 
 1(marked in code), and it is not possible syntactically to define an array at 
 that point in code.
 2.The FOR loop for displaying the IP input dialog is not displaying the form
 ascount times. It only displays it once.

 This probably not as complex as it seems, but i am stuck at this point trying 
 to find a solution to this :( I am attaching a sample project with this mail 
 for your reference.

 Any help would be greatly appreciated.

 Thanks in advance,
 Vikram




 --
 Lotusphere 2011
 Register now for Lotusphere 2011 and learn how
 to connect the dots, take your collaborative environment
 to the next level, and enter the era of Social Business.
 http://p.sf.net/sfu/lotusphere-d2d
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user





-- 
Fabien Bodard



  


  
--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Displaying Mouse.Wait while running a SHELL Command

2010-11-24 Thread vikram
Hi,

Heres how i fixed it, hope it is the right way to display a wait cursor 
while a process executes.

-
FMain.Mouse = Mouse.Wait
WAIT 
Application.Busy = 1

SHELL sha512sum lenny.iso TO actualSUM

Application.Busy = 0
FMain.Mouse = Mouse.Default
-

I read If you call WAIT from an event handler, you may create infinite 
recursions, and then stack overflows from the Docs, i hope it wouldn't be an 
issue in this case (i.e., if i were to use WAIT for the click event of a 
Button).

Regards,
Vikram


  
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Displaying Mouse.Wait while running a SHELL Command

2010-11-24 Thread vikram
 Setting FMain.Mouse and calling WAIT is useless. Application.Busy should 
 already set the busy cursor for every widget in the application. Otherwise 
 this is a bug.
Application.Busy alone is not showing a busy pointer on Debian Squeeze, with 
Gambas 2.21.

Regards,
Vikram



  
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Displaying Mouse.Wait while running a SHELL Command

2010-11-23 Thread vikram
Hi,

How do i display a wait cursor while a process is running? I have tried using 

    ME.mouse = Mouse.Wait

without much luck.

Heres a code snippet:

  ME.mouse = Mouse.Wait
  Application.Busy = 1

  command = sha512sum   filePath  |awk '{print $1}' 
  SHELL command TO checksum

  checksum = Left(checksum, Len(checksum) - 1) 'strip \n
  txta_checksum.Text = checksum

  Application.busy = 0
  ME.Mouse = Mouse.DEFAULT 


I am using Gambas 2.21.

Thanks,
Vikram


  
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Displaying Mouse.Wait while running a SHELL Command

2010-11-23 Thread vikram
You can use the Wait keyword, see http://gambasdoc.org/help/lang/shell

Something like:
SHELL command Wait TO checksum

Thanks for the quick reply. Adding WAIT to the SHELL command is not causing the 
mouse cursor to change to Mouse.Wait :(

Regards,
Vikram



  
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Displaying Mouse.Wait while running a SHELL Command

2010-11-23 Thread vikram
Hi, 

heres a sample program.

iam running sha512sum on file which are 100MB+ in size, its takes around 5 
seconds. right now the button stays depressed until the hash has been displayed.

regards,
Vikram



  

GenerateSHA512.tar.gz
Description: GNU Zip compressed data
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Me.Close in a multi-form application

2010-08-11 Thread vikram
hi,

i have a multiform application, on the Close event of each form a confirmation 
dialog is displayed. 

The user clicks a button on each form to move to the next one(or clicks a 
button to go back to the previous form), when he/she does this the current 
form's Visible property is set to false and that of the desired form is set to 
true.

When the user exits the application, Me.Close would only close the current form 
and all previous forms would remain in memory. I remember reading from the 
documentation that QUIT should not be used in GUI applications. If i close all 
previously opened forms by using FormName.Close each form's confirmation dialog 
pops up.

I've been thinking of way out of this, the only idea i've been able to come up 
with is that if there is a way a function could tell who called it, i could use 
that to prevent the confirmation dialogs from being displayed on form close. 

Say user closes Form C, now Forms A  B are have their Visible property set to 
False so they are hidden. On the Close event of Form C i call Form A,B  C's 
Close method. If Form A  B's Close method could tell that they've been called 
from another form, then maybe i could prevent the confirmation dialogs from 
popping up. Or could there be some other way to do this?

I have a attached a sample application which illustrates the problem.

Thanks in advance :)
Vikram Shankar Nair



  

multiformClose.tar.gz
Description: GNU Zip compressed data
--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev ___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Confirm on form close

2010-08-05 Thread vikram
@Benoit: Thank you :)
@Matti: Thanks, it works on Gambas2. I am working on a Live Installer which 
would work on Debian  BOSS/GNU Linux. 




  
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Confirm on form close

2010-08-04 Thread vikram
Hi,

Is there a way to confirm from a user when decides to close a form?

PUBLIC SUB Form_Close()
  DIM retVal AS Integer
  retval = Message.Question(Are you sure you want to exit?, Yes, No)
  IF retVal = 1 THEN 
    ME.Close
  ELSE IF retVal = 2 THEN 
    'code to prevent the form from exiting
  ENDIF 
END

Nothing i've put there seems to have been able to stop the form from exiting so 
far.

Thanks
Vikram




  
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] How to make Context Menus?

2010-07-21 Thread vikram
Hi,

I am new to gambas, I am using Gambas 2.7 on Debian Lenny. I need to make 
context menus for a project I am working on, i tried googling but came up 
pretty much empty handed...any help on this is welcome.

Thanks
Vikram Nair



  
--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Help with redirecting stdout of the GNU shred command (SHELL/EXEC)

2010-05-25 Thread vikram
Hi,

I am new to
Gambas and this is my first application. I have been working with
C/VC++ and Gambas has been fun so far except for this little problem
i've run into...
 
I am trying to make a GUI front end for the
GNU shred command. I have got to the stage where the user can select a
file via GUI and shred(using SHELL). I am trying to make it more
interactive by reading stdout from shred -v into the Gambas
application. I have followed
http://www.gambasforum.com/index.php?topic=120.0;wap2 and tried to use
EXEC to read stdout, haven't had much luck with it so far :( 



Heres the code:

'global variables

PRIVATE filename AS String   

PRIVATE delfile AS Boolean

PRIVATE shredprocess AS Process

PRIVATE shredcommanddel AS String[3]

PRIVATE shredcommandnodel AS String[3]



'this is where i initialize the command arrays for EXEC

'the last element is replaced later by the filepath

PUBLIC SUB Form_Open()

  'tbx_filename

  shredcommanddel = [shred , -uv ,  ]

  shredcommandnodel = [shred , -v ,  ]

END



'Display a file open dialog and save the path of the file selected to filepath

PUBLIC SUB btn_fileselect_Click()

  IF Dialog.OpenFile() THEN RETURN 

    filename = Dialog.Path 

    tbx_filename.Text = filename

END



'the actual shredding happens here, the code with EXEC is ineffective at the 
moment it doesnt shred the file

'SHELL works, but i dont know how to redirect stdout with either of these

PUBLIC SUB btn_shred_Click()

  'DIM shellcommand AS String[]

  'Message(filename)

  IF delfile THEN 

    'shellcommand = shred --remove --verbose   filename  

    shredcommanddel[2] = filename

    shredprocess = EXEC shredcommanddel 'FOR READ 

  SHELL shred -uv   filename

  ELSE 

    'shellcommand = shred --verbose   filename 

    shredcommandnodel[2] = filename

    shredprocess = EXEC shredcommandnodel 'FOR READ 

    SHELL shred -v   filename

  ENDIF 

  'SHELL shellcommand FOR READ AS Process

  

END

  

'Execution never gets here  

PUBLIC SUB Process_Read()

  DIM resultline AS String

  LINE INPUT #shredprocess, resultline

  Message(HERE WE ARE!)

  resultline = resultline  GB.NewLine

END



PUBLIC SUB CheckBox1_Click()

  delfile = TRUE

END



I am looking for a way to redirect output from the shred to my Gambas 
application.

Appreciate your help in this.

Thanks,
Vikram 




  
--

___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user