Re: [Gambas-user] usage of too much GOTO can be bad pracitce ?

2017-06-25 Thread Nigel Verity
I don't believe the use of GOTO is bad practice in terms of the efficiency and 
performance of the program, but its convenience often leads to lazy "spaghetti" 
code design which, in turn, usually leads to bugs.


The use of RETURN is a much tidier way of breaking out of a SUB or FUNCTION, 
which has the effect of "GOTO END OF SUB/FUNCTION". It will then take you to 
the next line in the SUB/FUNCTION which made the call.


It is always possible to write and position IF, SWITCH statements or loops in a 
way to avoid the need for a GOTO statement. The code following the 
corresponding label could, for example, be contained in a separate SUB or 
FUNCTION, which makes the code tidier and makes it easily reusable within the 
program.


I certainly would not say that programmer who uses lots of GOTO statements is a 
bad programmer (as long as the program works correctly and efficiently) but I 
believe that few developers would choose to maintain code written by somebody 
else containing lots of GOTO statements.


It's important to stress that this principle is not unique to Gambas. Nearly 
all programming languages support the concept of the "GOTO" (even C), and VB 
actively encourages it in its error handling, which is why Gambas is so 
superior.


Nige
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Control Modification Suggestion

2017-03-16 Thread Nigel Verity
Hi

In my days as a VB developer I found a feature of the combo control very 
useful, which perhaps could be considered for Gambas.

Each item in the list has a display value (text), and an integer index to 
describe its position in the list. This is the same as the Gambas combo 
control. However the VB control also has a "key" property which was very useful 
in applications where the display value had to be translated to an integer ID 
to be saved to a database.

In my Gambas applications I achieve the same result by declaring a dynamic 
integer array and updating it in parallel with the combo control. It would save 
a fair bit of coding to simply have a combo.current.key property.

Sadly I think the standard of my coding is now too rusty to do an efficient job 
of creating the control myself.

Nige
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Console Window

2017-01-08 Thread Nigel Verity
Hi


I have recently upgraded to 3.9.2 from the Linux Mint 17.3 repositories.


Whenever I open an existing project, the console window "floats" (i.e not 
docked) above the rest of the IDE.


Is there any way I can stop this from happening?


Thanks


Nige
--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Slow Gambas Startup

2016-08-03 Thread Nigel Verity
Hi 

I have Gambas 3.8.4 installed on 3 laptops, in each case running Mint 17.3 
Mate. While each is a different hardware spec they are similar. Two have SSDs 
and one a spinning HD.

My problem is that on 2 machines Gambas starts up in a few seconds. On the 3rd 
it takes more than  a minute. Once it is running it works well - it's purely 
the startup which is very slow. All other applications installed on this 
machine (SSD) seem to start normally.

I have reinstalled Gambas but it makes no difference. Does Gambas perform any 
disk or file checks during startup which might explain this odd behaviour?

Thanks

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


[Gambas-user] Slow Gambas Startup

2016-08-03 Thread Nigel Verity
Hi 

I have Gambas 3.8.4 installed on 3 laptops, in each case running Mint 17.3 
Mate. While each is a different hardware spec they are similar. Two have SSDs 
and one a spinning HD.

My problem is that on 2 machines Gambas starts up in a few seconds. On the 3rd 
it takes more than  a minute. Once it is running it works well - it's purely 
the startup which is very slow. All other applications installed on this 
machine (SSD) seem to start normally.

I have reinstalled Gambas but it makes no difference. Does Gambas perform any 
disk or file checks during startup which might explain this odd behaviour?

Thanks

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


[Gambas-user] Slow Gambas Startup

2016-08-03 Thread Nigel Verity
Hi 

I have Gambas 3.8.4 installed on 3 laptops, in each case running Mint 17.3 
Mate. While each is a different hardware spec they are similar. Two have SSDs 
and one a spinning HD.

My problem is that on 2 machines Gambas starts up in a few seconds. On the 3rd 
it takes more than  a minute. Once it is running it works well - it's purely 
the startup which is very slow. All other applications installed on this 
machine (SSD) seem to start normally.

I have reinstalled Gambas but it makes no difference. Does Gambas perform any 
disk or file checks during startup which might explain this odd behaviour?

Thanks

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


