Subject Re: Form with Seeker - More Information
From Mervyn Bick <invalid@invalid.invalid>
Date Fri, 20 Mar 2015 10:54:55 +0200
Newsgroups dbase.getting-started

On Fri, 20 Mar 2015 02:25:56 +0200, Wayne Graham <equiline2@gmail.com>
wrote:

> Sorry I havnt kept this updated my sons took me to the Melbourne F1  
> Grand prix over last
> weekend and I only got back to this mid week.  BTW was a great weekend.

Watching it on the box doesn't come close to actually being there so I'm
green with envy.  I watched a bit on TV (a delayed broadcast) but the
satellite decoder that feeds the communal aerial in the complex I live in
is set to an "alternate" voice channel.  For local events this means we
hear the Afrikaans commentary but for the F1 GP this was in Spanish.  As
my Spanish doesn't extend to much more than "Buen día" and "Dos cervezas
por favor" it wasn't much help in following the race. (As with my German
which also doesn't stretch much further, they laugh at the accent but at
least they bring the beer. :-) )

> I do have a couple of questions tho.
>
> How do I display the contents of a variable on the screen?  I used to  
> use the old "Get" and "Say" a lot but they dont exist any more.  I need  
> to advise the user by maybe a msgbox  or on screen text that "This data  
> relates to <myvariable>" or similar but cant find an answer.

I find message boxes intrusive and I rarely use them.  If you do need to
forcibly grab the user's attention then

        msgbox("The value in mVar is "+mVar,"Atention!").

Processing stops until the message box is closed.

You can add various pushbuttons and icons to the message box.  See the
help file for details.  You can test for the user's response and alter the
flow of the program if needed.

A better option, in my opinion, is to use a textlabel or a text object on
the form.  (Text objects have more formatting options, such as variable
height and word wrap, but use more resources although this shouldn't be a
problem on a modern computer.)  Make sure the textlabel or text object is
wide enough to hold the biggest expected value.

         form.textlabel1.text = "The value in mVar is "+mVar

If the value in mVar is numeric dBASE will automatically convert it to
characters so as to be able to concatenate it to the narrative.

If you want to change the colour of the text to indicate negative values
simply add a couple of lines of code before assigning the string to the
textlabel object.


         if mVar >= 0
            form.textlabel1.colorNormal = "BtnText/BtnFace"
         else
            form.textlabel1.colorNormal = "red/BtnFace"
         endif
         form.textlabel1.text = "The value in mVar is "+mVar


> The Dbase language book indicates that a list of forms can be included  
> using "Close Forms (<mylist>).  I cant get that one to work either.  Any  
> ideas?  That would probably be useful.

I've never once in 30 years needed to use this command.  I find Close
Forms closes all forms but I couldn't work out how to feed it a list.
Perhaps a bug that has been lurking for 30 years. :-)  If it can be done
I've no doubt that someone will post the proper syntax.

> BTW the original code to build 1,000,000 record datasets took around 23  
> hours to run in DBase3+.  After the first rewrite into Dbase Classic it  
> came down to around 8 hours to build the datasets and became usable.
>
> I now have it down to around 1 hour in DBase8+.  The code is mainly  
> read/writes building multiple new datasets and is done on an SSD which  
> also cuts time significantly.

One of dBASE's better kept secrets is that, in addition to the normal
dBASE commands, it also has localSql (a subset of standard SQL) commands
available.   These weren't available in 1989 but using them now could
significantly speed up extracting subsets of data.  In fact, with
1,000,000 records you should consider moving the data to a "proper" SQL
DBM such as Firebird.  This is not something to be taken lightly though as
using a SQL server needs a different approach to managing data compared to
.dbf files.  The advantages of moving could, however, be significant in
the long run.

There are many SQL experts who offer help in these newsgroups so if you
give us some idea of what is in the main database and what subsets you
need to extract you may get suggestions on improving the speed of your
program.


Mervyn.

---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com