PDA

View Full Version : Batch sort



Terry
17-Feb-2005, 12:08 AM
Hi all,
Is there a way to batch sort a data file? I have done it using DF31C when
its installed beside VDF but without it can we sort the files in VDF9.1 ??
Any help and examples would be greatly appreciate.

Regards
Terry

Ben Weijers
17-Feb-2005, 04:34 AM
You can use the sort command.

Regards,

Ben Weijers
Data Access Worldwide

Terry
17-Feb-2005, 05:09 AM
Thanks Ben. I wasn't aware of it. Will it work from a batch file out of VDF
like the df31c dfsort command did or does it have to run from within?

Regards
Terry

"Ben Weijers" <ben.weijers@dataaccess.nl> wrote in message
news:%23wVbVPNFFHA.4924@dacmail.dataaccess.com...
> You can use the sort command.
>
> Regards,
>
> Ben Weijers
> Data Access Worldwide
>
>

Terry
17-Feb-2005, 06:05 AM
I have been studying the sort command and its not making any sense yet. I
simply want to sort all indexs in a data file called "daily" which is the
first file in the filelist.

Can someone please give me some simple examples. I am used to the df31c
stuff

dfsort 1
dfsort 2
dfsort 3
etc
Regards
Terry



"Terry" <terryf@mrmechanic.com.au> wrote in message
news:v5xz9iNFFHA.1952@dacmail.dataaccess.com...
> Thanks Ben. I wasn't aware of it. Will it work from a batch file out of
> VDF like the df31c dfsort command did or does it have to run from within?
>
> Regards
> Terry
>
> "Ben Weijers" <ben.weijers@dataaccess.nl> wrote in message
> news:%23wVbVPNFFHA.4924@dacmail.dataaccess.com...
>> You can use the sort command.
>>
>> Regards,
>>
>> Ben Weijers
>> Data Access Worldwide
>>
>>
>
>

Ben Weijers
17-Feb-2005, 02:55 PM
Terry,

You could do something like:

Procedure SortTable Integer iTable
Open iTable Mode DF_EXCLUSIVE
Sort iTable
Close iTable
End_procedure

Regards,

Ben Weijers
Data Access Worldwide

Terry
17-Feb-2005, 05:16 PM
Hi again Ben,
I'm still having problems here. I tried your code but couldn't get it
working
then went off the help with this code below.
I have inserted this code to run from a click on button like this:
DataBase Table is "Daily" and is the first in the file list.


procedure OnClick
send sortdaily
end_procedure

Procedure sortdaily
handle idaily
Open "daily" as idaily Mode DF Exclusive
sort idaily
close daily
end_procedure

I get a error
File Not Open Tablenumber =1

When it sorts it should show a bar graph with its progress right?
Any help appreciated. I don't do a lot of VDF stuff so please bear with us.
Regards
Terry






"Ben Weijers" <ben.weijers@dataaccess.nl> wrote in message
news:wW8nbqSFFHA.1248@dacmail.dataaccess.com...
> Terry,
>
> You could do something like:
>
> Procedure SortTable Integer iTable
> Open iTable Mode DF_EXCLUSIVE
> Sort iTable
> Close iTable
> End_procedure
>
> Regards,
>
> Ben Weijers
> Data Access Worldwide
>
>

David Martinko
17-Feb-2005, 05:26 PM
If daily is open, then you can't open it again.
Try to close the file first. Then open it exclusive.
Next, you need to check for a finderr.

Procedure sortdaily
handle idaily iRec
Boolean bOpen
// Check if file is already open
Get_Attribute DF_FILE_OPENED of Daily.File_Number to bOpen
If (bOpen) Begin
Move Daily.Recnum to iRec
Close Daily // Close it
End
Open "daily" as idaily Mode DF Exclusive // Open file exclusive
[Found] sort idaily // Sort if opened
close idaily // close exclusive file
If (bOpen) Begin
Open Daily // reopen if was opened before
Move iRec to Daily.Recnum
Find eq Daily.Recnum
End
end_procedure


--
David Martinko
Redeemed Software
248-535-7495
RedeemedSoftware(SHIFT+2)Hotmail(PERIOD)com


"Terry" <terryf@mrmechanic.com.au> wrote in message
news:6fsXA5TFFHA.4864@dacmail.dataaccess.com...
> Hi again Ben,
> I'm still having problems here. I tried your code but couldn't get it
> working
> then went off the help with this code below.
> I have inserted this code to run from a click on button like this:
> DataBase Table is "Daily" and is the first in the file list.
>
>
> procedure OnClick
> send sortdaily
> end_procedure
>
> Procedure sortdaily
> handle idaily
> Open "daily" as idaily Mode DF Exclusive
> sort idaily
> close daily
> end_procedure
>
> I get a error
> File Not Open Tablenumber =1
>
> When it sorts it should show a bar graph with its progress right?
> Any help appreciated. I don't do a lot of VDF stuff so please bear with
> us.
> Regards
> Terry
>
>
>
>
>
>
> "Ben Weijers" <ben.weijers@dataaccess.nl> wrote in message
> news:wW8nbqSFFHA.1248@dacmail.dataaccess.com...
>> Terry,
>>
>> You could do something like:
>>
>> Procedure SortTable Integer iTable
>> Open iTable Mode DF_EXCLUSIVE
>> Sort iTable
>> Close iTable
>> End_procedure
>>
>> Regards,
>>
>> Ben Weijers
>> Data Access Worldwide
>>
>>
>
>

Vincent Oorsprong
18-Feb-2005, 02:27 AM
Terry,

The sort command does not give feedback in a progressbar. It can however
work with a callback function which gets passed the status of the sort
process. You can use this to build your own statusdisplay.

--
Kind Regards,
Vincent Oorsprong
Data Access Europe BV
Lansinkesweg 4
7553 AE Hengelo
The Netherlands
Telephone: +31 (0)74 - 255 56 09
Fax: +31 (0)74 - 250 34 66
http://www.dataaccess.nl

Wal
18-Feb-2005, 08:11 AM
Thanks for that Vincent. Is not a big dramma and not import to me.
I can work around it.
Regards
Terry

"Vincent Oorsprong" <vincent@do.reply.at.newsgroup.nl> wrote in message
news:e12RWtYFFHA.4864@dacmail.dataaccess.com...
> Terry,
>
> The sort command does not give feedback in a progressbar. It can however
> work with a callback function which gets passed the status of the sort
> process. You can use this to build your own statusdisplay.
>
> --
> Kind Regards,
> Vincent Oorsprong
> Data Access Europe BV
> Lansinkesweg 4
> 7553 AE Hengelo
> The Netherlands
> Telephone: +31 (0)74 - 255 56 09
> Fax: +31 (0)74 - 250 34 66
> http://www.dataaccess.nl
>
>
>

Wal
18-Feb-2005, 08:31 AM
David thankyou thankyou!!!! Works like a charm. Sure good seeing how a real
programer does things the proper way compared to my amature ways . I am self
taught at this and only write very basic stuff maybe a few times a year for
my own business use which makes learning very steep.
Things like this code should be in the help files I think. Is ok for
experienced uses to figure out but us beginners struggle without many
examples to learn from.

Thanks very much again David for your help.
Regards
Terry

"David Martinko" <RedeemedSoftware@Hotmail.com> wrote in message
news:ch3Yx%23TFFHA.1912@dacmail.dataaccess.com...
> If daily is open, then you can't open it again.
> Try to close the file first. Then open it exclusive.
> Next, you need to check for a finderr.
>
> Procedure sortdaily
> handle idaily iRec
> Boolean bOpen
> // Check if file is already open
> Get_Attribute DF_FILE_OPENED of Daily.File_Number to bOpen
> If (bOpen) Begin
> Move Daily.Recnum to iRec
> Close Daily // Close it
> End
> Open "daily" as idaily Mode DF Exclusive // Open file exclusive
> [Found] sort idaily // Sort if opened
> close idaily // close exclusive file
> If (bOpen) Begin
> Open Daily // reopen if was opened before
> Move iRec to Daily.Recnum
> Find eq Daily.Recnum
> End
> end_procedure
>
>
> --
> David Martinko
> Redeemed Software
> 248-535-7495
> RedeemedSoftware(SHIFT+2)Hotmail(PERIOD)com
>
>
> "Terry" <terryf@mrmechanic.com.au> wrote in message
> news:6fsXA5TFFHA.4864@dacmail.dataaccess.com...
> > Hi again Ben,
> > I'm still having problems here. I tried your code but couldn't get it
> > working
> > then went off the help with this code below.
> > I have inserted this code to run from a click on button like this:
> > DataBase Table is "Daily" and is the first in the file list.
> >
> >
> > procedure OnClick
> > send sortdaily
> > end_procedure
> >
> > Procedure sortdaily
> > handle idaily
> > Open "daily" as idaily Mode DF Exclusive
> > sort idaily
> > close daily
> > end_procedure
> >
> > I get a error
> > File Not Open Tablenumber =1
> >
> > When it sorts it should show a bar graph with its progress right?
> > Any help appreciated. I don't do a lot of VDF stuff so please bear with
> > us.
> > Regards
> > Terry
> >
> >
> >
> >
> >
> >
> > "Ben Weijers" <ben.weijers@dataaccess.nl> wrote in message
> > news:wW8nbqSFFHA.1248@dacmail.dataaccess.com...
> >> Terry,
> >>
> >> You could do something like:
> >>
> >> Procedure SortTable Integer iTable
> >> Open iTable Mode DF_EXCLUSIVE
> >> Sort iTable
> >> Close iTable
> >> End_procedure
> >>
> >> Regards,
> >>
> >> Ben Weijers
> >> Data Access Worldwide
> >>
> >>
> >
> >
>
>
>