[Gambas-user] ImageView Content Scaling

2016-07-06 Thread Nigel Verity
Hi

I need to display images on a form with some descriptive text.

The form contains an imageview control sized at 400 x 300 px. The images it 
will display will be sized at 1600 x 1200, which is 4x the size of the 
imageview.

I am loading the image using the following code:

===

Dim myImg as Image

myImg = image.load("/path/to/image.jpg")
imageView1.image = myImg

===

This displays the image full size within the control, with horizontal and 
vertical scroll bars.

I would like to display the full image within the imageview control without any 
need to scroll e.g at 0.25 original size.

Using imageView1.Zoomfit() reduces the image to a very small thumbnail - too 
small for my requirements.

Is there any way to scale the image to a user-defined scale factor?

Thanks

Nige  
--
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Seeking a bit of advice here (Correction)

2016-05-16 Thread Nigel Verity
Apologies. I stated earlier that I am using Mint on my RPi. I meant, of course, 
Ubuntu MATE. Like many people I tend to naturally associate the MATE desktop 
with Linux Mint.

However, Ubuntu MATE is another excellent option for driving your 32 bit 
servers. You would still need to install openSSH server and might similarly 
choose to upgrade Gambas from the default version 3.5.4. The default version of 
Postgresql is 9.4.

Nige

From: nigelver...@hotmail.com
To: gambas-user@lists.sourceforge.net
Subject: Re: [Gambas-user] Seeking a bit of advice here.
Date: Mon, 16 May 2016 08:37:07 +0100




Hi

Linux Mint 17.3 would satisfy all your requirements. I run a number of small 
servers, including an RPi, on Mint and they are simply trouble-free.

I am not aware of any plans to end 32-bit support. The current version of 
Postgres is 9.3.12.

You would need to install openssh-server (client comes as part of the build), 
and you would probably want to upgrade the version of Gambas from a PPA, as the 
standard is currently 3.1.1. I use 3.8.1 and there are no problems at all.

There is a choice of desktops - Cinnamon, MATE, KDE, Xfce. If you are running 
your devices as servers you could configure them to boot to command line, so 
the "weight" of the desktop is not really an issue. Just go for whichever you 
prefer and fire it up only when you need it.

I would estimate that after the basic installation, all your configuration, 
installation and upgrade tasks could be achieved in about 10-15 minutes per 
device. 

Nige

  
--
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Seeking a bit of advice here.

2016-05-16 Thread Nigel Verity
Hi

Linux Mint 17.3 would satisfy all your requirements. I run a number of small 
servers, including an RPi, on Mint and they are simply trouble-free.

I am not aware of any plans to end 32-bit support. The current version of 
Postgres is 9.3.12.

You would need to install openssh-server (client comes as part of the build), 
and you would probably want to upgrade the version of Gambas from a PPA, as the 
standard is currently 3.1.1. I use 3.8.1 and there are no problems at all.

There is a choice of desktops - Cinnamon, MATE, KDE, Xfce. If you are running 
your devices as servers you could configure them to boot to command line, so 
the "weight" of the desktop is not really an issue. Just go for whichever you 
prefer and fire it up only when you need it.

I would estimate that after the basic installation, all your configuration, 
installation and upgrade tasks could be achieved in about 10-15 minutes per 
device. 

Nige
  
--
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Gambas on Pi3

2016-03-11 Thread Nigel Verity
Hi

I have ordered a Raspberry Pi3. I have installed Gambas on my Pi2 (Ubuntu Mate) 
and it works OK, if a bit slow.

The advice I have read about exploiting the superior performance of the Pi3 is 
that applications should be designed to utilise all 4 processor cores. Is there 
any way to ensure that the Gambas IDE, or an application written in Gambas, 
will utilise all available processors?

Thanks

Nige  
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Form Positioning Problem with 3.8.2

2015-10-08 Thread Nigel Verity
Hi

My installation of 3.8.1, running on Mint 17.2, was upgraded to 3.8.2 yesterday 
via the Launchpad PPA. Since then I have been experiencing problems with form 
placement.
- Where FormA opens FormB using formB.showmodal(), the subordinate form is 
behind the parent.

- FormB is smaller than FormA, and with 3.8.1 was initially centralised above 
FormA i.e

