Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

How many chunks could checkchunk check if checkchunk could check chunks? -- Alan Cox


devel / comp.lang.xharbour / create,save,open excel file sorted on a col#

SubjectAuthor
* create,save,open excel file sorted on a col#timepro timesheet
`* Re: create,save,open excel file sorted on a col#Claudio H
 `* rlock, dbrunlock...timepro timesheet
  `* Re: rlock, dbrunlock...Enrico Maria Giordano
   `* Re: rlock, dbrunlock...dlzc
    `- Re: rlock, dbrunlock...Enrico Maria Giordano

1
create,save,open excel file sorted on a col#

<ed44c1e7-983e-4edd-a7dc-c4f48b25f817n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17170&group=comp.lang.xharbour#17170

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:6214:a43:b0:4c7:6368:d73b with SMTP id ee3-20020a0562140a4300b004c76368d73bmr16812632qvb.22.1670892677294;
Mon, 12 Dec 2022 16:51:17 -0800 (PST)
X-Received: by 2002:a25:7742:0:b0:703:588e:51cf with SMTP id
s63-20020a257742000000b00703588e51cfmr11259921ybc.18.1670892677040; Mon, 12
Dec 2022 16:51:17 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Mon, 12 Dec 2022 16:51:16 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=96.242.45.184; posting-account=jZAeNwoAAABYWjMRM-FfqKkHfC3Iph0l
NNTP-Posting-Host: 96.242.45.184
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ed44c1e7-983e-4edd-a7dc-c4f48b25f817n@googlegroups.com>
Subject: create,save,open excel file sorted on a col#
From: timecosting@gmail.com (timepro timesheet)
Injection-Date: Tue, 13 Dec 2022 00:51:17 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1782
 by: timepro timesheet - Tue, 13 Dec 2022 00:51 UTC

hi:

-what is the code/syntax to create,save,open an excel file 'sorted' on col#12 (cF.Y)-

xtitlecolumns:={{'n#',1},{'cClient',2},{'dInvDate',3},{'nFees-Amt',4}...{'nOPE-Amt',10},{'nTax',11},{'cF.Y',12},...{'nCredit-Note',48}}

oexcel=createobject('excel.application')
oexcel:workbooks:add()
osheet=oexcel:activesheet

sele billfile;set orde to 4
do whil !eof() && .dbf file indexed on 'dInvDate'
....
....
end
*end of writing to excel file

for xx=scol to xcol;osheet:columns(xx):autofit();next
osheet=oexcel:activesheet();osheet:rows(freezerow):select();oexcel:activewindow:freezepanes=.t.
oexcel:activeworkbook:saveas(xlsname)
oexcel:workbooks:open(xlsname)
oexcel:visible=.t. && [should save & open 'xlsname.xlsx' sorted on 'cF.Y']

-thanks

Re: create,save,open excel file sorted on a col#

<57a1487c-e8ec-45d3-b986-91a8d1c02ce9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17171&group=comp.lang.xharbour#17171

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:6713:0:b0:3a8:2719:39c3 with SMTP id e19-20020ac86713000000b003a8271939c3mr550582qtp.432.1671227510446;
Fri, 16 Dec 2022 13:51:50 -0800 (PST)
X-Received: by 2002:a25:81d2:0:b0:6f7:dc52:d2cc with SMTP id
n18-20020a2581d2000000b006f7dc52d2ccmr51266338ybm.292.1671227510159; Fri, 16
Dec 2022 13:51:50 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Fri, 16 Dec 2022 13:51:49 -0800 (PST)
In-Reply-To: <ed44c1e7-983e-4edd-a7dc-c4f48b25f817n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=181.47.6.188; posting-account=HpimJAoAAAB9g4YwFxxrm8_5y018T6ul
NNTP-Posting-Host: 181.47.6.188
References: <ed44c1e7-983e-4edd-a7dc-c4f48b25f817n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <57a1487c-e8ec-45d3-b986-91a8d1c02ce9n@googlegroups.com>
Subject: Re: create,save,open excel file sorted on a col#
From: claudio@herszage.com (Claudio H)
Injection-Date: Fri, 16 Dec 2022 21:51:50 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3993
 by: Claudio H - Fri, 16 Dec 2022 21:51 UTC

Here you have a googled vb example, you can easily port to xhb and adapt it to your needs.
Regards

Claudio H

* The following proceedure builds and sorts data in a range in
* the active worksheet.
*
* Visual Basic for Applications
* Sub SortData()
*
* 'Building data to sort on the active sheet.
* Range("A1").Value = "Name"
* Range("A2").Value = "Bill"
* Range("A3").Value = "Rod"
* Range("A4").Value = "John"
* Range("A5").Value = "Paddy"
* Range("A6").Value = "Kelly"
* Range("A7").Value = "William"
* Range("A8").Value = "Janet"
* Range("A9").Value = "Florence"
* Range("A10").Value = "Albert"
* Range("A11").Value = "Mary"
* MsgBox "The list is out of order. Hit Ok to continue..."
* , vbInformation
*
* 'Selecting a cell within the range.
* Range("A2").Select
*
* 'Applying sort.
* With ActiveWorkbook.Worksheets(ActiveSheet.Name).Sort
* .SortFields.Clear
* .SortFields.Add Key:=Range("A2:A11"), _
* SortOn:=xlSortOnValues, Order:=xlAscending,
* DataOption:=xlSortNormal
* .SetRange Range("A1:A11")
* .Header = xlYes
* .MatchCase = False
* .Orientation = xlTopToBottom
* .SortMethod = xlPinYin
* .Apply
* End With
* MsgBox "Sort complete.", vbInformation

rlock, dbrunlock...

<cebe37ea-d993-4af2-9710-3b3363d27bbbn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17187&group=comp.lang.xharbour#17187

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:a05:620a:13d0:b0:6ff:afd8:f08e with SMTP id g16-20020a05620a13d000b006ffafd8f08emr1670172qkl.337.1674535754010;
Mon, 23 Jan 2023 20:49:14 -0800 (PST)
X-Received: by 2002:a25:8002:0:b0:723:96ad:6761 with SMTP id
m2-20020a258002000000b0072396ad6761mr3221196ybk.326.1674535753808; Mon, 23
Jan 2023 20:49:13 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Mon, 23 Jan 2023 20:49:13 -0800 (PST)
In-Reply-To: <57a1487c-e8ec-45d3-b986-91a8d1c02ce9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2405:201:3d:94f:e8b2:f386:22ee:c3ec;
posting-account=jZAeNwoAAABYWjMRM-FfqKkHfC3Iph0l
NNTP-Posting-Host: 2405:201:3d:94f:e8b2:f386:22ee:c3ec
References: <ed44c1e7-983e-4edd-a7dc-c4f48b25f817n@googlegroups.com> <57a1487c-e8ec-45d3-b986-91a8d1c02ce9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cebe37ea-d993-4af2-9710-3b3363d27bbbn@googlegroups.com>
Subject: rlock, dbrunlock...
From: timecosting@gmail.com (timepro timesheet)
Injection-Date: Tue, 24 Jan 2023 04:49:13 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 6
 by: timepro timesheet - Tue, 24 Jan 2023 04:49 UTC

-is there a simpler/shorter way to check which record (.dbf) is locked/unlocked.
currently i lock 'each' record to get the lock status, then unlock it - if lock was successful (after status determined).

-are rlock & dbrlock similar - locks only the current record. (without unlocking any 'other' record/s that are locked)
-if similar, which should be preferred in coding.

-will dbrunlock(recno), unlock just 'that' recno.

Re: rlock, dbrunlock...

<tqo5tj$2g33$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17188&group=comp.lang.xharbour#17188

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: e.m.giordano@emagsoftware.it (Enrico Maria Giordano)
Newsgroups: comp.lang.xharbour
Subject: Re: rlock, dbrunlock...
Date: Tue, 24 Jan 2023 09:46:46 +0100
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <tqo5tj$2g33$1@dont-email.me>
References: <ed44c1e7-983e-4edd-a7dc-c4f48b25f817n@googlegroups.com>
<57a1487c-e8ec-45d3-b986-91a8d1c02ce9n@googlegroups.com>
<cebe37ea-d993-4af2-9710-3b3363d27bbbn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Jan 2023 08:46:43 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="1794c4794e4c96a362c3167fe8a83766";
logging-data="82019"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+8CO/qR5wnIWt+v9N67rnL"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:lfBbBD0T9Qko5xjfIXALg6HxEZ8=
In-Reply-To: <cebe37ea-d993-4af2-9710-3b3363d27bbbn@googlegroups.com>
 by: Enrico Maria Giordan - Tue, 24 Jan 2023 08:46 UTC

Il 24/01/2023 05:49, timepro timesheet ha scritto:

> -is there a simpler/shorter way to check which record (.dbf) is locked/unlocked.
> currently i lock 'each' record to get the lock status, then unlock it - if lock was successful (after status determined).
>
> -are rlock & dbrlock similar - locks only the current record. (without unlocking any 'other' record/s that are locked)
> -if similar, which should be preferred in coding.
>
> -will dbrunlock(recno), unlock just 'that' recno.

Only if you are using DbRLock():

DbRLockList()

--
Enrico Maria Giordano

http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg

Re: rlock, dbrunlock...

<6e62f9d3-2537-4576-87a7-6e6fc957e8d0n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17189&group=comp.lang.xharbour#17189

  copy link   Newsgroups: comp.lang.xharbour
X-Received: by 2002:ac8:73c6:0:b0:3ac:f002:48d5 with SMTP id v6-20020ac873c6000000b003acf00248d5mr1074514qtp.578.1674569904127;
Tue, 24 Jan 2023 06:18:24 -0800 (PST)
X-Received: by 2002:a25:f80b:0:b0:80b:7b18:f6f0 with SMTP id
u11-20020a25f80b000000b0080b7b18f6f0mr77190ybd.148.1674569903938; Tue, 24 Jan
2023 06:18:23 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.xharbour
Date: Tue, 24 Jan 2023 06:18:23 -0800 (PST)
In-Reply-To: <tqo5tj$2g33$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=68.107.209.13; posting-account=7bF0GwoAAABMFHX6V4fON4-1F6LFJ834
NNTP-Posting-Host: 68.107.209.13
References: <ed44c1e7-983e-4edd-a7dc-c4f48b25f817n@googlegroups.com>
<57a1487c-e8ec-45d3-b986-91a8d1c02ce9n@googlegroups.com> <cebe37ea-d993-4af2-9710-3b3363d27bbbn@googlegroups.com>
<tqo5tj$2g33$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6e62f9d3-2537-4576-87a7-6e6fc957e8d0n@googlegroups.com>
Subject: Re: rlock, dbrunlock...
From: dlzc1@cox.net (dlzc)
Injection-Date: Tue, 24 Jan 2023 14:18:24 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 27
 by: dlzc - Tue, 24 Jan 2023 14:18 UTC

On Tuesday, January 24, 2023 at 1:46:45 AM UTC-7, Enrico Maria Giordano wrote:
> Il 24/01/2023 05:49, timepro timesheet ha scritto:
>
> > -is there a simpler/shorter way to check which record (.dbf) is
> > locked/unlocked. currently i lock 'each' record to get the lock
> > status, then unlock it - if lock was successful (after status
> > determined).

If there are other processes running (not just your one instance of this program), this is the only way to know for sure.

> > -are rlock & dbrlock similar - locks only the current record.
> > (without unlocking any 'other' record/s that are locked)
> > -if similar, which should be preferred in coding.
> >
> > -will dbrunlock(recno), unlock just 'that' recno.
>
> Only if you are using DbRLock():
>
> DbRLockList()

This only works if your one executable is the one doing locking. If another process is running, they could have a lock on a record you'd not know about. "Brute force" (or using a server side database engine) is the only way to be sure. And of course "Exclusive" open is another way to be sure.

David A. Smith

Re: rlock, dbrunlock...

<tqorri$6bd1$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17190&group=comp.lang.xharbour#17190

  copy link   Newsgroups: comp.lang.xharbour
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: e.m.giordano@emagsoftware.it (Enrico Maria Giordano)
Newsgroups: comp.lang.xharbour
Subject: Re: rlock, dbrunlock...
Date: Tue, 24 Jan 2023 16:01:09 +0100
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <tqorri$6bd1$1@dont-email.me>
References: <ed44c1e7-983e-4edd-a7dc-c4f48b25f817n@googlegroups.com>
<57a1487c-e8ec-45d3-b986-91a8d1c02ce9n@googlegroups.com>
<cebe37ea-d993-4af2-9710-3b3363d27bbbn@googlegroups.com>
<tqo5tj$2g33$1@dont-email.me>
<6e62f9d3-2537-4576-87a7-6e6fc957e8d0n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Jan 2023 15:01:06 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="1794c4794e4c96a362c3167fe8a83766";
logging-data="208289"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199vV6Y6yFt6weaZ/rW2KxE"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:nCD6gRDRhb/hj6Flu8JeGIaN85s=
In-Reply-To: <6e62f9d3-2537-4576-87a7-6e6fc957e8d0n@googlegroups.com>
 by: Enrico Maria Giordan - Tue, 24 Jan 2023 15:01 UTC

Il 24/01/2023 15:18, dlzc ha scritto:

>> Only if you are using DbRLock():
>>
>> DbRLockList()
>
> This only works if your one executable is the one doing locking. If another process is running, they could have a lock on a record you'd not know about. "Brute force" (or using a server side database engine) is the only way to be sure. And of course "Exclusive" open is another way to be sure.

Yes, you are right. Sorry for the wrong info.

--
Enrico Maria Giordano

http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor