Re: Auto numbering method acting weirdly. Help needed

2020-07-22 Thread Randy Kaempen via 4D_Tech
Stephanie,

> On Jul 22, 2020, at 3:28 PM, Stephane Potvin via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I have a database for organizing my printed music collection.
> 
> I use a folder numbering system to do so, using this format: Letter-number
> i.e. A-25, A-26, B-17, B-18, etc.
> 
> I have one field for the letter and one field for the number.
> 
> To make it easy, I use the method below to automatically fill the number when 
> I enter a letter.
> If I enter the letter A, the number will automatically fill the number with 
> 27 if the last one in existence was 26 for the letter A.
> It behaves fine for single letters and combinations: AB, ED, etc.
> 
> Everything works perfectly well except when I enter the letters CH.
> When I do the number field gets the value 207119, and up, whereas it should 
> currently be CH-271
> 
> I need your help figuring our why it behaves this way only for those letters.

Just for sanity’s sake, did you check if you have a record with a 
[Repertoire]Folder number of 207118?


Randy Kaempen
Intellex Corporation


**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Auto numbering method acting weirdly. Help needed

2020-07-22 Thread Chuck Miller via 4D_Tech
I don’t see anything that jumps out at me, but. How about tracing to see what 
is happening?

Also if this is a multi user db. There could be failures

You could also do this
c_longint($FolderNo_L)
c_text($Prefix)
$Prefix:=[Repertoire]Folder prefix
Begin sql
select MAX([Repertoire].[Folder number]).
primary key of that table
from
[Repertoire]
where
[Repertoire].[Folder prefix] = :$Prefix
into
:$FolderNo_L,
:$Key
end sql
if ($Key = key of my record)
else

end if

Hope this helps

 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064   
 mailto:cjmillerinformed-solutions.com 
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D and Sybase connectivity
  http://www.informed-solutions.com  

This message and any attached documents contain information which may be 
confidential, subject to privilege or exempt from disclosure under applicable 
law.  These materials are intended only for the use of the intended recipient. 
If you are not the intended recipient of this transmission, you are hereby 
notified that any distribution, disclosure, printing, copying, storage, 
modification or the taking of any action in reliance upon this transmission is 
strictly prohibited.  Delivery of this message to any person other than the 
intended recipient shall not compromise or waive such confidentiality, 
privilege or exemption from disclosure as to this communication. 

> On Jul 22, 2020, at 4:28 PM, Stephane Potvin via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Good day all,
> 
> I have a database for organizing my printed music collection.
> 
> I use a folder numbering system to do so, using this format: Letter-number
> i.e. A-25, A-26, B-17, B-18, etc.
> 
> I have one field for the letter and one field for the number.
> 
> To make it easy, I use the method below to automatically fill the number when 
> I enter a letter.
> If I enter the letter A, the number will automatically fill the number with 
> 27 if the last one in existence was 26 for the letter A.
> It behaves fine for single letters and combinations: AB, ED, etc.
> 
> Everything works perfectly well except when I enter the letters CH.
> When I do the number field gets the value 207119, and up, whereas it should 
> currently be CH-271
> 
> I need your help figuring our why it behaves this way only for those letters.
> 
> Thank you in advance for your help.

**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Auto numbering method acting weirdly. Help needed

2020-07-22 Thread Stephane Potvin via 4D_Tech
Good day all,

I have a database for organizing my printed music collection.

I use a folder numbering system to do so, using this format: Letter-number
i.e. A-25, A-26, B-17, B-18, etc.

I have one field for the letter and one field for the number.

To make it easy, I use the method below to automatically fill the number when I 
enter a letter.
If I enter the letter A, the number will automatically fill the number with 27 
if the last one in existence was 26 for the letter A.
It behaves fine for single letters and combinations: AB, ED, etc.

Everything works perfectly well except when I enter the letters CH.
When I do the number field gets the value 207119, and up, whereas it should 
currently be CH-271