Terry
18-Feb-2005, 08:35 AM
David thankyou thankyou!!!! Works like a charm. Sure good seeing how a real
programer does things the proper way compared to my amature ways . I am self
taught at this and only write very basic stuff maybe a few times a year for
my own business use which makes learning very steep.
Things like this code should be in the help files I think. Is ok for
experienced uses to figure out but us beginners struggle without many
examples to learn from.

Thanks very much again David for your help.
Regards
Terry


"David Martinko" <RedeemedSoftware@Hotmail.com> wrote in message
news:ch3Yx%23TFFHA.1912@dacmail.dataaccess.com...
> If daily is open, then you can't open it again.
> Try to close the file first. Then open it exclusive.
> Next, you need to check for a finderr.
>
> Procedure sortdaily
> handle idaily iRec
> Boolean bOpen
> // Check if file is already open
> Get_Attribute DF_FILE_OPENED of Daily.File_Number to bOpen
> If (bOpen) Begin
> Move Daily.Recnum to iRec
> Close Daily // Close it
> End
> Open "daily" as idaily Mode DF Exclusive // Open file exclusive
> [Found] sort idaily // Sort if opened
> close idaily // close exclusive file
> If (bOpen) Begin
> Open Daily // reopen if was opened before
> Move iRec to Daily.Recnum
> Find eq Daily.Recnum
> End
> end_procedure
>
>
> --
> David Martinko
> Redeemed Software
> 248-535-7495
> RedeemedSoftware(SHIFT+2)Hotmail(PERIOD)com
>
>
> "Terry" <terryf@mrmechanic.com.au> wrote in message
> news:6fsXA5TFFHA.4864@dacmail.dataaccess.com...
> > Hi again Ben,
> > I'm still having problems here. I tried your code but couldn't get it
> > working
> > then went off the help with this code below.
> > I have inserted this code to run from a click on button like this:
> > DataBase Table is "Daily" and is the first in the file list.
> >
> >
> > procedure OnClick
> > send sortdaily
> > end_procedure
> >
> > Procedure sortdaily
> > handle idaily
> > Open "daily" as idaily Mode DF Exclusive
> > sort idaily
> > close daily
> > end_procedure
> >
> > I get a error
> > File Not Open Tablenumber =1
> >
> > When it sorts it should show a bar graph with its progress right?
> > Any help appreciated. I don't do a lot of VDF stuff so please bear with
> > us.
> > Regards
> > Terry
> >
> >
> >
> >
> >
> >
> > "Ben Weijers" <ben.weijers@dataaccess.nl> wrote in message
> > news:wW8nbqSFFHA.1248@dacmail.dataaccess.com...
> >> Terry,
> >>
> >> You could do something like:
> >>
> >> Procedure SortTable Integer iTable
> >> Open iTable Mode DF_EXCLUSIVE
> >> Sort iTable
> >> Close iTable
> >> End_procedure
> >>
> >> Regards,
> >>
> >> Ben Weijers
> >> Data Access Worldwide
> >>
> >>
> >
> >
>
>
>

Terry
18-Feb-2005, 08:37 AM
Thanks Vincent. May look into that later. Am happy its working now which is
the main thing.
Regards
Terry

"Vincent Oorsprong" <vincent@do.reply.at.newsgroup.nl> wrote in message
news:e12RWtYFFHA.4864@dacmail.dataaccess.com...
> Terry,
>
> The sort command does not give feedback in a progressbar. It can however
> work with a callback function which gets passed the status of the sort
> process. You can use this to build your own statusdisplay.
>
> --
> Kind Regards,
> Vincent Oorsprong
> Data Access Europe BV
> Lansinkesweg 4
> 7553 AE Hengelo
> The Netherlands
> Telephone: +31 (0)74 - 255 56 09
> Fax: +31 (0)74 - 250 34 66
> http://www.dataaccess.nl
>
>
>