FormB.x = FormA.x + ((FormA.width - FormB.width)/2)
FormB.y = FormA.y + ((FormA.height - FormB.height)/2)

With 3.8.2 the initial position of FormB takes no account of the code in 
form_open() regardless of what values I assign to FormB.x and FormB.y.

I have reverted to 3.8.1 and everything works fine again. Has anybody else 
noticed this strange behaviour?

I am using QT4 controls.

Regards

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


[Gambas-user] Installing 3.8 On Debian

2015-08-03 Thread Nigel Verity
I have discovered a "cheat" method to install Gambas 3.8 on Debian without the 
need for compilation. Specifically I am running LMDE 2 but the principle should 
work on any Debian-based system.

Dependencies: Access to an Ubuntu or Linux Mint computer onto which 3.8 has 
been installed from the Gambas PPA.

Method:

On the source (Ubuntu/Mint) computer and go to /var/cache/apt.

Copy all the Gambas 3.8 installation (.deb) files to an empty folder on the 
target (Debian) computer.

On the target computer open a terminal window and navigate to the folder 
containing the .deb files.

Type "sudo dpkg -i *.deb". This will begin the installation.

Some "missing object" errors will be listed in the terminal window, but let the 
process run to completion.

Open the Synaptic package manager. This will list some broken packages. In my 
case there were 6.

In Synaptic use the "Fix Broken Packages" item on the "Edit" menu. This will 
identify the missing objects which need to be installed. These should be 
libraries.

Click the "Apply" button on the Synaptic toolbar. The missing objects will be 
downloaded and installed.

You can now go ahead and use Gambas 3.8.

Although this is not an officially approved method, Gambas 3.8 appears to run 
faultlessly on LMDE 2. The version available in the default repository is 3.5, 
so it is worth doing to get all the latest improved feature.

Regards

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


[Gambas-user] Clipboard Persistence

2015-07-29 Thread Nigel Verity
Hi

If often need to copy text from a form in a Gambas application and paste it 
into a non-Gambas application - typically LibreOffice Writer.

While the Gambas app remains open there is no problem. However, once I close 
the Gambas app the "Paste" option on the main or context menu of the target is 
greyed out. This indicates that the clipboard is empty.

This is not specific to LibreOffice. It is the same with any target application.

Is there any way I can ensure that text remains in the clipboard after the 
Gambas application has been closed?

Thanks

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


[Gambas-user] Buffer Monitoring

2015-04-29 Thread Nigel Verity
Hi

I'm planning to write an application in Gambas to support a study of the 
efficiency of various user interface designs. To do that I will need to monitor 
mouse clicks in conjunction with the mouse position, and keyboard inputs. This 
is, of course, simple within a Gambas application but what about when another 
application has focus?

Is there any way to have a Gambas application running minimised but monitoring 
the keyboard buffer and mouse events regardless of which application has focus?

Thanks

Nige


  
--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Interaction With Command Shell

2015-03-16 Thread Nigel Verity


> Date: Mon, 16 Mar 2015 16:57:05 +0100
> From: Beno?t Minisini 
> Subject: Re: [Gambas-user] Interaction With Command Shell
> To: mailing list for gambas users 
> Message-ID: <5506fd51.80...@users.sourceforge.net>
> Content-Type: text/plain; charset=windows-1252; format=flowed
> 
> Le 16/03/2015 16:31, Tobias Boege a ?crit :
> > On Mon, 16 Mar 2015, Nigel Verity wrote:
> >> Hi
> >>
> >> I would welcome some advice about interacting with the Linux command shell 
> >> from within a Gambas application.
> >>
> >> The requirement is to create a connection with a remote server using 
> >> SSHFS. The general syntax for this command is:
> >>
> >> sshfs username@remote-server:/foldername /local-mount-folder
> >>
> >> There is no option in the SSHFS command to include the user's password on 
> >> the remote server. When running from a command prompt, once the sshfs 
> >> command is accepted you are then prompted to enter the password.
> >>
> >> Is there any way, after executing the SSHFS command (using SHELL, 
> >> presumably) to monitor for the password prompt and then send the password 
> >> to the command shell?
> >>
> >> My aim is to create a dialog in which the user provides the server name, 
> >> username and password and have Gambas do the rest to create the SSHFS 
> >> connection.
> >>
> >
> > I have once tried that, specifically with sshfs, too, and failed miserably.
> > Your zeroth approximation should be to factor out Gambas and write a shell
> > script which can pass the password to sshfs. If you've got that, you almost
> > have the solution in Gambas.
> >
> > There is a program "expect" which was designed for specifically the purpose
> > of waiting on a program's output for a specific pattern and then sending a
> > given string to its input (i.e. to automate interactive programs). But it
> > seems sshfs is putting extra effort into preventing this automation.
> >
> > I ended up creating a private/public key pair and have the server work with
> > that so that I can login using these keys[0]. Maybe this is an option for
> > you, too?
> >
> > If you can trick sshfs into being automated via expect or some other means,
> > please let me know :-)
> >
> > Regards,
> > Tobi
> >
> > [0] https://help.ubuntu.com/community/SSH/OpenSSH/Keys
> >
> 
> I'm automating scp and ssh daily with Gambas, by detecting when the 
> password prompt appears (and the ssh key confirmation question too).
> 
> It cannot be 100% reliable, because any other program can print 
> "password:" on its standard output, and apparently there is no way to 
> know that a program is waiting for input.
> 
> But in practise it works.
> 
> If there is no clean way to do that, maybe I should make a component 
> with that, even it's some quick & dirty hack?
> 
> -- 
> Beno?t Minisini

Hi Benoit

I suspect there could be good security reasons why the author(s) of SSHFS keep 
the password entry separate from the main command string. However, this type of 
issue cannot be unique to SSHFS, so a Gambas component which can simulate the 
user interacting with a terminal could have a lot of uses. Handling unexpected 
error messages, which might appear in a terminal window when you are expecting 
a prompt of some kind, could make it complicated, though.

Nige
  
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Interaction With Command Shell

2015-03-16 Thread Nigel Verity
Hi

I would welcome some advice about interacting with the Linux command shell from 
within a Gambas application.

The requirement is to create a connection with a remote server using SSHFS. The 
general syntax for this command is:

sshfs username@remote-server:/foldername /local-mount-folder

There is no option in the SSHFS command to include the user's password on the 
remote server. When running from a command prompt, once the sshfs command is 
accepted you are then prompted to enter the password.

Is there any way, after executing the SSHFS command (using SHELL, presumably) 
to monitor for the password prompt and then send the password to the command 
shell?

My aim is to create a dialog in which the user provides the server name, 
username and password and have Gambas do the rest to create the SSHFS 
connection.

Thanks

Nige  
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] JSON Parsing

2015-01-16 Thread Nigel Verity
Hi

I would be interested to know whether any Gambas users have already created a 
parser for JSON format data, and would be willing to share the relevant code.

I foresee a need to import data from JSON files over the coming months. It 
would save some time if I could avoid having to "reinvent the wheel".

Regards

Nige
  
--
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Best Programming Practice

2014-05-12 Thread Nigel Verity
I think that the issue of best programming practice and how many forms are used 
to accomplish a task are two separate issues.

Sharing common code between forms, rather than having multiple instances of 
procedures and functions, is always good practice as it makes maintenance and 
fault-finding much simpler.

How you divide a task across forms depends largely upon the workflow. However, 
there are some factors which really just boil down to the preferences of the 
users. Some people like to select records for maintenance from within the 
maintenance form itself, while others prefer to select data from a separate 
popup. You may not be able to please everybody in your UI design decisions, but 
you should seek to satisfy the majority of users.

The tab order of fields can be important. For example highly repetitive tasks, 
such as entering client information, will often be performed without the 
experienced user actually looking at the screen; just using the tab key to move 
between fields. If the tab order doesn't follow the way users naturally work 
this can only lead to problems, even if their preferred order may seem 
illogical to you as the developer.

In my experience, if your application is only going to have a very small number 
of users then you can probably educate them to accept a user interface (both 
the layout and the way you decompose the task into forms) which is both logical 
and easy for you to maintain. On the other hand, if you have a large number of 
non-technical users you would be better advised to give them what they say they 
want, within the constraints of the application's functional requirements, and 
just make sure that you apply best coding practice and any other approaches to 
development which make the maintenance as easy as possible.

If you decompose a task into multiple forms consider very carefully the use of 
the form's "modal" property. If formA spawns formB non-modally, and there are 
dependencies between them in both directions, the coding required to keep both 
in sync can become very complex. However, if formB is modal then you only have 
to refresh the data on formA when you save and/or close formB. It makes life 
somewhat simpler.

One more thing..

Document the application well, making sure that you highlight the reasons 
behind any process flow or task decomposition which you would have implemented 
differently given a completely free choice. Otherwise, subsequent developers 
may just assume that you are not a very good programmer and implement 
"improvements" which only serve to upset the the users.

Nige  

 
  
--
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] DataControl Validation

2014-04-01 Thread Nigel Verity
Hi

I have posted a couple of questions recently on using the data-bound controls. 
My long-term aim is to design some template applications, combining Gambas3 
with Sqlite, to fill the role of MS Access on Linux for creating "quick and 
simple" databases. LibreOffice Base is such a poor tool for developing database 
applications, I am convinced that Gambas provides a much more effective 
platform.

The .validate() procedure on the datacontrol enables values to be tested and 
modified before saving. If the validation rules require that the record save be 
abandoned, this is achieved very simply using the STOP EVENT statement. 
However, this causes the display of a message box showing "Invalid value". Is 
it possible to suppress this message box or to modify its text?

I am using 3.1.1 on Debian.

Thanks

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


Re: [Gambas-user] Gambas Datasource Control

2014-03-30 Thread Nigel Verity
Hi Benoit

I have tested the .validate() event of the datacontrol. It meets my requirement 
to test and modify the data entered in the control but is there any way to 
abandon the save entirely if certain criteria are not met?

Thanks

Nige




Date: Fri, 28 Mar 2014 16:41:07 +0100
From: Beno?t Minisini 
Subject: Re: [Gambas-user] Gambas Datasource Control
To: mailing list for gambas users 
Message-ID: <53359813.60...@users.sourceforge.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
Le 28/03/2014 14:55, Nigel Verity a ?crit :
> Hi
>
> I have used Gambas very successfully in conjunction with a Sqlite
> database, but I have written my own procedures to exchange data
> between the  controls and the database. This provides great
> flexibility but does require quite a lot of code.
>
> I am now experimenting with the use of the data-bound controls. I
> need to perform some validation before a record is saved, and require
> the option to abort the save entirely. The documentation describes a
> "BeforeSave" event for the datasource control which is just what I
> need. However, I can find no way of trapping this event as the IDE
> does not appear to provide the option of generating the event
> handler. I have tried inserting the appropriate code manually but it
> has no effect.
>
> Grateful for any advice.
>
> Thanks
>
> Nige
 
At the moment the BeforeSave() event handler cannot stop the save 
process. I can add that in the next version (i.e. if you call STOP EVENT 
during BeforeSave(), no save is performed) but not for the current version.
 
What sort of validation do you need? Maybe there is a workaround: for 
example, the DataControl has a "Validate" event that allows to 
individually validate the data entered by the user.
 
-- 
Beno?t Minisini

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


[Gambas-user] Gambas Datasource Control

2014-03-28 Thread Nigel Verity
Hi

I have used Gambas very successfully in conjunction with a Sqlite database, but 
I have written my own procedures to exchange data between the  controls and the 
database. This provides great flexibility but does require quite a lot of code.

I am now experimenting with the use of the data-bound controls. I need to 
perform some validation before a record is saved, and require the option to 
abort the save entirely. The documentation describes a "BeforeSave" event for 
the datasource control which is just what I need. However, I can find no way of 
trapping this event as the IDE does not appear to provide the option of 
generating the event handler. I have tried inserting the appropriate code 
manually but it has no effect.

Grateful for any advice.

Thanks

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


[Gambas-user] SMTP Component

2014-02-26 Thread Nigel Verity
Hi

I am planning to use the SMTP component in a new Gambas project. I am happy 
with the basic functionality but the documentation states that if the "Host" 
property is left blank the messages are sent to "localhost" instead of a 
designated SMTP server.

Does anybody know where on my local machine those messages will be saved? Is 
the localhost option just intended to be used for testing, or does it act as an 
"outbox" meaning the messages can be subsequently forwarded to an SMTP server?

Thanks

Nige  
--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Work with Open Office from Gambas

2014-02-25 Thread Nigel Verity
Hi Alexey

It depends what you want to do.

You can open the OpenOffice/LibreOffice GUI using the Shell command with the 
appropriate parameter for the module you wish to use e.g:

libreoffice4.1 --writer

You can also call some OO/LO functions using the Shell command, which do not 
open the OO/LO user interface. For example you can convert document formats. 
The OO/LO documentation will explain the options and the syntax - use Google to 
find.

You can create template documents using OO/LO. If you save them in .fodt format 
(a derivative of XML) your Gambas program can scan the template for identifiers 
of your choice and then make substitutions. The result is a very 
professional-looking document, generated dynamically by Gambas.

Hope this is helpful.

Nige


  
--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] TextArea Control - Tab Key

2014-02-11 Thread Nigel Verity



Hi

I have some text area controls which I would like to behave like text boxes, 
i.e hitting the tab key moves the cursor to the next control.

I can write some long-hand code to monitor for chr(9) on the "keypress" event, 
but is there a tidier way of  achieving this - an obscure property perhaps?

Thanks

Nige
  
--
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] TabStrip Control

2013-12-14 Thread Nigel Verity
Hi

I've just started using the TabStrip control in a project for the first time. I 
can't find a method for making a particular tab current. Any ideas, please?

Thanks

Nige  
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Compiling A Gambas Project

2013-12-01 Thread Nigel Verity



Hi Tobi

Perhaps if I describe a scenario I encountered yesterday you can advise on 
whether the behaviour should be expected or whether there is actually a bug.

I always structure my projects using the default approach so that each form has 
its associated .class file in which the form-specific code resides. However, 
user-defined functions which may be used on multiple forms I place in a .module 
file, usually called mdlShared.

My problem yesterday involved calls to mdlShared.setFontAttributes(). After a 
bit of redesigning I replaced this function with mdlShared.setFont(). 
Unfortunately I forgot to remove several calls to .setFontAttributes() even 
though I had removed the function itself. These calls were not detected by 
"Compile All" but resulted in runtime errors.

Regards

Nige
  
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Compiling a Gambas Project

2013-12-01 Thread Nigel Verity
Hi

When I perform a "Compile" or "Compile All" operation from the Gambas menu any 
language syntax errors seem to be identified correctly. The same applies to 
declaration errors. However, I have noticed that calls to non-existant 
functions (as a result of spelling errors) are often not flagged. As a result 
the code passes the compilation checks and I can create an executable. The 
coding problems do, however, result in runtime errors.

Is there a setting to ensure that compilation identifies ALL problems, or is it 
just a shortcoming with the compile process?

Regards

Nige  
--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] A little article on Gambas on Phoronix (ISS Boss)

2013-11-27 Thread Nigel Verity



Dear All

It's been interesting to read about perceptions that BASIC is a "toy" 
programming language, not to be used for serious projects. I have to reject 
this notion. There are some very low level system programming tasks for which 
BASIC may not be the best choice but, in principle, like any other programming 
language, BASIC is as good as the programmer using it.

I started my programming in the 1980s using FORTRAN 77. I wrote some dreadful 
"spaghetti" code in those days but, as my experience grew, so did the structure 
and quality of my programs. After a brief period using CORAL 66 I moved onto 
using COBOL. If ever there were a language which looks like a "toy" then it is 
COBOL, using words instead of operator symbols e.g "ADD X TO Y GIVING Z" 
instead of x + y = z. Deeper reflection shows that this makes the language far 
more self-documenting than any other. I don't know about now, but for a long 
time most of the world's banking system was built using COBOL so it must have 
had something going for it.

Since those days I've used C, C++, Pascal and flavours of BASIC, such as VB and 
Gambas. In all of those languages it's possible, in fact easy, to write clear, 
well-structured, easily-maintainable code. It's a failure of the programmer 
when the logic of a program jumps about all over the place; not a weakness in 
the programming language. Even C supports "goto" commands and labels.

One thing I have observed over the years is that a lot of programmers like to 
create the impression to non-developers that coding is intrinsically difficult. 
The syntax of C and C++ in particular helps to perpetuate this myth. Even 
fairly experienced developers can be a little awe-struck by uncommented code 
which embeds several levels of nested functions in a single line. It would 
probably be quite comprehensible if divided over multiple lines with consistent 
indentation and a few comments.

