SQL Connection to External SQL DB

2019-09-15 Thread Tarawerkz via 4D_Tech
Hi All,

Need some help on a SQL connection issue….

A script that has been to access an SQL database (been deployed for years) has 
suddenly stopped working and threw up the following error :

Error - [DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL 
Security error


In the cause of debugging, I tried a simple one-line SQL login command as 
follows :

SQL Login(“IP:10.240.99.99”;$username;$password”;*)

SQL Login(“IP:10.240.99.99:1433”;$username;$password”;*)
SQL Login(“IP:10.240.99.99:1433:ssl”;$username;$password”;*)

They all resulted in 4D Syntax error that indicates a failure to connect to 
remote server, with a SQL error 9918, Generic SQL error

Where has it gone wrong?  Thank you for any advise.  


Regards,
Ronnie
Tarawerkz




**
4D Internet Users Group (4D iNUG)
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: Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech
That was a very inspiring post.


> On 15 Sep 2019, at 21:44, Aparajita Fishman via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
>> ORDA looks really interesting too but I haven't played with it yet, but I'm 
>> looking forward to experimenting with it soon.
> 
> It’s more than interesting, it’s bringing 4D into the 21st century. It’s the 
> way DB access has been on other platforms for a long time, and it's just way, 
> way superior to the legacy 4D way. Don’t ask me why, just start using it and 
> you’ll see why.
> 
> 
>> New formula (that you mentioned) has arrived with 17 R3.
> 
> This is probably the most significant addition to the language after objects. 
> Coming from a world outside 4D where functions are first class objects, 
> formulas *finally* let me do stuff that was easy to do in other languages but 
> was impossible to do in 4D. Don’t ask me how. Better to learn Javascript and 
> then see how techniques there can be applied to 4D.
> 
> 
>> File management with Path to object and Object to path are really great 
>> commands to finally have. 
> 
> Those are old school. Upgrade to R5 and use File and Folder.
> 
> 
>> Of course, what we still need is the ability to create OOP-like Classes in 
>> 4D with the associated capabilities like member variables and methods, 
>> object instantiation (may be even class reflection), etc.
> 
> I’m already doing everything you just mentioned. In fact, I’ve been able to 
> port several npm packages (including expressjs) to 4D. Don’t ask me how. If 
> you have a firm understanding of object oriented languages, just start 
> exploring the possibilities given by objects + formulas.
> 
> - Aparajita
> **
> 4D Internet Users Group (4D iNUG)
> 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)
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: Object property inheritance - why does this this not work ?

2019-09-15 Thread Aparajita Fishman via 4D_Tech
> ORDA looks really interesting too but I haven't played with it yet, but I'm 
> looking forward to experimenting with it soon.

It’s more than interesting, it’s bringing 4D into the 21st century. It’s the 
way DB access has been on other platforms for a long time, and it's just way, 
way superior to the legacy 4D way. Don’t ask me why, just start using it and 
you’ll see why.


> New formula (that you mentioned) has arrived with 17 R3.

This is probably the most significant addition to the language after objects. 
Coming from a world outside 4D where functions are first class objects, 
formulas *finally* let me do stuff that was easy to do in other languages but 
was impossible to do in 4D. Don’t ask me how. Better to learn Javascript and 
then see how techniques there can be applied to 4D.


> File management with Path to object and Object to path are really great 
> commands to finally have. 

Those are old school. Upgrade to R5 and use File and Folder.


> Of course, what we still need is the ability to create OOP-like Classes in 4D 
> with the associated capabilities like member variables and methods, object 
> instantiation (may be even class reflection), etc.

I’m already doing everything you just mentioned. In fact, I’ve been able to 
port several npm packages (including expressjs) to 4D. Don’t ask me how. If you 
have a firm understanding of object oriented languages, just start exploring 
the possibilities given by objects + formulas.

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

SPELL SET CURRENT DICTIONARY and SPELL GET DICTIONARY LIST works differently on Windows and Mac

2019-09-15 Thread wangel--- via 4D_Tech
4D v 16.6 I have the following dictionaries installed in the Hunspell folder
(.dic and .aff) on both Mac and Windows:

da_DK, en_GB, en_US, es_ES, fr-modern, nb_NO, nn_NO og pt_BR 

Out of those I have personally installed da_DK, nb_NO and nn_NO. The rest is
installed by 4D as standard dictionaries.

 

Using SPELL GET DICTIONARY LIST I get the following list on Windows (as
expected):

da_DK, en_GB, en_US, es_ES, fr-modern, nb_NO, nn_NO, pt_BR 

And on Windows I can use SPELL SET CURRENT DICTIONARY("nb_NO.dic") to load
nb_NO in text field using form event: On load. It works but the name on the
dictionary is "Unknown". The other dictionaries have a proper/correct name.

 

Using SPELL GET DICTIONARY LIST I get the following list on Mac:

nb, en_GB, en, en_CA, en_AU, en_IN, en_SG, en_JP, da, de, es, fr, it, nl,
pl, pt_BR, pt_PT, fi, sv, tr, ru, ko.

This does not reflect the dictionaries installed in the Hunspell folder.

On Mac I cannot use SPELL SET CURRENT DICTIONARY("nb_NO.dic") to load nb_NO
in text field using form event: On load.

 

For test purpose I use a Listbox with the following methods:

Case of 

 : (Form event=On Load)

   ARRAY LONGINT(langID;0)

   ARRAY TEXT(dicName;0)

   ARRAY TEXT(langDesc;0)

   SPELL GET DICTIONARY
LIST(langID;dicName;langDesc)

 : (Form event=On Clicked)

   C_TEXT($dicName)

   $dicName:=dicName{dicName}

   SPELL SET CURRENT DICTIONARY($dicName)

End case 

 

And to test the current dictionary I use a button with the method:

$curLangCode:=SPELL Get current dictionary

$countryName:=langDesc{Find in array(langID;$curLangCode)}

ALERT("Current dictionary: "+$countryName)

 

Looking at the dictionaries ID numbers on Windows compared to Mac: fr,
en_US, da_DK, nb_NO and es_ES are not the same. Only pt_BR and en_GB are the
same. On Mac nn_NO do not load. And on Mac fr and nb_NO have the same
dictionary ID number.

I can use the listbox to change dictionaries on both Mac and Windows and can
get nb_NO to work on Mac using this procedure. (On Mac I get Spanish when I
click ko). nn_NO do not load in the listbox on Mac.

I cannot change to nb_NO (or nn_NO) using buttons on Mac with the following
methods:

SPELL SET CURRENT DICTIONARY("nb_NO.dic")

SPELL SET CURRENT DICTIONARY("nb_NO")

SPELL SET CURRENT DICTIONARY("nn_NO.dic")

SPELL SET CURRENT DICTIONARY("nn_NO")

 

I get english (USA)using buttons on Mac with the following methods:

SPELL SET CURRENT DICTIONARY("en_GB.dic")

SPELL SET CURRENT DICTIONARY("en_GB")

 

The above appears to be the same in v17.2

 

**
4D Internet Users Group (4D iNUG)
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: Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech

> On 15 Sep 2019, at 14:32, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Don't try to fit a square peg into a round hole just yet

Fair enough, Jeff. I won’t, and your advice is of course wise re. “the real 
thing is coming”.

But it’s still interesting to explore the potential evolution in approach. For 
example even though a pure object oriented approach isn’t possible, an object 
based one is since we can create stateful data structures that at least mimic 
the behaviour of real class based ones and are therefore easier to manage in 
terms of documenting and auditing their behaviour.

Peter

**
4D Internet Users Group (4D iNUG)
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: Object property inheritance - why does this this not work ?

2019-09-15 Thread Jeffrey Kain via 4D_Tech
I think you should stop thinking about dot notation as object orientation. 
Concepts like classes and inheritance aren't supported yet, and saying 
$animal:=$dog isn't inheritance -- it's just assigning one object's reference 
to another and kind of backwards at that.

Don't try to fit a square peg into a round hole just yet. 4D has said these 
things are coming.

4D had a weird example in their blog, though... you could make a method called 
"New Animal" (yes, with a space... cheap trick), that creates an object and 
sets some properties for all animals. Then you could write

$dog:=New Animal

... and then start customizing the properties of dog based on the 
not-really-a-superclass Animal. 

I think this is a waste of time knowing that a proper implementation is coming 
someday... and having a space in the method name is bad enough, but there's no 
proper support for this in the language, debugger, or compiler yet, and you'll 
probably end up rewriting it all someday relatively soon anyway.

> On Sep 15, 2019, at 6:12 AM, Peter Jakobsson via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Using the v17 dot notation I was unable to get one object to inherit 
> another’s properties using the assignment operator. Also when I inspect $dog 
> in the debugger after assigning the first property, it appears empty.

**
4D Internet Users Group (4D iNUG)
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: Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech
Hi Narinder

Thanks for posting your commentary. Very interesting.

