Home > Archive > dBASE Questions and Answers > July 2005 > command line syntax in dBase plus 2.5









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author command line syntax in dBase plus 2.5
per horstedt

2005-06-08, 3:23 am

Hi all,
when testing Dbase plus 2.5 I faced a problem with "command line syntax".
I'm using dBaseWin 5.0 and always work in the command window.
When using report forms, I can filter a database by for example use a command like
report formXXX for fieldX > 500 .and. fieldX < 550
and this will sort out everything between 500 and 550.
When I try
do reportXXX.rep for fieldX > 500 and fieldX < 550
I get an error message saying
Error: Unallowed phrase/keyword in command: for fieldX > 500 and fieldX < 550
What is the correct syntax? Where can I find a list of accepted commands?

Cheers,
Per
rb

2005-06-08, 11:23 am

HI,

The "do report" actually creates a report object, for lack of a simpler
explanation. You have to either write a function that can pass parameters to
change properties of the report or change the properties youreself. In
actual fact you would be changing properties of a rowset contained in the
report. There are so many ways to achieve this, depending on how youre
report is structure, whether ur using DMD's etc. Basically you would neet to
get to the rowset in question.
Also you could use the filter property, or the cangetrow method, or the
setrange method if you have an index deined.

So if you have a report with a single table/qyery on the report, using a
filter property

set proc to myreport.rep addi
orep = new myreportreport()
orep.myqyery.rowset.filter = "fieldx>500 and fieldx<550"
orep.render()

now you could put that into a function and call the function with parameters
The probem being that you would eed to know the query object. This can be
overcome, but for now we concentrate on the simple stuff

function printreport( filtercondition)
fc = filtercondition
if pcount<=0 or fc= " "
fc= null
endif
orep = new myreportreport()
orep.myqyery.rowset.filter = fc
orep.render()
return

You could expand on this by building in code to choose reports and filter on
differnt table/queries, using indexes and setrange etc. But you get the idea
Now call the function
printreport("fieldx>500 and fieldx<550")

OR
you could put code at the top/header of the report file so that you could
pass it parameters like this. In otherwords you could adapt the above
function put it at the top of the report and thenm call the report wit a do
myrepot.rep with "fieldx>500 and fieldx<550"
eg below

param fc
if pcount<=0 or fc= " "
fc= null
endif
local r
r = new SIPPAYHISTREPORT()
r.myqyery.rowset.filter = fc
r.render()
return

** END HEADER -- do not remove this line
//
// Generated on 27-07-2004
//
local r
r = new SIPPAYHISTREPORT()
r.render()

class SIPPAYHISTREPORT of REPORT
.......
......
endclass

Hope I havent confused you too much

Robert



"per horstedt" <per.horstedt@medbio.umu.se> wrote in message
news:eoKBS0$aFHA.444@news-server...
> Hi all,
> when testing Dbase plus 2.5 I faced a problem with "command line syntax".
> I'm using dBaseWin 5.0 and always work in the command window.
> When using report forms, I can filter a database by for example use a

command like
> report formXXX for fieldX > 500 .and. fieldX < 550
> and this will sort out everything between 500 and 550.
> When I try
> do reportXXX.rep for fieldX > 500 and fieldX < 550
> I get an error message saying
> Error: Unallowed phrase/keyword in command: for fieldX > 500 and fieldX <

550
> What is the correct syntax? Where can I find a list of accepted commands?
>
> Cheers,
> Per



Per Horstedt

2005-07-04, 3:23 am

Hi Robert,
thanxs for your answer to my question dealing with command syntax in Dbase Plus 2.5, sorry for not getting back to you earlier.


As I stated in my question, I'm a long term user of older Dbase-software. I'm also an old "DOS-man" and I always work from the command prompt in my DbaseWIN ver 5. The reason for this is that I started with Dbase I without any Windows-environment at all a
nd worked my way up via Dbase II, Dbase III and Dbase IV. So the easiest way has been to keep on using my commands when working with the databases, all of them have been the same with the same syntax.
Recently I've had some glitches with my Dbase, so I tried the PLUS 2.5, but found out that the command language is completely different.
What I'm use to is for example working with database DATABASE, and I'd like to filter out all posts with a date between June 1 and June 15 year 2005, and make a printout with my report REPORT, and all I have to do is type after opening the specified datab
ase DATABASE:

report form REPORT for date> 05-07-00 .and. date < 05-07-15 to print

where the command "report form" starts the report form named REPORT,
"for date> 05-07-00 .and. date<05-07-15" makes the filtering of all posts in the database,
and the "to print" directs the output to the printer

and this will filter out all posts with date from 2005-07-01 to 2005-07-15 and make a print according to my premade report form.
I know that the printout in PLUS 2.5 works as any other Windows-based software, so that part is solved, but how do I translate my old typed command line into PLUS 2.5 language. What I need is a fast way to type my commands and have them done. I've tried t
he "Windows way" of doing it, but it takes so much more time and I still can't make all my normal procedures while working with DbaseWIN possible in the new software.
Is there somewhere a list of usable commands? I printed the User's Guide for Dbase Plus 2.01, but can't find what I'm looking for.

So I'd really appreciate any constructive comment to my question.

Cheers,

Per Horstedt
Ronnie MacGregor

2005-07-04, 3:23 am

In article <TeHAH1GgFHA.1528@news-server>, per.horstedt@medbio.umu.se
says...

Hi Per

> report form REPORT for date> 05-07-00 .and. date < 05-07-15 to print


Reporting is probably one ofthe most difficult things for someone coming
fron the DOS versions. A quick way to generate dBASE Plus report code
for columner reports is to use QR3 :

http://www.dbasedeveloper.co.uk/QR3/QR3.htm

If you want you can use the report engine directly from code, and have a
small form in which you choose your date range. To see this, look at :

TestQR3Direct.wfm - the "Restricted UI" sample

Look at the code in that form which drives the QR3 report engine to see
how it is done.

=============

Another method is to run a report, passing an associative array of
parameters to it, and using those parameters in an over-ridden render
method. Track down Ken Mayer's Reports How document, probably in the
knowledgebase, if you want to see how this is done.

=============

Hope this helps.

--
Ronnie MacGregor
Scotland
Marilyn Price

2005-07-04, 7:23 am

In article <TeHAH1GgFHA.1528@news-server>, per.horstedt@medbio.umu.se
says...
>
> report form REPORT for date> 05-07-00 .and. date < 05-07-15 to print
>
> where the command "report form" starts the report form named REPORT,
> "for date> 05-07-00 .and. date<05-07-15" makes the filtering of
> all posts in the database,
> and the "to print" directs the output to the printer
>
> and this will filter out all posts with date from 2005-07-01
> to 2005-07-15 and make a print according to my premade report form.


The filter part will still work, but the report form.. to print doesn't.
As Ronnie has stated, if you want a report, you'll have to use one of
the report writers, either his QR3 or the one supplied with dBase or one
of the after market ones that work with dBase tables, like Crystal
Reports, R&R, and others.

In each of these examples, you'll find that they will want to filter
using SQL syntax, not the more familiar dBase syntax. Holler here if
you need pointers on any of that.

Other than reports, most of the commands you're used to using at the
command prompt will still work. Browse, List, Display, for three
examples.

--
Marilyn Price
M. P. Data
Ken Mayer [dBVIPS]

2005-07-04, 1:23 pm

Per Horstedt wrote:
> Hi Robert,
> thanxs for your answer to my question dealing with command syntax in Dbase Plus 2.5, sorry for not getting back to you earlier.
>
>
> As I stated in my question, I'm a long term user of older Dbase-software. I'm also an old "DOS-man" and I always work from the command prompt in my DbaseWIN ver 5. The reason for this is that I started with Dbase I without any Windows-environment at all

and worked my way up via Dbase II, Dbase III and Dbase IV. So the easiest way has been to keep on using my commands when working with the databases, all of them have been the same with the same syntax.
> Recently I've had some glitches with my Dbase, so I tried the PLUS 2.5, but found out that the command language is completely different.
> What I'm use to is for example working with database DATABASE, and I'd like to filter out all posts with a date between June 1 and June 15 year 2005, and make a printout with my report REPORT, and all I have to do is type after opening the specified dat

abase DATABASE:
>
> report form REPORT for date> 05-07-00 .and. date < 05-07-15 to print
>
> where the command "report form" starts the report form named REPORT,
> "for date> 05-07-00 .and. date<05-07-15" makes the filtering of all posts in the database,
> and the "to print" directs the output to the printer
>
> and this will filter out all posts with date from 2005-07-01 to 2005-07-15 and make a print according to my premade report form.
> I know that the printout in PLUS 2.5 works as any other Windows-based software, so that part is solved, but how do I translate my old typed command line into PLUS 2.5 language. What I need is a fast way to type my commands and have them done. I've tried

the "Windows way" of doing it, but it takes so much more time and I still can't make all my normal procedures while working with DbaseWIN possible in the new software.
> Is there somewhere a list of usable commands? I printed the User's Guide for Dbase Plus 2.01, but can't find what I'm looking for.
>
> So I'd really appreciate any constructive comment to my question.


In addition to other comments, you can do a lot with the built-in report
engine in dBASE, but you have to have some patience. There are two
articles in the Knowledgebase on working with the report designer/engine
in dBASE Plus, and a couple of chapters of my soon to be published book
on dBASE ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Gerald Lightsey

2005-07-05, 8:24 pm

On Mon, 04 Jul 2005 03:52:08 -0400, in the dbase.how-to group, Per
Horstedt said...
> I know that the printout in PLUS 2.5 works as any other
> Windows-based software, so that part is solved, but how do I
> translate my old typed command line into PLUS 2.5 language.


As Ronnie, Marilyn and Ken have pointed out, similar to your previous
DOS experience, the problem is getting a 32 bit dBASE report created not
a problem of getting it to print.

If you are willing to take the small amount of time required to set up a
datamodule for the report in dQUERY, the Automatic report it will create
will often go a long ways toward laying out a basic report that you can
then customize. I personally would not want to embark upon report
development from scratch without giving this approach a shot.

Gerald
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com