I need your help figuring our why it behaves this way only for those letters.

Thank you in advance for your help.

Stephane Potvin


C_TEXT($prefix)
C_LONGINT($recordNumber;$folderNumerical)

$prefix:=[Repertoire]Folder prefix
$recordNumber:=Record number([Repertoire])
$folderNumerical:=0
PUSH RECORD([Repertoire])
CUT NAMED SELECTION([Repertoire];"Pieces_TempSelection")
QUERY([Repertoire];[Repertoire]Folder prefix=[Repertoire]Folder prefix)
ORDER BY([Repertoire];[Repertoire]Folder number;<)  //Descending sort loads the 
record with highest value
If (Record number([Repertoire])#$recordNumber)  //The record with highest value 
is not the original one
$folderNumerical:=[Repertoire]Folder number+1
End if 
USE NAMED SELECTION("Pieces_TempSelection")  //Restore the original selection
POP RECORD([Repertoire])  //Restore the original record
If ($folderNumerical#0)  //Otherwise, no need to assign value
[Repertoire]Folder number:=$folderNumerical
End if 
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Multiple instances of 4D Server v17

2020-07-22 Thread Chuck Miller via 4D_Tech
Nope it is correct. I think it was always supposed to work that way when using 
single server license 
Regards 

Chuck

Sent from my iPhone

> On Jul 22, 2020, at 10:20 AM, jarosz via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Does anyone have experience of this type of situation?
> 
> I have 3 copies of 4D Server v17 running on a Mac serving say database1,
> database2 & database3. I have a 2 user license for 4D server so can connect
> client1 to database1 and client2 to database1.
> 
> When I try to connect client1 to database2 I get the message "The maximum
> number of concurrent users for your license has been reached.” even though
> database2 has no clients already connected.
> 
> With older versions of 4D Server you could connect 2 users to each instance
> of 4D Server, no matter how many instances were active.
> 
> Under v17 it seems the number of users allowed is counted across all
> instances of 4D Server running on that Mac server.
> 
> Am I reading this correctly, or have I configured something wrongly?
> 
> Has the user licensing scheme tightened up significantly with newer versions
> like v17?
> 
> Any insights would be greatly appreciated.
> 
> Michael Jarosz
> 
> 
> 
> 
> --
> Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
> **
> 4D Internet Users Group (4D iNUG)
> New Forum: https://discuss.4D.com
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Multiple instances of 4D Server v17

2020-07-22 Thread Milan Adamov via 4D_Tech


> On Jul 22, 2020, at 4:20 PM, jarosz via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> With older versions of 4D Server you could connect 2 users to each instance
> of 4D Server, no matter how many instances were active.
> 
> Under v17 it seems the number of users allowed is counted across all
> instances of 4D Server running on that Mac server.
> 
> Am I reading this correctly, or have I configured something wrongly?

Yes, it is correct and that is the case since v11, maybe even before that.

Milan

P.S. Most of the discussion. has moved from this list to https://discuss.4d.com 


**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Multiple instances of 4D Server v17

2020-07-22 Thread jarosz via 4D_Tech
Does anyone have experience of this type of situation?

I have 3 copies of 4D Server v17 running on a Mac serving say database1,
database2 & database3. I have a 2 user license for 4D server so can connect
client1 to database1 and client2 to database1.

When I try to connect client1 to database2 I get the message "The maximum
number of concurrent users for your license has been reached.” even though
database2 has no clients already connected.

With older versions of 4D Server you could connect 2 users to each instance
of 4D Server, no matter how many instances were active.

Under v17 it seems the number of users allowed is counted across all
instances of 4D Server running on that Mac server.

Am I reading this correctly, or have I configured something wrongly?

Has the user licensing scheme tightened up significantly with newer versions
like v17?

Any insights would be greatly appreciated.

Michael Jarosz




--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**