Re: iNUG List "From" Change

2017-02-17 Thread Cannon Smith via 4D_Tech
I’d like to thank Tim for helping with this. I never would have thought it was 
a contact that needed to be deleted!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Feb 17, 2017, at 12:22 PM, Timothy Penner via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> You may have a contact in your address book with the address of 
> 4D_Tech@lists.4d.com and a display name of "4D iNug Tech"... If so it is 
> likely that your email client is auto-replacing the From field in the list of 
> emails using the display name from the contact... That was what was going on 
> for Cannon.

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

Detecting if 4D is Frontmost App

2017-02-17 Thread Cannon Smith via 4D_Tech
Is there a way to detect whether 4D is the frontmost application? I have a 
small status window that I show/hide from time to time and am finding that if 
4D is hidden, when I call SHOW WINDOW, 4D comes becomes the frontmost 
application which is really annoying. I’m thinking that if I can detect whether 
4D is frontmost, I can choose whether or not to show the window at all. If 
anyone has other ideas, I’m open to them.

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: Detecting if 4D is Frontmost App

2017-02-17 Thread Cannon Smith via 4D_Tech
Thanks to everyone who replied. I just remembered that 4D has an On System 
Event database method that fires whenever the application moves to the front or 
back. I think I’ll just track the changes here.

Thanks again for all the ideas!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Feb 17, 2017, at 4:15 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> And I thought the Win32API plug-in had a command to do this, but I'm not 100% 
> certain...

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

Re: Old doesn't work with object fields

2017-02-22 Thread Cannon Smith via 4D_Tech
Hi Jeff,

>  If ((JSON Stringify($fieldPtr->))#(JSON Stringify(Old($fieldPtr->

This only works if the order of the keys in the object stays the same which may 
not be true depending on how you change the object. I’ve pasted in a method 
below that you can use to compare two objects which don’t care about the order 
of keys. I use it in a similar situation to what you are doing and it works 
well.

The method name is “OBJ_IsEqual”. It calls itself, so if you use a different 
name make sure you change that in the code.

Vincent de Lachaux posted the original code which I then stole. :-)

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236





  //Compares two objects. If they are the same (ie. they have exactly the same 
elements and values),
  //the method returns true. Thanks to Vincent de Lachaux for the original code 
which has been changed
  //slightly to more closely match my style.

C_OBJECT($1;$oFirst)
C_OBJECT($2;$oSecond)
C_BOOLEAN($0;$fIsEqual)

$oFirst:=$1
$oSecond:=$2
$fIsEqual:=False  //Default to false

C_LONGINT($x;$y;$lFirstItemCount;$lSecondItemCount;$lFirstPropertyCount;$lSecondPropertyCount)
ARRAY LONGINT($alFirstType;0)
ARRAY TEXT($atFirstProperty;0)
ARRAY LONGINT($alSecondType;0)
ARRAY TEXT($atSecondProperty;0)

OB GET PROPERTY NAMES($oFirst;$atFirstProperty;$alFirstType)
OB GET PROPERTY NAMES($oSecond;$atSecondProperty;$alSecondType)
$lFirstPropertyCount:=Size of array($atFirstProperty)
$lSecondPropertyCount:=Size of array($atSecondProperty)

If ($lFirstPropertyCount=$lSecondPropertyCount)  //They won't be equal if they 
have different property counts
If ($lFirstPropertyCount>0)
  //Sort arrays because the properties could be in a different 
order
SORT ARRAY($atFirstProperty;$alFirstType)
SORT ARRAY($atSecondProperty;$alSecondType)

  //Now compare each property
For ($x;1;$lFirstPropertyCount)

Case of 
: ($atFirstProperty{$x}#$atSecondProperty{$x})  
//Check property name
$fIsEqual:=False

: ($alFirstType{$x}#$alSecondType{$x})  //Check 
property type
$fIsEqual:=False

: ($alFirstType{$x}=Is object)
  //compare the two objects
$fIsEqual:=OBJ_IsEqual (\
OB Get($oFirst;$atFirstProperty{$x};Is 
object);\
OB Get($oSecond;$atFirstProperty{$x};Is 
object))

: ($alFirstType{$x}=Object array)
  //In an object array we can massage 
all the array types back into text except object themselves.
  //So we get two sets of arrays, one 
text and the other objects. Then we can deal with either kind
  //as we walk through each element.

ARRAY OBJECT($aoFirst;0)  //Reset arrays
ARRAY TEXT($atFirst;0)
ARRAY OBJECT($aoSecond;0)
ARRAY TEXT($atSecond;0)
OB GET 
ARRAY($oFirst;$atFirstProperty{$x};$aoFirst)  //Get text and object types
OB GET 
ARRAY($oFirst;$atFirstProperty{$x};$atFirst)
OB GET 
ARRAY($oSecond;$atFirstProperty{$x};$aoSecond)
OB GET 
ARRAY($oSecond;$atFirstProperty{$x};$atSecond)

$lFirstItemCount:=Size of 
array($aoFirst)
$lSecondItemCount:=Size of 
array($aoSecond)
If ($lFirstItemCount=$lSecondItemCount)
For ($y;1;$lFirstItemCount;1)
If ((OB Is 
defined($aoFirst{$y})) & (OB Is defined($aoSecond{$y})))  //If they are both 
objects

$fIsEqual:=OBJ_IsEqual ($aoFirst{$y};$aoSecond{$y})
Else   //Compare text

$fIsEqual:=($atFirst{$y}=$atSecond{$y})
End if 
If ($fIsEqual=False)
  

Re: Old doesn't work with object fields

2017-02-23 Thread Cannon Smith via 4D_Tech
Hi Arnaud,

> On Feb 22, 2017, at 2:25 PM, Arnaud de Montard via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
>> : ($atFirstProperty{$x}#$atSecondProperty{$x})  //Check property name
> 
> About the comparison above, json properties are case sensitive. 
> Things like:
>  :(Position(atFirstProperty{$x};$atSecondProperty{$x};*)=1)

Thanks! You are right, the code does not handle case sensitivity for property 
names correctly. Below is the corrected code for anyone that wants to replace 
the OBJ_IsEqual code directly. (I’ll post updated versions of the OBJ module a 
little later today.)

Nice catch!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




  //Compares two objects. If they are the same (ie. they have exactly the same 
elements and values),
  //the method returns true. Thanks to Vincent de Lachaux for the original code 
which has been changed
  //slightly to more closely match my style.

C_OBJECT($1;$oFirst)
C_OBJECT($2;$oSecond)
C_BOOLEAN($0;$fIsEqual)

$oFirst:=$1
$oSecond:=$2
$fIsEqual:=False  //Defaul to false

C_LONGINT($x;$y;$lFirstItemCount;$lSecondItemCount;$lFirstPropertyCount;$lSecondPropertyCount)
ARRAY LONGINT($alFirstType;0)
ARRAY TEXT($atFirstProperty;0)
ARRAY LONGINT($alSecondType;0)
ARRAY TEXT($atSecondProperty;0)

OB GET PROPERTY NAMES($oFirst;$atFirstProperty;$alFirstType)
OB GET PROPERTY NAMES($oSecond;$atSecondProperty;$alSecondType)
$lFirstPropertyCount:=Size of array($atFirstProperty)
$lSecondPropertyCount:=Size of array($atSecondProperty)

If ($lFirstPropertyCount=$lSecondPropertyCount)  //They won't be equal if they 
have different property counts
If ($lFirstPropertyCount>0)
  //Sort arrays because the properties could be in a different 
order
SORT ARRAY($atFirstProperty;$alFirstType)
SORT ARRAY($atSecondProperty;$alSecondType)

  //Now compare each property
For ($x;1;$lFirstPropertyCount)

Case of 
: 
(Length($atFirstProperty{$x})#Length($atSecondProperty{$x}))  //If the property 
names aren't the same length
$fIsEqual:=False

: 
(Position($atFirstProperty{$x};$atSecondProperty{$x};*)#1)  //Check property 
name (case sensitive)
$fIsEqual:=False

: ($alFirstType{$x}#$alSecondType{$x})  //Check 
property type
$fIsEqual:=False

: ($alFirstType{$x}=Is object)
  //compare the two objects
$fIsEqual:=OBJ_IsEqual (\
OB Get($oFirst;$atFirstProperty{$x};Is 
object);\
OB Get($oSecond;$atFirstProperty{$x};Is 
object))

: ($alFirstType{$x}=Object array)
  //In an object array we can massage 
all the array types back into text except object themselves.
  //So we get two sets of arrays, one 
text and the other objects. Then we can deal with either kind
  //as we walk through each element.

ARRAY OBJECT($aoFirst;0)  //Reset arrays
ARRAY TEXT($atFirst;0)
ARRAY OBJECT($aoSecond;0)
ARRAY TEXT($atSecond;0)
OB GET 
ARRAY($oFirst;$atFirstProperty{$x};$aoFirst)  //Get text and object types
OB GET 
ARRAY($oFirst;$atFirstProperty{$x};$atFirst)
OB GET 
ARRAY($oSecond;$atFirstProperty{$x};$aoSecond)
OB GET 
ARRAY($oSecond;$atFirstProperty{$x};$atSecond)

$lFirstItemCount:=Size of 
array($aoFirst)
$lSecondItemCount:=Size of 
array($aoSecond)
If ($lFirstItemCount=$lSecondItemCount)
For ($y;1;$lFirstItemCount;1)
If ((OB Is 
defined($aoFirst{$y})) & (OB Is defined($aoSecond{$y})))  //If they are both 
objects

$fIsEqual:=OBJ_IsEqual ($aoFirst{$y};$aoSecond{$y})

Re: iNUG List "From" Change

2017-02-17 Thread Cannon Smith via 4D_Tech
I’m using Apple Mail. I uploaded a screenshot showing what what I’m seeing:



--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236



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

Re: LEP and Python Script

2017-02-15 Thread Cannon Smith via 4D_Tech
Thanks to everyone who responded about this. James gets the prize. Once I set 
the original script to be executable it worked as expected.

Thanks again!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Feb 15, 2017, at 2:37 PM, James Crate via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> The script should be executable like any other script, by setting it to 
> executable (chmod +x script.py). 

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

Re: Server Mirroring

2017-03-22 Thread Cannon Smith via 4D_Tech
Hi Jeff,

Thanks for the advice. I appreciate it!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Mar 22, 2017, at 8:31 AM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> We run a mirror here -- soon to be several mirrors. Overall it works great. 
> There's practically zero overhead in the "New Log File" command 
> (milliseconds). My only advice would be to make the transfer of the logs 
> happen outside of 4D. Write a script in Python or PowerShell to handle the 
> moving of the journal files from the production server to the mirror, and 
> maintain an archive of all your journal files in case you need to restore a 
> backup and integrate them all again.

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

Server Mirroring

2017-03-20 Thread Cannon Smith via 4D_Tech
I’m looking into the idea of setting up a mirrored server. One one hand I want 
to be pretty aggressive about sending log files to the mirror—probably every 
couple of minutes. On the other hand, I don’t want to use “New log file” and 
then send the log file if nothing has changed.

Has anyone done something similar? Can I safely check the size of the log file, 
or maybe the modification date? Just wondering if anyone has any tricks for 
this.

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: Journaling Not Working

2017-03-21 Thread Cannon Smith via 4D_Tech
Um, never mind. I think the Finder isn’t updating the file size in the UI as 
often as I thought it would. I’ll do some more testing, but I think it is 
working correctly.

Sorry for the noise.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<can...@synergyfarmsolutions.com>



> On Mar 21, 2017, at 3:29 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I have a structure where I just realized that every table was set to NOT be 
> included in the journal file. Oops! So I selected all tables and checked the 
> “Include in Log File” option in the structure Inspector. So far so good. Next 
> I created some records and expected them to show up in the journal file, but 
> they didn’t. The journal file size didn’t change.

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

Re: Server Mirroring

2017-03-21 Thread Cannon Smith via 4D_Tech
Hi Paul,

I’m just working out how to do this theoretically at the moment. But, no, they 
won’t be on the same local network. I want them geographically diverse. And I 
think I want an additional place (FTP site) that is away from both of them to 
keep a copy of each log file in case the mirror can’t be reached for awhile.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Mar 21, 2017, at 2:04 AM, Paul Dennis via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I am interested in this. Are both servers on local network ? I am thinking of
> live server in cloud and backup mirror on premises. 

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

Journaling Not Working

2017-03-21 Thread Cannon Smith via 4D_Tech
I have a structure where I just realized that every table was set to NOT be 
included in the journal file. Oops! So I selected all tables and checked the 
“Include in Log File” option in the structure Inspector. So far so good. Next I 
created some records and expected them to show up in the journal file, but they 
didn’t. The journal file size didn’t change.

I’ve tried lots of things. Turned off the log file completely and turned it 
back on. Relaunched. Unchecked the Include in Log File and turned it back on 
for individual tables. Made sure I did a backup so a new log file was started. 
No matter what I try I can’t seem to get it to log any changes to records. It 
will log a bit of information when the database is launched or quit, but that 
is it.

I have this working in lots of other scenarios, so I must be missing something 
obvious. Does anyone have any ideas?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: Server Mirroring

2017-03-21 Thread Cannon Smith via 4D_Tech
Hi Jody,

Good to hear from you! It doesn’t sound like you are very retired. :-)

Thanks for sharing your experiences. I know mirroring changed significantly in 
v14, but I’ll definitely be working directly on the server’s drives and then 
transporting them after the writing is done.

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Mar 21, 2017, at 3:07 PM, G-Mail via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> We used mirroring extensively last with version 12 (before I ‘retired’). We 
> used it at many of our sites since mirroring was first available (can’t 
> remember which version that was).
> 
> Of course now we are on v16 so things will likely have changed. We will be 
> implementing mirroring with that version once we get the project developed. 
> 
> With the earlier versions we could only keep the mirror working reliably if 
> we had the log files written to the server’s local drives. If there is an 
> interruption to the access to the drives where the logs are to be stored, the 
> mirror would stop.
> 
> We had the log files being merged into the backup data file on the other 
> server every 20 minutes. This way if there was a problem getting a log file 
> sent to the backup server the main server’s logs didn’t stop being created. 
> 
> Just our experiences and how we did it.

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

Re: Converting Little Endian Byte Representation To a String

2017-04-21 Thread Cannon Smith via 4D_Tech
Hi Arnaud,

Interesting idea. In all actuality, even though we call the tag a “number", it 
is always treated as a string. This algorithm I needed help with was the first 
time in 10 years I needed to think of it as a number, and that was only a 
temporary step for the way the algorithm worked.

Thanks for the idea, though!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Apr 21, 2017, at 6:29 AM, Arnaud de Montard via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> just thinking about the opposite option… 
> You store the number as a string because that number is "too big" for 4D 
> numeric fields. Now, 15 digits string means 15*2 chars in an alpha/text field 
> = 30 bytes, and not a number as a result. While a uuid field is a number, 16 
> bytes, represented by 32 chars. I'm wondering if a uuid field instead 
> wouldn't be better.  

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

Re: Converting Little Endian Byte Representation To a String

2017-04-18 Thread Cannon Smith via 4D_Tech
Thanks, Miyako! That does indeed work and is plenty fast as well. I really 
appreciate the code!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Apr 18, 2017, at 12:43 AM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I think this will do it:
> 
> ASSERT("840003123456770"=Get_value ("02ABC877FAFB0200"))
> 
> using primary school maths only...
> 

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

Re: "Placeholder" in property list

2017-04-22 Thread Cannon Smith via 4D_Tech
Yep, it's a very welcome feature. And you can set it programmatically! :-)

--
Cannon Smith

> On Apr 22, 2017, at 7:37 AM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Has anyone noticed that in 15.4 (HF2... maybe others) there's a new property 
> for fields and variables called 'Placeholder' that automatically fills an 
> empty field with descriptive text in a light gray font color, which 
> disappears when you type or the variable receives a value?

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

Re: Components and custom constants files

2017-04-22 Thread Cannon Smith via 4D_Tech
Hi David,

I can see from your component naming that you used to live in Hawaii! :-)

--
Cannon Smith

> On Apr 22, 2017, at 12:12 AM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> DaKine.4dbase

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

Re: Components: How do you reuse utility code?

2017-04-22 Thread Cannon Smith via 4D_Tech
James, I think you’ve expressed very well why more code in the 4D community 
isn’t shared. I know there have been many times when I wanted to share a bit of 
code that I thought would be helpful or in response to a question someone had. 
And then I realized how many “core” methods I would have to somehow share as 
well. Suddenly it becomes too onerous to quickly share it.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Apr 22, 2017, at 10:58 AM, James Crate via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> So for example, the code I wrote some years ago to do HTTP GET with digest 
> authentication uses utility routines for basic things that I had to write 
> myself. That code can’t be easily shared because then someone would need to 
> also need to either edit the code to use their utility routines, or run the 
> risk of duplicate method names with different parameter lists. 

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

Re: DebugLogReader

2017-03-06 Thread Cannon Smith via 4D_Tech
Hi Alex,

I just wanted to say thank you for providing this tool. I haven’t had a need to 
use it since you released it, but I have had need of such a thing many times in 
the past and expect it will be very useful in the future.

Thanks much!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Mar 2, 2017, at 6:30 AM, Herr Alexander Heintz via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> based on the excellent work of Justin Carr, I have completed a tool for 
> developers that will greatly facilitate the optimization of your code.
> 
> I works by reading the 4D Debug Log files and presenting you with different 
> views in order to analyze the information contained therein.
> 
> Contrary to the tool published by 4D a while ago, the DebugLogReader works 
> with microseconds and can aggregate multiple method calls for a better 
> understanding of where time is spent in your code execution.
> 
> You will find the tool (V16 compiled) along with some helpful goodies and a 
> rudimentary description on my blog:

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

Converting Little Endian Byte Representation To a String

2017-04-17 Thread Cannon Smith via 4D_Tech
I have a little problem I’m hoping someone can help me solve. First, a bit of 
background. Our application deals with RFID tags for animals. These are always 
15 digit numbers like 124000123456789. Even though they are numbers, I never 
have to deal with them as numbers. Instead, I always treat them as strings. 
RFID readers are usually RS-232 devices that send the tag number over as a 
string, so that works out well.

Now I’m being asked to support a new kind of reader that works differently. I 
have the algorithm to convert from the reader byte structure to a 15 digit 
number. Unfortunately, 4D’s C_REAL variables are only precise to 13 digits, so 
my last 2-3 digits are incorrect. I’m hoping someone knows how to convert what 
I’m getting into a 15 digit string in some other way.

Here is an example string coming across the wire: “02ABC877FAFB0200”. This 
represents 8 bytes in little endian ordering. The algorithm that was given me 
was to break the string into bytes (“02”, “AB”, “C8”, etc.) and then loop 
through each byte, converting it to decimal and applying a little math. For 
example:

Hex “02” = Decimal 2. SubValue = 2 * (256^0)  = 2
Hex “AB" = Decimal 171.Subvalue = 171 * (256^1) =  43776
Hex “C8" = Decimal 200.Subvalue = 200 * (256^2) =  13107200
Hex “77" = Decimal 119. Subvalue = 119 * (256^3) =1996488704
Hex “FA" = Decimal 250.Subvalue = 250 * (256^4) =  1073741824000
Hex “FB" = Decimal 251.Subvalue = 251 * (256^5) =  275977418571776 (4D 
gives 2.759774185718e+14)
Hex “02" = Decimal 2.Subvalue = 2  * (256^6) = 562949953421312 (4D 
gives 5.629499534213e+14)
Hex “00" = Decimal 0.Subvalue = 0  * (256^7) = 0

Once this is done, all the subvalue results are summed which should give the 
RFID number. In this case it should be 840003123456770. But 4D gives this: 
8.400031234568e+14. As you can see, the last three digits are not correct.

So, does anyone know a way to convert the string “02ABC877FAFB0200” to the 
string “840003123456770” within 4D’s limitations?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: Converting Little Endian Byte Representation To a String

2017-04-17 Thread Cannon Smith via 4D_Tech
Hi Julio,

Not a stupid question at all! The hex string representation is simply the way 
this reader has decided to encode and transfer the RFID number. The actual RFID 
number has to be interoperable with other systems that expect it in the 
“regular” format. Also, users will sometimes hand enter the number which is 
printed on the tag and that would be in the “regular” format as well and would 
need to match what is in the database.

The real question is why this particular RFID reader has decided to encode the 
number in this way when every single reader I’ve dealt with in the past decade 
all do it the same “regular” way. Sigh.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Apr 17, 2017, at 3:59 PM, Julio Carneiro via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Forgive my stupid question: why do you need to convert the hex string to 
> number? Can’t you simply use it as your RFID? (of course you’d have to 
> increase your key field to 16 chars). You’re already handling it as a string, 
> why change?

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

Re: Converting Little Endian Byte Representation To a String

2017-04-17 Thread Cannon Smith via 4D_Tech
Thanks, Tim! I’ll try that library out tomorrow and see how it goes.

Much appreciated.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Apr 17, 2017, at 5:03 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> There is a code library on 4D Forums called Math4D that might do the trick 
> for you. I think the method you are looking for is MATH_GrandsEntiers.

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

Re: Converting Little Endian Byte Representation To a String

2017-04-18 Thread Cannon Smith via 4D_Tech
Thanks again, Miyako! This is even more useful!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Apr 18, 2017, at 3:39 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I think there was a bug in the carry-over logic,
> I've uploaded a cleaner version here:
> 
> https://github.com/miyako/4d-tips-text-integer-maths
> 
> 

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

Re: revelation! - Choose

2017-07-10 Thread Cannon Smith via 4D_Tech
Hi Chip,

You may want to vote for this feature request:



--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jul 10, 2017, at 8:22 AM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> How Sad...
> This is Sooo much nicer to read/look at:
> $Specified_Fields:=Choose(Count parameters>=2;$2;<>ptr_Nil)

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

Re: Best way to stash an object array into an object field

2017-07-08 Thread Cannon Smith via 4D_Tech
Hi David,

I haven’t tried storing an object array as the top level in a field, but have 
done it a lot one level down. For example:

C_OBJECT($oInfo)
ARRAY OBJECT($aoFacts;0)

//...Create facts and append them to $aoFacts...

OBJ_Set_Array($oInfo;”Facts”;->$aoFacts)
[Table] ObjectField:=$oInfo
SAVE RECORD([Table])

Unless I’ve misunderstood….

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jul 8, 2017, at 7:47 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> ...I've got some summary data I'm storing in a fact table and want to stash
> an array of objects in an object field.

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

Re: Thinking through object/text fields: Findings summarized, advice solicited

2017-07-15 Thread Cannon Smith via 4D_Tech
Although I use object extensively in code, I don’t use them in very many 
fields. I do have several “settings” fields and find object type fields very 
useful here. Being able to add settings in the future without changing the 
structure is great and it seems like less work to have an extensive, but 
organized list of settings in an object than other methods I’ve tried in the 
past.

The only other object type field I use is one for tracking the breed of an cow. 
Each cow can be composed of 0..n breeds, each with a percentage of the total. 
This could have been in another table, but in this case it worked very nicely 
to put this information into an object field for each animal.

I guess the bulk of the data I work with in current projects tends to be pretty 
structured, so regular fields work best. I worked on a project many years ago 
where object fields would have been perfect. The users could create their own 
“fields”. Lots of them. I think Pat Bensky does something like that, doesn’t 
she?

Anyway, that’s all I do with them.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jul 14, 2017, at 4:15 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> More thoughts and comments wanted! It would be helpful to everyone to hear
> real-world stories about how you're finding object fields helpful.

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

Re: Getting Computer and OS Info

2017-07-15 Thread Cannon Smith via 4D_Tech
Hi Jeremy,

Thanks for the code. I started out using system_profiler but found it was too 
slow for my purposes. I ended up using sysctl and sw_vers on the Mac side which 
got me what I wanted and it very fast.

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jul 14, 2017, at 10:04 AM, Jeremy Roussak via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> This seems to work, on my MacBook at any rate. Can’t help with Windows.
> 
> C_TEXT($in;$out;$pattern;$model;$swVersion)
> LAUNCH EXTERNAL PROCESS("/usr/sbin/system_profiler SPHardwareDataType 
> SPSoftwareDataType";$in;$out)

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

OBJ Module Update

2017-07-19 Thread Cannon Smith via 4D_Tech
I had a suggestion from Douglas von Roeder to add a method that returns the 
size of an array inside an object to the OBJ Module. I’ve done this. If anyone 
is interested, the method added is named OBJ_Get_ArraySize and the updated 
module can be found here:



Thanks, Doug.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: Rotating Pictures

2017-08-08 Thread Cannon Smith via 4D_Tech
I should mention that the pictures are JPEGs, if it matters.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<can...@synergyfarmsolutions.com>



> On Aug 8, 2017, at 5:01 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I was surprised that the TRANSFORM PICTURE doesn’t have the ability to rotate 
> a picture. I have the need to programmatically rotate a picture before 
> displaying it on a form based on the EXIF rotation data. I’d like to do this 
> natively, if possible, and it needs to work on both Mac and Windows. Does 
> anyone have any ideas about how to do this?

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

Rotating Pictures

2017-08-08 Thread Cannon Smith via 4D_Tech
I was surprised that the TRANSFORM PICTURE doesn’t have the ability to rotate a 
picture. I have the need to programmatically rotate a picture before displaying 
it on a form based on the EXIF rotation data. I’d like to do this natively, if 
possible, and it needs to work on both Mac and Windows. Does anyone have any 
ideas about how to do this?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-09 Thread Cannon Smith via 4D_Tech
I can! :-)



--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Aug 9, 2017, at 1:34 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Sorry, I don't have a Forum link to the right request, but perhaps someone
> else can supply one?

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

Re: What happens if 4D attempts to use a Web Service with an expired cert?

2017-08-17 Thread Cannon Smith via 4D_Tech
Ah, never mind then. Unless 4D uses the same underlying code for the SSL stuff. 
No idea, though.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Aug 17, 2017, at 1:22 PM, Tony Ringsmuth  wrote:
> 
> This is using 4D's WEB SERVICE CALL command, not an HTTP Get or HTTP Request.

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

Re: What happens if 4D attempts to use a Web Service with an expired cert?

2017-08-17 Thread Cannon Smith via 4D_Tech
Hi Tony,

Do you mean with HTTP Get or HTTP Request? I ran into this a few weeks ago 
because my own cert hadn’t updated like I thought it did. It turns out that the 
HTTP Get/HTTP Request commands will simply hang. Forever.

I probably should have filed a bug, but at the time I was _way_ more concerned 
about getting the cert working correctly.

P.S. That reminds me, the HTTP Get/HTTP Request commands were being run inside 
a worker process (not preemptive). I found that when I killed the process, 
subsequent calls to the process would not relaunch it. I forgot to look into 
that further—just remembered it now. Has anyone else seen that?

(v16.1, Mac, 64-bit for both issues.)

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Aug 17, 2017, at 12:50 PM, Tony Ringsmuth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Scenario:  4D Server (or client) attempts to act as a web service client to a 
> Web service that’s running with an expired cert.
> 
> Will 4D proceed and connect?
> Or, will it stop, with errors feedback of some kind?
> 

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

Re: How to clear a webpage from a web area?

2017-05-10 Thread Cannon Smith via 4D_Tech
Hi Keith,

No sure about using the variable, but I do this when I need to get a blank web 
area:

WA OPEN URL(*;"vtWebArea";"about:blank") 

Maybe something similar for you?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 10, 2017, at 4:25 PM, Keith Goebel via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> In a dialog I have a web area that is displaying a webpage and I want to 
> simply clear it to show nothing.

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

Re: Option drag and drop vs Sierra

2017-05-15 Thread Cannon Smith via 4D_Tech
I just tried in v16.1 with Sierra 10.12.4. Options dragging some text around in 
the method editor copied the text to the new position just as I would expect. 
Regular drag and drop within the method editor also worked. FWIW.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 15, 2017, at 2:20 PM, John Baughman via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Anyone running OS X Sierra, pleas test in the Method Editor. For me Option 
> drag and drop does not work. Tried it in v14 and v16. 
> 
> Anyone know if this is already a reported bug?
> 

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

Re: Generating Random Numbers

2017-06-26 Thread Cannon Smith via 4D_Tech
I can’t agree more with what David has said about passwords. Here is another 
article about it including a comic that I like:




--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jun 26, 2017, at 3:49 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
>  I didn't
> find the reference I wanted for this

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

Re: Favorite tricks and keystrokes: Please take one and leave on

2017-05-27 Thread Cannon Smith via 4D_Tech
One of my favorite new techniques is to use an object array as a hidden column 
in a listbox array. In the old days (before v15 r something or the other) I 
often had array based list boxes which had a bunch of hidden columns to store 
data that I wanted to do something with when the row was selected. Now I only 
need a single hidden column. Each element of the object array can store a 
wealth of additional information about the row. And it is really easy to extend 
what is stored in the object in the future. No more adding additional columns 
and making sure they are updated in all the right places. So nice!

P.S. Having such an array is a bit like what is requested here, but on a 
listbox row level:



--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 26, 2017, at 6:33 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> In honor of National Take-a-Penny/Leave-a-Penny Day, I thought it would be
> nice to start a thread to collect people's favorite 4D tricks and keystroke
> combos.

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

Get table fragmentation

2017-05-29 Thread Cannon Smith via 4D_Tech
I’m working on some server health reporting. I can get the percentage of table 
fragmentation using "Get table fragmentation” for each table. I’m not quite 
sure what to do with it, though. I’d like to get a report when the overall 
fragmentation reaches some threshold where it might be worth compacting the 
datafile. 20% is suggested by on tech note.

But I suspect the number of records matters. For example, if a table only has 
100 records, I probably don’t care if it is even 80% fragmented. But if a table 
has 10 million records and is used a lot, I may not even want 20% 
fragmentation. And, if only one table is fragmented and the rest are fine, 
maybe it is worth compacting? But probably not in all cases?

Has anyone worked out some logic that can be automated and which takes these 
kinds of things into account to let you know when it makes sense to compact the 
whole datafile?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Web Areas On Form Page >1

2017-05-29 Thread Cannon Smith via 4D_Tech
Is there something different about web areas when they are on a form page > 1? 
I’ve used lots of web areas before and never run into my current problem and 
the only thing I can think of that is different is that it is on form page 3. 
Here is roughly what happens:

FORM GOTO PAGE(3)
//Set up the web area, create an html page, save it to disk, etc.
WA OPEN URL(*;"waHealthReport";$tHTMLFilePath) 

The first time this runs, nothing happens. Subsequent runs work correctly.

Anything I’m missing?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: Web Areas On Form Page >1

2017-05-29 Thread Cannon Smith via 4D_Tech
Hi Kirk,

It’s interesting that this works correctly for Steve. I’m wondering if it’s 
because I’ve only tried on the Mac so far and he’s using Windows. Do you know 
if you’ve tried it on both platforms?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 29, 2017, at 11:23 AM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I had the same problem. I just looked to see how I resolved it. Turns out I
> just brute-forced the matter and put that second 'page' onto a separate
> form and open it into the window. Looks & behaves just like 'page 2' but
> it's not.
> 

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

Re: Web Areas On Form Page >1

2017-05-29 Thread Cannon Smith via 4D_Tech
Hi Ingo,

This is basically the workaround I’m using right now. Do you know if this is 
necessary on both Mac and Windows? I haven’t tested Windows yet, but I’m 
curious.

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 29, 2017, at 1:33 PM, Ingo Wolf via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I did run into this issue, too. At the end of the "On load" form event i set 
> a flag and run Set timer. In the "on timer" event i check if the flag is 
> still set and if i'm on the page with the web area. If yes, i do WA OPEN URL 
> and clear the flag.
> My understanding of this is that the web area isn't 'instantiated' until the 
> form page containing it is shown for the first time.
> 

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

Re: Include in Log File Scan

2017-05-19 Thread Cannon Smith via 4D_Tech
Hi Arnaud,

That works like a charm! Thank you very much.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 19, 2017, at 2:44 PM, Arnaud de Montard via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> See here:
> 
> 
> array boolean($logged_ab;0)  //>>>this one
> array longint($table_al;0)
> array text($name_at;0)
> begin sql
>   SELECT LOGGED, TABLE_NAME, TABLE_ID
>   FROM _USER_TABLES 
>   INTO :$logged_ab, :$name_at, :$table_al;
> end sql
> 

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

Include in Log File Scan

2017-05-19 Thread Cannon Smith via 4D_Tech
I’d like to programmatically loop through all the tables in a database and see 
whether they have the “Include in Log File” property set. Does anyone know of a 
way to do this?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: Get table fragmentation

2017-05-30 Thread Cannon Smith via 4D_Tech
Hi Doug,

Thanks for the information. I can see that there probably isn’t an easy way to 
algorithmically have a server tell me when it needs to be compacted. I guess 
I’ll just have it report information to me, similar to what you are doing, and 
use my brain.

Thanks!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 30, 2017, at 10:55 AM, Douglas von Roeder via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> The table fragmentation level is a lot like a temperature - it's one number
> that indicates something ("it's cold") but other factors that a lead us to
> decide "it's too cold to go outside because it's too
> humid/windy/dry/calm/etc."

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

Re: Get table fragmentation

2017-05-29 Thread Cannon Smith via 4D_Tech
Hi David,

Thanks for chiming in on this. Your examples are exactly the kinds of things 
I’m checking for.

I’m glad I’m not the only one who isn’t sure how to calculate a meaningful 
fragmentation threshold value. :-)

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 29, 2017, at 3:22 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> For automated health checks, one thing you can do is script a MSC run and
> check what it says. It's not the same thing..but can be quite useful. While
> not that much related, I also like to run some other integrity checks, like
> for duplicate values (on one or more fields), orphan records (on a key),
> parent records without child records (where that doesn't make sense) and
> other data integrity checks.

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

Re: Web Areas On Form Page >1

2017-05-30 Thread Cannon Smith via 4D_Tech
Thanks, Kirk.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 29, 2017, at 7:52 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I know my solution works on both platforms but since I develop on a Mac I
> don't know if it even showed up on the Windows side.

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

Re: Web Areas On Form Page >1

2017-05-30 Thread Cannon Smith via 4D_Tech
Thanks, Ingo.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 29, 2017, at 4:09 PM, Ingo Wolf via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> This is needed and works on both Mac and Windows.

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

Re: Get table fragmentation

2017-05-30 Thread Cannon Smith via 4D_Tech
Hi Chuck,

That’s a good question. I can remember hearing both ways on this at Summits. 
Definitely less of an issue with SSDs, but I think it still can be in some 
circumstances? Makes me wonder if there are any tech notes on this. I’ll have 
to take a look.

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 30, 2017, at 8:05 AM, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> One more thing if you are running using SSDs I do not think fragmentation is 
> an issue?

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

Re: Custom comments: Lots of tips, more wanted!

2017-06-05 Thread Cannon Smith via 4D_Tech
Hi Chip,

That brings up a good question. A “static” variable doesn’t seem very much 
different from a constant on the surface. The only differences I can think of 
are (1) a constant is compiled into the raw binary and (2) because of that, a 
constant is the same across all instances of an app, where a “static” variable 
can be computed at launch (or when it is created). It just can’t change later 
on while the app is running.

But since so many languages have the concept of constants and “static” 
variables as separate things, it makes me wonder if there are more subtle (and 
important) differences that I don’t understand. Does anyone who has experience 
with both know how important it is to have both concepts in a language? Or 
could they be merged into one idea with no drawbacks?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jun 5, 2017, at 10:40 AM, Chip Scheide <4d_o...@pghrepository.org> wrote:
> 
> unless and/or until 4D gives us this ability:
> - IP vars define at startup - do not change

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

Re: Custom comments: Lots of tips, more wanted!

2017-06-05 Thread Cannon Smith via 4D_Tech
Not when you have a bunch of Find In Design windows open, several deeply nested 
Explorer folders expanded, and several non-developer related windows in some 
state that takes time to reproduce. Relaunching 4D then is a hassle.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jun 4, 2017, at 4:04 AM, Jim Dorrance via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Re-loading constants. Run Menu, Restart Interpreted: Alt Command I.
> 
> Faster than finding a command and executing it.

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

Re: Custom comments: Lots of tips, more wanted!

2017-06-05 Thread Cannon Smith via 4D_Tech
> Define(Theme;Label;Value) // Value can be Long, String, Real, or Boolean

BTW, one nice thing about creating constants directly in code, if we had a 4D 
command to do it, is that it would be easier to give away code. For example, 
I’ve started to use constants extensively in the last year or two, but I didn’t 
use any in the OBJ module that a few people use, even though there are a few 
parameters that really need to be constants. Why? Because it would have made it 
harder to share the code. Not that adding another constants file to a structure 
is a big deal, but it is one more thing to deal with.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re:

2017-06-06 Thread Cannon Smith via 4D_Tech
Never mind. All I had to do was post and then I figured it out. Just a typo. :-)

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<can...@synergyfarmsolutions.com>



> On Jun 6, 2017, at 11:10 AM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I’m passing a local boolean as the fifth parameter to PROCESS 4D TAGS (well, 
> seventh, actually, but the fifth one that the HTML will see). In the HTML 
> document I’m trying to do something like this:
> 
> 

Re: 4D World Tour - Denver

2017-05-04 Thread Cannon Smith via 4D_Tech
Well, I thought I was talking about workers in general, but that was under the 
assumption that all processes have some kind of execution cycle. Are you saying 
that a non-UI process (ex. pre-emptive thread) won’t have an execution cycle?

In either case, the only place I can think of where this might matter is in a 
worker process that has UI in it, so yes, CALL FORM is where the rubber meets 
the road here. I was trying to be more exact, but maybe assumed too much?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On May 4, 2017, at 1:46 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I think you are talking about using CALL FORM and not about workers in 
> general. In the past if you did CALL FORM 10 times to the same form, it would 
> do a redraw after each CALL FORM and thus could cause some flickering. Now 
> when a windows starts dealing with a CALL FORM it handles all the CALL FORMs 
> and then at the end it does a screen redraw. 

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

Re: 4D World Tour - Denver

2017-05-04 Thread Cannon Smith via 4D_Tech
I also just got back from the World Tour. It was great to see some of you again 
and the information was very helpful. Add had some great demos and JPR shared a 
lot of great information.

One thing JPR helped me understand better is that a worker is basically just a 
process ready to do things. You can actually start a worker process without any 
method at all. It just starts and sits there waiting for you do ask it to do 
something. Maybe not helpful in real life, but knowing that helped me 
understand the concept better.

I also learned that in previous versions a worker would check for the next 
message once per execution cycle. Right now that has changed so that the worker 
will continue executing whatever it needs to empty the message queue all in one 
event cycle. There are pros and cons each way (although I wish it were the 
former way), but this can affect UI updating in some cases, so it is good to be 
aware of.

Thanks to 4D for putting the Tour on!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236



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

Re:

2017-06-06 Thread Cannon Smith via 4D_Tech
Hi Add,

I just got done testing compiled and it works there as well. This is in v16.1.

I hope it is just a documentation issue as I really want it to work! :-)

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jun 6, 2017, at 11:44 AM, Add Komoncharoensiri via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I basically got it straight from the documentation. If it works, then we
> may be dealing with an unintended behavior or a missing information from
> the documentation. About the compiled mode, I have not tested it myself. I
> guess I can quickly test it:)

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

4d_tech@lists.4d.com

2017-06-06 Thread Cannon Smith via 4D_Tech
I’m passing a local boolean as the fifth parameter to PROCESS 4D TAGS (well, 
seventh, actually, but the fifth one that the HTML will see). In the HTML 
document I’m trying to do something like this:


Re:

2017-06-06 Thread Cannon Smith via 4D_Tech
Thanks, Add.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jun 6, 2017, at 11:52 AM, Add Komoncharoensiri via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I confirmed that it works in compiled mode as well. I¹ll report this to
> our team.

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

Re:

2017-06-06 Thread Cannon Smith via 4D_Tech
Hi Add,

I have it working now, although I haven’t tried compiled yet. Are you referring 
to compiled only?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jun 6, 2017, at 11:19 AM, Add Komoncharoensiri via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Boolean type is not a supported parameter for PROCESS 4D TAGS. Only Text,
> Number, Date, Time and Pointer are supported.

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

Re: Server Process "Frozen"-ish

2017-09-14 Thread Cannon Smith via 4D_Tech
Hmm, v16.2 eh? There goes our hope that it was fixed in that version.

Is anyone having this happen regularly enough that they can turn on some 
logging to see, for example, what the last command that ran was?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 13, 2017, at 7:58 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I've never seen this happen in 4D before.
> 
> 4D v16.2, Windows Server 2012, 64-bit
> 

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

Re: Server Process "Frozen"-ish

2017-09-13 Thread Cannon Smith via 4D_Tech
Hi Nigel,

Thanks for the idea. I did try that before to see if I could jumpstart the 
process, but unfortunately it doesn’t work. 4D thinks the process is already 
there. And it it there. It just doesn’t seem to be executing.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 13, 2017, at 10:46 AM, Nigel Greenlee via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> $_L_PostActionProcesser:=Execute on 
> server("DATA_BackgroundRecordHandler";128000;"Post Save Data 
> Processor";True;*) 
> 
> That makes sure the process is running. 
> 
> Now I know the process should not quit-but you never know what might happen. 
> I have not come across it quitting for no reason but i have come across 
> reasons to ‘end’ the process. The above ‘solution’ makes sure it is 
> running(and avoids starting it at startup on the server). 
> 
> Just a workaround suggestion..
> 

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

Re: 4D v16.2 false record locks

2017-09-18 Thread Cannon Smith via 4D_Tech
Good to know. Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 18, 2017, at 9:14 AM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Not in our case. The stored procedure that stopped running the other day 
> doesn't access or lock any records, it just calls NEW LOG FILE in a loop 
> (mirror backup).

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

Re: 4D v16.2 false record locks

2017-09-18 Thread Cannon Smith via 4D_Tech
Hi Jeff,

Funny you should mention this. Just this morning I was thinking about the 
frozen process issue some of us have been experiencing and wondering if it 
could be a call to “Locked” that isn’t returning—just hanging. Does what you 
are seeing with record locks happen to line up with this possibility at all?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 18, 2017, at 8:10 AM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Has anyone who uses v16 run across false record locks being reported?
> 
> On two occasions now over the past 3 weeks, we've run across locked records 
> where 4D reports that the user locking the record is not even signed in to 
> 4D. 
> 
> Locked Attributes seems to be giving the same information that 4D's user mode 
> locked record dialog displays (which is good I guess), but since that user 
> isn't even connected to the server there's nothing that can be done to 
> resolve it, other than to restart the server.
> 
> Curious if anyone else has seen this?

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

Re: METHOD OPEN PATH Equivalent For Forms

2017-09-21 Thread Cannon Smith via 4D_Tech
Ah yes, essentially what I’m trying to do.

Thanks anyway.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 21, 2017, at 1:52 PM, Douglas von Roeder via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Not that I've been able to figure out.
> 
> I use MOP in my "workspace palette" which allows me to create groups of
> methods that pertain to each issue that I work on. By clicking on a
> workspace name, all of the methods windows open or I can open them
> individually.
> 
> I'd love to be able to extend it to work with forms but haven't found a way
> to do so.
> 

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

Re: 4D v16 issues

2017-09-22 Thread Cannon Smith via 4D_Tech
Hi Tim,

If we encounter a server with a process that has “hung”, can we install 
ProcDump at that moment and get a capture? Or does ProcDump need to be 
installed and running before the server is launched?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 22, 2017, at 6:06 PM, Timothy Penner via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> ProcDump is a command-line utility by Microsoft to create DMP files:
> https://docs.microsoft.com/en-us/sysinternals/downloads/procdump
> 
> 4D Support has a small interface to help configure ProcDump, referred to as 
> ProcDump_interface:
> https://taow.4d.com/Tool-ProcDump/PS.22410189.en.html
> 
> A DMP file is a dump of a programs memory space.
> The Windows OS usually creates a DMP file automatically when an application 
> crashes, but it doesn't always contain much info and sometimes it doesn’t 
> even get created.
> ProcDump is much more reliable than the Operating Systems automatic mechanism 
> for creating DMP files.
> ProcDump can monitor an application and write a full DMP when it 
> hangs/freezes/crashes or just write a DMP now.
> DMP Files created by ProcDump are usually much more larger and more useful 
> than the standard DMP files from the OS.
> The ProcDump_interface makes configuring ProcDump much easier.

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

Re: Listbox Column Font Color Change

2017-09-23 Thread Cannon Smith via 4D_Tech
Does this work for you?

$lDesiredFontColor:=0x00CC  //Or whatever grey you are after
OBJECT GET RGB COLORS(*;Widget;$lForeground;$lBackground;$lAltBackground)
OBJECT SET RGB COLORS(*;Widget;$lDesiredFontColor;$lBackground;$lAltBackground)

Then you don’t have to guess what the background scheme is.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 23, 2017, at 2:34 PM, Sannyasin Siddhanathaswami via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> How do I change the font color of a listbox column and not change the 
> background color? I’d like the fonts in certain columns to be “Dark grey”, 
> and have rows alternate colors.
> 
> This changes the font color to Dark grey (but forces the background of the 
> column to white:
> OBJECT SET COLOR([CC_Transactions]Date_;-Dark grey)
> 
> This sets alternate row colors like macOS Finder (but makes all the font 
> colors black):
> OBJECT SET RGB COLORS(*;"CCTransactionsLB";Foreground color;Background 
> color;0x00F5F5F5)
> 
> Each one overrides the other.
> 
> What am I missing?
> 

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

METHOD OPEN PATH Equivalent For Forms

2017-09-21 Thread Cannon Smith via 4D_Tech
It can be helpful to programmatically open a method editor window for a method 
using METHOD OPEN PATH. I’d like to do the same thing with forms. Is there a 
way to programmatically open a form in a form editing window?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: Form with Custom Grow Box

2017-09-19 Thread Cannon Smith via 4D_Tech
Here is a way for doing that:

1. Create a picture that looks like a window grabber and place it in the bottom 
right of the form. Put an invisible button over top of it.

2. In the invisible button, capture On Mouse Move and use "SET CURSOR(9005)” to 
change the mouse cursor to a resize icon.

3. In the On Clicked event of the invisible button, capture the mouse position 
(GET MOUSE) and window position and size (GET WINDOW RECT) and store that 
information somewhere (probably process variables). Then start timer (every 1 
ticks works fine).

4. Every time the timer runs, capture the current mouse position and compute 
the difference from the original position. From this you can figure out how 
large the window should be at the moment and you can change it using SET WINDOW 
RECT. You should also check to see if the mouse button has been released (GET 
MOUSE) and stop the timer if it has. In the timer you can do the math to make 
sure the window doesn’t get too small, etc. as well.

HTH.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 19, 2017, at 9:51 AM, Piotr Chabot Stadhouders via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> What I am actually want to do is create a form window without title bar, but 
> that still is resizable.
> Is there someone that knows how to accomplish this?

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

Re: Print From Web Area

2017-10-13 Thread Cannon Smith via 4D_Tech
Hi Ortwin,

No, I haven’t tried that, but I’ll give it a shot.

Thanks!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Oct 12, 2017, at 11:06 AM, Ortwin Zillgen via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
>> What command would I use to invoke the printing in the first place?
> 
> have you tried this?
> 

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

Re: Print From Web Area

2017-10-13 Thread Cannon Smith via 4D_Tech
Hi Kirk,

I didn’t realize printing was an option from there. Thanks!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Oct 12, 2017, at 3:48 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I would enable the context menu and let the user invoke printing with a
> right click on the web area.
> 

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

Re: Communicating With BLE Devices

2017-10-13 Thread Cannon Smith via 4D_Tech
Hi Miyako,

The specific device we are currently connecting to is a prototype RFID reader 
for cattle. We have it working correctly on iOS using CoreBluetooth. Basically, 
when we want to connect we create a central manager which looks for a certain 
peripheral name. The peripheral only has one service (0xFFE0) which has seven 
characteristics (0xFFE1 - 0xFFE7). Some are read only, some are read/write, and 
some are subscribe-able. As soon as the connection is established we read and 
subscribe to various characteristics and then call back methods are fired when 
information comes in from the reader. Occasionally we also write something to 
one of the characteristics. Then, of course, we disconnect.

I’m hoping to bring the same functionality to the desktop versions in 4D. So it 
would need to be able scan for BLE devices. Probably a callback would be 
registered for whenever another device was found. We we see the name of what we 
want we can ask the plugin to quit scanning for devices and then get the 
services it offers. Probably another callback to receive these and then 
something similar to get a list of characteristics for a service. Then methods 
to read/write/subscribe to a characteristic with callbacks for the 
read/subscribe possibilities. And then something to tear it all down and 
disconnect. Pretty much everything has to work with callback methods because of 
timing nature of BLE.

Anyway, basically what you found, but on macOS and Windows. I was hoping 
CoreBluetooth existed on macOS and something similar for Windows. For example, 
I found a free app on the Mac App Store called Adafruit Bluefruit LE Connect 
which can see our device and discover the service and characteristics and 
assumed they were using built in frameworks, but maybe not?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Oct 11, 2017, at 7:02 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> it seems the cross platform libraries are all cross-mobile-platforms.
> 
> couldn't find anything for desktop windows and macos.
> 
> https://developer.apple.com/documentation/corebluetooth?language=objc
> https://developer.apple.com/library/content/samplecode/TemperatureSensor/Introduction/Intro.html
> 
> https://msdn.microsoft.com/en-us/library/windows/hardware/ff536585(v=vs.85).aspx
> https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothLE
> 
> do you have a specific peripheral in mind?
> 

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

Re: Server Process "Frozen"-ish

2017-09-08 Thread Cannon Smith via 4D_Tech
I jumped from v15.x where it was working fine to v16.1. Since you’re at v15 r5, 
maybe it was something that was introduced in one of the v15 R releases.

I haven’t posted anything before because I don’t have much that is concrete, 
but it has happened enough to know something is going on.

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 8, 2017, at 3:13 PM, Stephen J. Orth  
> wrote:
> 
> I can provide only antidotal information, but we too are seeing something 
> like this.  We happen to be using V15 R5, which is basically V16, however 
> since upgrading to it we have seen A LOT of server related issues that we 
> have never encountered before.  The code ran just fine in V13...

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

Re: Server Process "Frozen"-ish

2017-09-08 Thread Cannon Smith via 4D_Tech
Okay. I guess it’s nice to know I’m not the only one seeing this. Sorry for you 
guys, though! :-)

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 8, 2017, at 3:33 PM, BTB-David  wrote:
> 
> I would say about that yes.  We have several server processes and only one 
> gets called to our attention for not working.  No one complains about the 
> others and I haven’t looked into it to see if they have stopped too and no 
> one noticed or if they are still happily working.  I’ve been meaning to spend 
> some time looking at it and haven’t had a chance yet.
> 

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

Re: Server Process "Frozen"-ish

2017-09-08 Thread Cannon Smith via 4D_Tech
Hi David,

How about timing? Just once every two-three months per server like us?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 8, 2017, at 3:19 PM, BTB-David via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> We started seeing the same problem when we upgraded to v15R5 too.  A process 
> that ran for years on older versions just like Cannon described just stopped 
> doing it’s thing.  A reboot resolves it.  We are seeing it on 32 bit server 
> Mac & Windows.

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

TEXT TO DOCUMENT With Special Characters

2017-08-30 Thread Cannon Smith via 4D_Tech
I’m having trouble with saving Unicode characters to a file. For example, the 
following code saves a file to disk:

C_TEXT($tText;$tFilepath)

$tText:=“©” //Copyright symbol
$tFilepath:=System folder(Desktop)+"test.txt"
TEXT TO DOCUMENT($tFilepath;$tText;UTF8 text without length)

When I open the file again, it only contains a “?” character.

If I use:

TEXT TO DOCUMENT($tFilepath;$tText)

it saves correctly, but then the file has a BOM character at the beginning 
which is wreaking havoc with other systems that aren’t expecting it.

Does anyone know what I should be doing here? Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: Server Process "Frozen"-ish

2017-09-11 Thread Cannon Smith via 4D_Tech
Old network layer on the Windows platform. That’s where most of it is 
happening. There is about 35 servers involved.

New network layer on the Mac platform (different product). Just one server—it’s 
just an in house database.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 10, 2017, at 11:34 AM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> New network layer on both platforms?

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

Re: Server Process "Frozen"-ish

2017-09-09 Thread Cannon Smith via 4D_Tech
Hi Milan,

Thanks for the idea, but no, I’m not using GRAPH anywhere.

It isn’t just one particular process that does this, either. I’ve seen three 
different processes do it—all three different code paths. One just updates a 
bunch of records, one checks with a web service for a small piece of 
information, and the third one (different product) also updates a bunch of 
records.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 9, 2017, at 12:38 AM, Milan Adamov via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Are you using GRAPH command in that process? I handled one case where in 64 
> bit GRAPH caused a freeze, fixed in 16.2.

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

Re: 4D v16 issues

2017-09-28 Thread Cannon Smith via 4D_Tech
Hi Tim,

[Not sure if you missed this last week so I thought I’d ask again.]

If we encounter a server with a process that has “hung”, can we install 
ProcDump at that moment and get a capture? Or does ProcDump need to be 
installed and running before the server is launched?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 22, 2017, at 6:06 PM, Timothy Penner via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> ProcDump is a command-line utility by Microsoft to create DMP files:
> https://docs.microsoft.com/en-us/sysinternals/downloads/procdump
> 
> 4D Support has a small interface to help configure ProcDump, referred to as 
> ProcDump_interface:
> https://taow.4d.com/Tool-ProcDump/PS.22410189.en.html
> 
> A DMP file is a dump of a programs memory space.
> The Windows OS usually creates a DMP file automatically when an application 
> crashes, but it doesn't always contain much info and sometimes it doesn’t 
> even get created.
> ProcDump is much more reliable than the Operating Systems automatic mechanism 
> for creating DMP files.
> ProcDump can monitor an application and write a full DMP when it 
> hangs/freezes/crashes or just write a DMP now.
> DMP Files created by ProcDump are usually much more larger and more useful 
> than the standard DMP files from the OS.
> The ProcDump_interface makes configuring ProcDump much easier.

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

Re: TEXT TO DOCUMENT With Special Characters

2017-08-31 Thread Cannon Smith via 4D_Tech
Thanks to everyone who responded. My first problem was using the UTF8 text 
without length constant instead of “UTF-8”. Who knew they would be different! 
Thanks for pointing that out, Justin.

The main reason I didn’t want to have a BOM character was that JSON Parse 
chokes on such documents. I’ll file a bug for this. In the mean time, I’ve 
figured out a way to move forward and make peace with BOM characters while not 
affecting legacy systems until they are upgraded. It basically amounts to 
manually removing the BOM on a few files on FTP sites for awhile, but not the 
end of the world.

Thanks again for everyone’s help.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Aug 30, 2017, at 5:31 PM, Justin Carr via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> The first thing I notice is that you are using the old BLOB to text and TEXT 
> TO BLOB constant (UTF8 text without length) with the TEXT TO DOCUMENT 
> command. This command uses either strings such as "UTF-8" or the 
> corresponding MIBEnum ID (the documentation for CONVERT FROM TEXT lists these 
> out). The UTF8 text without length constant has a value of 6 which 
> corresponds to ISO-8859-3 using MIBEnum IDs.

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

Re: TEXT TO DOCUMENT With Special Characters

2017-09-01 Thread Cannon Smith via 4D_Tech
I just tried receiving it as an object, but that didn’t work either.

It’s okay, I have a workaround created now. Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Aug 31, 2017, at 5:07 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> have you tried receiving the response with a variable declared as object?
> 
> if that doesn't work, then I guess you could receive BLOB, convert to text, 
> and parse.
> 
> it is always better to receive BLOB as opposes to text, picture or object, 
> when you can't be sure of what goes on on the server side.

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

Re: TEXT TO DOCUMENT With Special Characters

2017-08-31 Thread Cannon Smith via 4D_Tech
Hi Miyako,

This morning I figured out more exactly where the error was occurring. It isn’t 
as general as I thought and it isn’t from .json files coming from disk. 
Instead, it was only occurring when using HTTP Get to pull down a .json file 
from a website.

I’m not sure if the web server should be doing something different or what, but 
the JSON that is received by HTTP Get has (always? sometimes?) a BOM at the 
beginning of it and that is what makes JSON Parse choke.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<can...@synergyfarmsolutions.com>



> On Aug 31, 2017, at 4:12 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> it's true that the commands were introduced to promote JSON, among other 
> things, but as long as you use "document to json" to restore the text, the 
> BOMs are removed anyway, so I can't see how the existence of a BOM could be 
> such a big problem.
> 
> 2017/08/31 23:25、Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> のメッセージ:
> 
> The main reason I didn’t want to have a BOM character was that JSON Parse 
> chokes on such documents. I’ll file a bug for this.
> 

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

OBJ Module and 4D v16R4

2017-10-04 Thread Cannon Smith via 4D_Tech
If you are trying to use the OBJ module in 4D v16R4, you will encounter errors. 
The errors have to do with not recognizing the new collection type. The fix is 
easy, requiring two lines to be changed:

In the OBJ_IsEqual method, line 47 should now be:

: (($alFirstType{$x}=Object array) | ($alFirstType{$x}=Is collection))


In the OBJ_Get_ArraySize method, line 20 should now be:

If ((OB Get type($oSubObject;$tLastKey)=Object array) | (OB Get 
type($oSubObject;$tLastKey)=Is collection))  //Will be true for any array type

HTH.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Communicating With BLE Devices

2017-10-11 Thread Cannon Smith via 4D_Tech
Is anyone aware of a way to communicate with a Bluetooth Low Energy device from 
4D? It needs to work on both platforms. Perhaps a plugin that I’m not aware of?

(Note that BLE devices communicate in a completely different way than classic 
Bluetooth devices.)

Thanks for any pointers.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Print From Web Area

2017-10-11 Thread Cannon Smith via 4D_Tech
Hi All,

If I generate a report in HTML and show it in a web area on a form, is there a 
way I can request that it be printed in exactly the same way as if it was in 
Safari or Firefox and printed from there?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: Print From Web Area

2017-10-12 Thread Cannon Smith via 4D_Tech
Hi Kirk,

What command would I use to invoke the printing in the first place?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Oct 11, 2017, at 5:11 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> If the web area isn't using the WebKit it's rendered using whatever the
> system browser is. I think that would mean that browser would be used to
> print it as well but I haven't really tested that.

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

Re: Server Process "Frozen"-ish

2017-10-18 Thread Cannon Smith via 4D_Tech
Just an update on this issue. Last week I was able to release a new version of 
our software to all of our customers and I included some extra logging for this 
issue. Yesterday we had a customer report the problem. Here’s what I found.

First, a bit about the process that I’ve seen freeze the most often. It is 
simply a background process that runs on the server. It checks to see if some 
work needs to be done and then delays itself for 60 ticks. Then it checks 
again. When work does need to be done it is spun off in another process, so 
this process doesn’t do a lot. It hasn’t changed much since implemented in 4D 
2004.

Based on the logging, I can see that the last line of code run was:

DELAY PROCESS(Current process;60*1)

That line of code ran at 8:15:37 AM yesterday. We found out about the problem 
at 1:01 PM, so it had been hung for several hours.

Now that I have some logging I’m hoping to see a few more instance to see 
whether they all point to the same thing. In the mean time, does this line up 
with what anyone else is seeing?

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Sep 13, 2017, at 7:58 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Just saw this happen to our production server tonight. We have a stored
> procedure that simply calls New Log File every few minutes. About an hour
> ago it just stopped working. The process is still there in the process list,
> and nothing else seems wrong with the server, but this very simple stored
> procedure just stopped working.
> 
> I've never seen this happen in 4D before.
> 
> 4D v16.2, Windows Server 2012, 64-bit
> 

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

Re: Server Process "Frozen"-ish

2017-10-18 Thread Cannon Smith via 4D_Tech
I _could_ try that. But my turn around time to send a new build to customers is 
measured in months. And if I only try this with one customer’s server, it may 
not happen for weeks. How would I know if it solved it?

The trouble with this particular bug is that it has been very hard to 
reproduce. This is the first time I even have an idea of what line of code may 
be causing it. And it is only the first time I’ve been able to log it. I’ll 
have to log it a few more times to see if it is always DELAY PROCESS.

Also, I’d rather have the bug figured out and fixed, not worked around. This 
method (and similar ones where I’ve seen this issue) have been running solid 
with basically no code changes for over a decade now. Tweaking it like that as 
a workaround, even if it worked, would keep me nervous for the next decade!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Oct 18, 2017, at 5:17 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> So you are running this process every 1 second? Here’s a crazy idea:
> 
> What if there is some strange timing issue that screws up the 1 second 
> interval. Something takes a bit to long on the server and the cooperative 
> multiprocessing system get hung up for just a bit longer than normal. So it 
> misses the next 1 second interval. 
> 
> Could you change the interval to 5 seconds? Give it some “breathing room” to 
> make sure it goes deeply asleep before it is awakened again.
> 

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

Re: subforms and object focus

2017-11-15 Thread Cannon Smith via 4D_Tech
Hi Randy,

You have to call the GOTO OBJECT in the next execution cycle of the form. One 
way to do this is call SET TIMER(-1) and then run the GOTO OBJECT in the On 
Timer event.

HTH.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Nov 15, 2017, at 10:34 AM, Randy Jaynes via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> The idea here is that I open the parent form and I want to be sitting in the 
> first field on the subform with all of its text highlighted.

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

Re: subforms and object focus

2017-11-15 Thread Cannon Smith via 4D_Tech
Hi Randy,

Maybe I wasn’t clear enough. This works for me:

Have a method called, for example, MyGotoMethod with one line of code:

GOTO OBJECT(*;”ObjectIWantToGoTo”)

If the subform has already been instantiated, then you can simply call:

EXECUTE METHOD IN SUBFORM(“SubformName";"MyGotoMethod”) 

To goto the object in the subform. But if the subform hasn’t yet been 
instantiated, like when you are first loading a form or if you are switching to 
a >1 page, then you will have to first do:

SET TIMER(-1)

Then in the On Timer method:

EXECUTE METHOD IN SUBFORM(“SubformName";"MyGotoMethod”) 

I use this all the time and it works well.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<can...@synergyfarmsolutions.com>



> On Nov 15, 2017, at 10:52 AM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> You have to call the GOTO OBJECT in the next execution cycle of the form. One 
> way to do this is call SET TIMER(-1) and then run the GOTO OBJECT in the On 
> Timer event.

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

HTTP Get and HTTP Request Blocking Server?

2017-12-14 Thread Cannon Smith via 4D_Tech
Hi All,

I’m using 4D Server with the web server on. I want to have a stored procedure 
on it occasionally use HTTP Get or HTTP Request to fetch some information from 
a web service. The amount of data sent and received is very small (less than 1 
KB), but the web service usually takes 2-3 seconds to respond. There may be 
days when I need to do this several thousands of times so I will probably want 
to split the requests into multiple processes.

My question is whether the HTTP Get/HTTP Request commands are non-blocking. I 
notice the documentation says these two commands are preemptive ready, so I’d 
like to assume they won’t block other processes, but is that only true if they 
are run in a pre-emptive process? I’ve also heard that these kinds of commands 
can really slow down the rest of the server. Or maybe this only applies to the 
Internet Commands plugin calls?

I guess I’m looking for experience/insight into this before I get too far down 
the road.

Thanks for any comments.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

SFTP and Internet Commands

2017-12-19 Thread Cannon Smith via 4D_Tech
Does anyone know of a way to use Internet Commands to login to an FTP site 
using SFTP?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

Re: HTTP Get and HTTP Request Blocking Server?

2017-12-15 Thread Cannon Smith via 4D_Tech
Hi John

Thanks for the confirmation. I appreciate it!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Dec 15, 2017, at 9:40 AM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> The 4D HTTP commands are non-blocking. I claim this because I use them for a 
> 4D to 4D remote procedure call implementation. Sometimes I test with both the 
> client side and server side in the same application instance. This is slower, 
> but it works and you can trace method calls on both sides of the interface. 
> There is no way this would work if the client blocked execution until the end 
> of the response.

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

Re: HTTP Get and HTTP Request Blocking Server?

2017-12-15 Thread Cannon Smith via 4D_Tech
Hi Miyako,

Hmm, sounds like I should be able to make something work, then. Worth trying.

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Dec 14, 2017, at 5:45 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I have only started to learn using libcurl so my understanding is limited,
> but I think the general idea goes like this:
> 
> for a time consuming operation like HTTP where the slowness is largely 
> external to the application (i.e. network, server response), it could be 
> better to have a single thread performing multiple requests in a round robin 
> manner, where it will alternate between waiting (no point in stressing the 
> system) and calling select() with a decent timeout for each request. ideally, 
> you could get near completing 3 requests that each take 3 seconds to complete 
> in 3 seconds, not 9 seconds.
> 
> so it is not enough to just be non-blocking, or yielding to other threads. 
> the caller must also be nicer to other threads by alternating between idle 
> and busy while it waits for data, especially when the server takes time to 
> respond.
> 
> it might be interesting to call HTTP Request in a preemptive worker, but 
> whether the call relieves the application from stress may depend on other 
> factors as well.

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

Re: SFTP and Internet Commands

2017-12-19 Thread Cannon Smith via 4D_Tech
The more I look into this, the more I realize it isn’t even SFTP that I want. 
What I’m really trying to do is upload a file using FTPS. Apparently the 
placement of the “S” is kind of a big deal.

So let me start the question again. Is there a way to use Internet Commands to 
send a file to an FTPS account?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Dec 19, 2017, at 11:40 AM, Milan Adamov via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> SFTP and FTP has nothing in common as protocols, you can’t expect FTP 
> commands to work with SFTP.

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

Re: SFTP and Internet Commands

2017-12-19 Thread Cannon Smith via 4D_Tech
Hi Miyako,

Thanks for that. I was a bit confused when reading the documentation of your 
plugin. Although I had SFTP on my mind at the time. So it does handle FTPS, 
then?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Dec 19, 2017, at 7:09 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> IC offers low level TCP commands, so I guess technically, it's possible.
> but the high level FTP commands do not support either implicit or explicit 
> FTPS.
> that's what moved me to write the curl-ftp plugin which uses curl internally 
> but focuses on FTP tasks.

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

Re: SFTP and Internet Commands

2017-12-19 Thread Cannon Smith via 4D_Tech
Thanks, Miyako.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Dec 19, 2017, at 7:47 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> in fact, because the backend library is curl and it accepts a URL not a host 
> name,
> you can pass http://, https:.., tftp://, telnet:// etc. to its send/receive 
> commands.
> 

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

Re: SFTP and Internet Commands

2017-12-19 Thread Cannon Smith via 4D_Tech
Thanks, everyone who responded about this. I didn’t realize there was a 
difference between FTP and SFTP other than the SSL part of things. I need it to 
work on both platforms, so I think I’ll start with Miyako’s plugin and see how 
that works.

Thanks for the help! And Merry Christmas to everyone.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Dec 19, 2017, at 12:56 PM, Timothy Penner via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Like Milan said; SFTP is essentially File Transfer over SSH, which is very 
> different from FTP and FTPS.  4DIC does not support SSH so therefore it does 
> not support SFTP.

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

Re: Counting occurrences of specific characters In a document

2017-11-08 Thread Cannon Smith via 4D_Tech
If the only reason you need to know the number of rows beforehand is to help in 
showing a progress indicator, you could use the file size and current parse 
position instead

--
Cannon Smith

> On Nov 8, 2017, at 6:42 PM, rooftop99--- via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> We are working with large Excel documents which contain upwards of 750K rows 
> and we need to import each row into a 4D application to create records.  In 
> advance of the import process I would like to know how may rows to expect.

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

Re: Sending Email To FastMail

2017-12-07 Thread Cannon Smith via 4D_Tech
I think I’ve uncovered a bug in Internet Commands. When setting up the code to 
send a new email, I use this command:

$lError:=IT_SetPort (12;465)

which should enable SSL and have the SMTP_Send command use port 465. When I see 
what is actually going on using Wireshark, I see that 4D is ignoring my request 
to use port 465 and tries to connect on port 25 instead. I haven’t noticed this 
bug for years because my previous email host allowed port 25 as a fallback. My 
new one (I think correctly) does not, so the SMTP server rejects my attempt to 
connect to it.

I’ve created a tech support case, but am wondering if anyone else has noticed 
this or figured out any workarounds.

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<can...@synergyfarmsolutions.com>



> On Dec 6, 2017, at 4:17 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Is anyone using 4D to send email through a FastMail account? I just switched 
> an email address to FastMail and think I have things set up in 4D to send to 
> it through the smtp server, but it isn’t working. Using WireShark I can see 
> it connects to the server on the TCP level, but that’s about all that happens 
> until it times out. I’m wondering if there are any tricks I’m missing.

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

Re: Sending Email To FastMail

2017-12-07 Thread Cannon Smith via 4D_Tech
Wow, I didn’t know that parameter existed! That does indeed solve the issue.

Thanks, Tim!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Dec 7, 2017, at 11:52 AM, Timothy Penner  wrote:
> 
> What are you issuing as the second parameter to SMTP_SEND?
> If you want to explicitly use SSL this parameter should be 1.
> 
> http://livedoc.4d.com/4D-Internet-Commandsv16-R4/help/Command/en/page88989.html

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

Sending Email To FastMail

2017-12-06 Thread Cannon Smith via 4D_Tech
Is anyone using 4D to send email through a FastMail account? I just switched an 
email address to FastMail and think I have things set up in 4D to send to it 
through the smtp server, but it isn’t working. Using WireShark I can see it 
connects to the server on the TCP level, but that’s about all that happens 
until it times out. I’m wondering if there are any tricks I’m missing.

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




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

  1   2   3   >