I think that the simpler the code is to write and understand, the better the 
overall quality is likely to be. The BASIC syntax has many advantages in this 
respect, especially for anybody with a knowledge of English.

It is noteworthy that Gambas and VB have been dismissed as if they are not 
"proper" development tools. Surely their efficiency for developing applications 
sets them apart from every other tool. Using either Gambas or VB, it would take 
less than 60 seconds for anybody with a little experience to start a new 
project and create a form containing a button which, when clicked, displays a 
message. I would challenge anybody to do that using any other tools or 
programming languages.

When all programs ran in text mode, managing the user interface constituted a 
far smaller proportion of the code. When Windows and the Mac introduced the GUI 
to everyday applications that all changed and managing the user interface 
became by far the largest part of most programs. Tools which simplified that 
aspect of application development were desperately needed and VB satisfied that 
requirement, taking the market by storm. As time has gone by I have detected a 
growing opinion amongst developers that tools such as VB make programming too 
easy, and there been a trend back towards complexity. I accept that changing 
fashions in user interface design can require greater control of what appears 
on the screen, such as rounded corners, circular windows and so on. That's fair 
enough, but there is no reason why those additional functions can't be 
delivered by building on the relative simplicity of user-friendly tools and 
easy-to-understand code syntax.

Maybe some programmers see simple development tools as a threat. They are not. 
A chisel is a simple tool to use but you need a skilled craftsman to get the 
best out of it. In much the same way there will always be a need for skilled 
programmers to develop applications of any real importance. 

I have experimented with Lazarus. This is another excellent development tool 
which has the advantage over Gambas of generating native executables and 
working cross-platform. Lazarus has a good form builder but it is hampered by 
being based on Pascal and exposing far more of its underlying complexity to the 
programmer. This provides greater scope for structural and coding errors and 
makes for more difficult debugging.

I still have a need to develop database applications on Windows from time to 
time. I use Access/VBA as my tool of choice, but I have noted how Microsoft has 
made the user interface more complex in recent versions, for no real functional 
gain. I suspect this is a move to make it look like a more serious tool. When I 
get back to developing on Linux using Gambas it is like a load being lifted 
from my shoulders.

Gambas is a tool which every serious developer should examine closely. Its 
biggest challenge is the mistaken notion which equates professionalism and 
functionality with complexity.

Nige 


  
-

[Gambas-user] ColumnView Sorting

2013-11-15 Thread Nigel Verity
Hi

I am using a ColumnView control with 5 columns. Each column contains text 
(single-word strings)

The control has a ".Sorted" property. I assume that this sorts the control 
according to the contents of the left-most column.

Is there a way to sort the control by the contents of, say, Column 3 in the 
program code?

Thanks

Nige  
--
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Future Of Gambas (Re: Baze Project)

2013-11-04 Thread Nigel Verity






Hi Markus et al

One of the big attractions of MS Access is that all the data, forms and queries 
can be delivered to the user in a single file. This is very attractive when it 
comes to distributing standalone databases to be run on the desktop. 
LibreOffice Base, at its simplest level, seeks to do the same thing, but it is 
seriously hampered by having such a rudimentary form designer, and its 
implemention of the Basic programming language is more difficult to use than 
VBA. When you add to that the default HSQL database engine, which is both slow 
and inefficient, you have a tool which I cannot believe is widely used for 
anything other than local "quick and dirty" databases, where performance and 
appearance are of little importance.

Of course, both Access and Base can be used for far more sophisticated 
purposes. Through the use of ODBC Access can connect to a number of different 
types of database and, combined with the use of local tables, can extend the 
core dataset. Again, Base can do much the same, but it remains hampered by 
having such an unsophisticated form designer and the tedious programming 
language.

With Gambas it is not possible to achieve the "single file" approach to 
database application delivery that you can with Access or Base (well, I've not 
found a way), but it is still very simple to deliver a Gambas executable 
(assuming the runtime environment has already been installed on the target) and 
an associated SQLite database in just 2 files. This makes distribution by 
email, subject to size constraints, a practical proposition in way that is not 
possible if the data is hosted in a server-based architecture.