Regards

Peter

> On 15 Sep 2019, at 13:58, Narinder Chandi via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I think our coding style will need to undergo an evolution rather than 
> revolution

**
4D Internet Users Group (4D iNUG)
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: Object property inheritance - why does this this not work ?

2019-09-15 Thread Narinder Chandi via 4D_Tech
I think our coding style will need to undergo an evolution rather than 
revolution. We all probably have legacy codebases to maintain where the 
existing code will mostly stay as-is, but newer code can be written using the 
new features. Over time developers will no doubt "modernise" existing code too, 
but that is usually driven by time and cost implications.

The new language features will certainly enhance our ability to write cleaner, 
leaner code and can happily co-exist with existing 4D code. I am only just 
starting to explore the new features in a couple of personal projects where I 
have the luxury of starting with clean structures. For any developer that may 
have used Object Tools or the native OB commands in 4D or other OOP-like 
languages (I have coded a lot of PHP in various frameworks) embracing the new 
features should be a breeze.

ORDA looks really interesting too but I haven't played with it yet, but I'm 
looking forward to experimenting with it soon. I also need to play with the new 
Form command. New formula (that you mentioned) has arrived with 17 R3. So, lots 
of new toys for sure!

File management with Path to object and Object to path are really great 
commands to finally have. For me it's immediately simplified the amount of code 
I often had to write to access the file system now that you can work with an 
object.

Of course, what we still need is the ability to create OOP-like Classes in 4D 
with the associated capabilities like member variables and methods, object 
instantiation (may be even class reflection), etc. Perhaps with v18 or v19. Oh 
yes, and really we do need a much improved Method Editor :P

Regards,
 
Narinder Chandi,
ToolBox Systems Ltd.
 
I am available for new consulting opportunities…
http://4d.1045681.n5.nabble.com/ANN-4D-Developer-Available-td5765443.html
-- 

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> on behalf of 4D Tech Mailing List 
<4d_tech@lists.4d.com>
Reply-To: 4D Tech Mailing List <4d_tech@lists.4d.com>
Date: Sunday, 15 September 2019 at 12:08
To: 4D Tech Mailing List <4d_tech@lists.4d.com>
Cc: Peter Jakobsson 
Subject: Re: Object property inheritance - why does this this not work ?

Thanks Narinder.

Doesn’t this imply we need to change our entire style and approach to 
coding ? Language data structures, forms, the lot ?

Have you found you needed to do this ? (At least in terms of new code and 
optimal approaches).

Having attended the last couple of summits and various classes etc I’ve 
been aware of this looming in the background but the dot notation really is the 
breakthrough for me that warrants taking the leap across the “discontinuity 
gap” from old to new. It reminds me of working in Visual Basic years ago which 
used all this object oriented approach. 4D even lets you create a kind of 
“active object” now with “New Formula”.

Doesn’t this mean a complete revision of how we code form the ground up ? 
Finding new “best practice” approaches to absolutely everything ? (As we even 
have “collections” now so even the most fundamental aspect of 4D - current 
selections - is out of the window).

I might need to take a month off and read the whole manual again for the 
first time since 1988 !

Peter

> On 15 Sep 2019, at 12:52, Narinder Chandi via 4D_Tech 
<4d_tech@lists.4d.com > wrote:
> 
> Yes, for legacy structures that are converted to v17 you have to 
explicitly enable Unicode support and also enable the "Use object notation..." 
setting under Compatibility
**
4D Internet Users Group (4D iNUG)
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)
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: Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech
Thanks Narinder.

Doesn’t this imply we need to change our entire style and approach to coding ? 
Language data structures, forms, the lot ?

Have you found you needed to do this ? (At least in terms of new code and 
optimal approaches).

Having attended the last couple of summits and various classes etc I’ve been 
aware of this looming in the background but the dot notation really is the 
breakthrough for me that warrants taking the leap across the “discontinuity 
gap” from old to new. It reminds me of working in Visual Basic years ago which 
used all this object oriented approach. 4D even lets you create a kind of 
“active object” now with “New Formula”.

Doesn’t this mean a complete revision of how we code form the ground up ? 
Finding new “best practice” approaches to absolutely everything ? (As we even 
have “collections” now so even the most fundamental aspect of 4D - current 
selections - is out of the window).

I might need to take a month off and read the whole manual again for the first 
time since 1988 !

Peter

> On 15 Sep 2019, at 12:52, Narinder Chandi via 4D_Tech <4d_tech@lists.4d.com 
> > wrote:
> 
> Yes, for legacy structures that are converted to v17 you have to explicitly 
> enable Unicode support and also enable the "Use object notation..." setting 
> under Compatibility
**
4D Internet Users Group (4D iNUG)
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: Object property inheritance - why does this this not work ?

2019-09-15 Thread Narinder Chandi via 4D_Tech
Peter,

Yes, for legacy structures that are converted to v17 you have to explicitly 
enable Unicode support and also enable the "Use object notation..." setting 
under Compatibility. This is assuming that your structure has a clean bill of 
health in the MSC in regards to not using the period ( . ) or square bracket ( 
[ ] ) characters in any 4D variables, tables names, etc.

Regards,
 
Narinder Chandi,
ToolBox Systems Ltd.
 
I am available for new consulting opportunities…
http://4d.1045681.n5.nabble.com/ANN-4D-Developer-Available-td5765443.html
-- 

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> on behalf of 4D Tech Mailing List 
<4d_tech@lists.4d.com>
Reply-To: 4D Tech Mailing List <4d_tech@lists.4d.com>
Date: Sunday, 15 September 2019 at 11:46
To: 4D Tech Mailing List <4d_tech@lists.4d.com>
Cc: Peter Jakobsson 
Subject: Re: Object property inheritance - why does this this not work ?

Hi Narinder

So it does. I created a brand new structure and it now works.

I did that example in a legacy upgraded structure so maybe there’s some 
compatibility setting that I needed to change to fully support the new object 
syntax.

Many thanks for taking the time to check it and respond !

Peter

> On 15 Sep 2019, at 12:41, Narinder Chandi via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> I just tested your code exactly as-is and all the variables have the 
expected values. I used 17.2 on Mac

**
4D Internet Users Group (4D iNUG)
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)
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: Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech
Hi Narinder

So it does. I created a brand new structure and it now works.

I did that example in a legacy upgraded structure so maybe there’s some 
compatibility setting that I needed to change to fully support the new object 
syntax.

Many thanks for taking the time to check it and respond !

Peter

> On 15 Sep 2019, at 12:41, Narinder Chandi via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I just tested your code exactly as-is and all the variables have the expected 
> values. I used 17.2 on Mac

**
4D Internet Users Group (4D iNUG)
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: Object property inheritance - why does this this not work ?

2019-09-15 Thread Narinder Chandi via 4D_Tech
Peter,

I just tested your code exactly as-is and all the variables have the expected 
values. I used 17.2 on Mac. What version/platform did you test on? I've sent 
you a screenshot directly.

Regards,
 
Narinder Chandi,
ToolBox Systems Ltd.
 
I am available for new consulting opportunities…
http://4d.1045681.n5.nabble.com/ANN-4D-Developer-Available-td5765443.html
-- 

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> on behalf of 4D Tech Mailing List 
<4d_tech@lists.4d.com>
Reply-To: 4D Tech Mailing List <4d_tech@lists.4d.com>
Date: Sunday, 15 September 2019 at 11:12
To: 4D Tech Mailing List <4d_tech@lists.4d.com>
Cc: Peter Jakobsson 
Subject: Object property inheritance - why does this this not work ?

Hi

Using the v17 dot notation I was unable to get one object to inherit 
another’s properties using the assignment operator. Also when I inspect $dog in 
the debugger after assigning the first property, it appears empty.

Code is:

C_OBJECT($animal;$dog;$cat)

$dog:=New object
$cat:=New object

$dog.sound:="bark"
$cat.sound:="meow"

$animal:=$dog
$getSound:=$animal.sound

Running this in the debugger, $dog and $cat return “{}”, yet hovering over 
$dog.sound with the cursor does display the property value. $animal.sound 
returns undefined.

Why does this not work ?

Regards

Peter

**
4D Internet Users Group (4D iNUG)
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)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Object property inheritance - why does this this not work ?

2019-09-15 Thread Peter Jakobsson via 4D_Tech
Hi

Using the v17 dot notation I was unable to get one object to inherit another’s 
properties using the assignment operator. Also when I inspect $dog in the 
debugger after assigning the first property, it appears empty.

Code is:

C_OBJECT($animal;$dog;$cat)

$dog:=New object
$cat:=New object

$dog.sound:="bark"
$cat.sound:="meow"

$animal:=$dog
$getSound:=$animal.sound

Running this in the debugger, $dog and $cat return “{}”, yet hovering over 
$dog.sound with the cursor does display the property value. $animal.sound 
returns undefined.

Why does this not work ?

Regards

Peter

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