Developing a database front-end in Gambas is more like developing such an 
application in VB than Access, as you still need to create the links between 
the controls on the form and the database which, of course, is done for you 
automatically in Access. For all that, though, it is very easy whether you use 
the Gambas databound controls or prefer to write a few generic read/write 
procedures long-hand.

>From the description of your Baze project in Google Code, rather than 
>duplicating an existing application I believe that you will end up with a high 
>performance tool which achieves the flexibility aspirations of Base combined 
>with the ability to create a sophisticated, professional-looking user 
>interface. By including support for NoSQL you will be ahead of the game.

It's an ambitious goal, but I do think that as long as ease of use and 
implementation are always at the forefront of the design, then it will 
eventually find an enthusiastic user base.

I wish you every success.

Nige

  
--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Gambas Future or what kind of Gambas we want

2013-11-01 Thread Nigel Verity
Hi

I'm sure that we all acknowledge that Gambas plays much the same role on Linux 
that VB plays on Windows. I used to be a VB developer, but I'd far sooner work 
with Gambas any day, even if it could be run on Windows. That said, the fact is 
that VB does exist and, whatever we like to think, it is a good tool with a 
huge and enthusiastic user base. At best, fully migrating Gambas to Windows 
would put it in a similar position to GIMP on Windows. At a functional level 
GIMP stands up well against Photoshop for most users. Despite that people still 
pay good money for Photoshop because it is the "go to" image editor in most 
people's minds. In the same way, no matter how good Gambas is most people 
looking for a RAD tool on Windows would automatically opt for VB.

I have played around with Lazarus, which is a visual development environment 
based on FreePascal and generates native executables. It's harder to use than 
Gambas, but still a lot easier than Visual C++. It already has the advantage 
that there are versions for Linux, Windows and OSX, so you can develop a 
project on one OS and just recompile it to run on the others. On that basis it 
beats every other development tool hands down for portability and should 
dominate the market. For all that, most developers regardless of their OS, have 
probably never heard of it.

To my mind Gambas has been developed to satisfy a requirement on Linux and it 
does that brilliantly well. There's nothing that comes close in terms of 
functionality vs ease-of-use. My view is that just because something CAN be 
done doesn't mean that it MUST be done. The notion that Gambas, or any other 
FLOSS project, must strive for maximum market share is more than a nod towards 
the stance of commercial proprietary software which many of us strive to avoid.

The one thing I would like to see for Gambas is not so much functionality as 
improved awareness of one of its many capabilities. By combining Gambas with 
SQLite you have more or less a complete analog for MS Access. When I first came 
to Linux I struggled to find anything close to an Access equivalent. 
LibreOffice Base is far too complicated and slow. I'm sure there are many Linux 
users who would dearly love to have a powerful desktop database tool but don't 
realise that a solution is so readily available.

Regards

Nige
  
--
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Code Editor - Cursor Tracking Problem

2013-09-25 Thread Nigel Verity
I took the advice of MinnesotaJon and changed the "Hinting" setting. The 
problem was occuring on both my laptops. One was set to "None" and the other to 
"Slight". To maximise the effect of change I set both to "Full" and, in each 
case, the tracking problem has been resolved.

Thanks

Nige

  
--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Code Editor - Cursor Tracking Problem

2013-09-24 Thread Nigel Verity
Hi

I run Linux Mint Debian Edition. The latest version of Gambas3 in the 
Debian/Mint repository is 3.1.1.

This version has an acknowledged bug whereby the cursor does not track 
correctly in the code editor. The more left/right/backspace keystrokes you use, 
the further out of step the cursor gets.

As a temporary solution to this I have been loading all my project's .class and 
.module files into the Geany editor, making my code changes then reloading them 
into Gambas. While this means I can continue to use Gambas it is very tedious, 
and I lose the special functionality which the built-in code editor provides.

In seeking a better solution, my questions are:

Is there a later Gambas binary which will run on Debian (LMDE)?

Does the cursor-tracking problem occur with all fonts, or is there a font I can 
use with which the problem does not occur?

Is there any way of linking an external editor, such as Geany, to Gambas so 
that I don't have to reload the project after every code change?

Thanks

Nige
  
--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user