Re: 4D Security White Paper

2019-04-23 Thread Tim Nevels via 4D_Tech
On Apr 23, 2019, at 10:24 AM, Ronnie Teo wrote:

> Does anyone know if 4D have published any white papers relating to security 
> specifically for 4D versions v15 and v17?
> For example, my client would like to know what is the database encryption 
> strength level like for the above mentioned versions.

By default, data in the data file is not encrypted in v15 or v17. You can open 
a data file with a text editor and read some of the data. It’s stored as UTF-16 
so it’s not clearly readable as each character takes 2 bytes so my name would 
look like “T?i?m ?N?e?v?e?l?s?”. 

You could implement your own encryption at a field level using some of the 
tools 4D provides for encrypting blobs. 

But v18 is going to provide strong data file encryption systems that can be 
applied on a table-by-table basis. The record data is encrypted with a strong 
key. Even index data and data written to journal files are encrypted. And of 
course 4D backup have the encrypted data. 

4D is doing their first presentation of table level data file encryption at the 
4D World Tour. So it’s all very new, and not yet available. It’s a v18 feature. 
I think they are releasing it in a v17 R release too. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: v17 Print Settings in a form's Property List

2019-04-10 Thread Tim Nevels via 4D_Tech
On Apr 10, 2019, at 1:20 PM, David Rose wrote:

> So in a 64-bit environment, how do you save paper size, orientation etc. with 
> a form, so that PAGE SETUP ([MyTable];"MyForm") will load those settings?

You might consider abandoning PAGE SETUP and instead use the SET PRINT OPTION 
command. It can do the same thing as PAGE SETUP, but the added bonus is that it 
is cross platform. A saved PAGE SETUP done on macOS cannot reliably be used on 
Windows. 

https://doc.4d.com/4Dv17/4D/17.1/SET-PRINT-OPTION.301-4179600.en.html

To me PAGE SETUP is the “old way” of doing the things SET PRINT OPTION does 
now. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Error connecting to 4D Server

2019-04-08 Thread Tim Nevels via 4D_Tech
On Apr 8, 2019, at 11:44 AM, Stephen J. Orth  
wrote:

> What exactly are you seeing on the Clients?  Is this when someone is trying 
> to connect and they cannot?
> 
> If so, that is not what we are seeing.  What we get are the multiple errors 
> that started this thread, where already connected clients simply can no 
> longer talk to the server.  Either you get the -10002/3/4 error message, or 
> the one that is happening mostly is the "non-blocking" error.

Hi Steve,

I started 4D Client to connect to 4D Server, it showed the trying to connect 
progress window. After waiting a few seconds I realized it was not connecting 
to 4D Server as fast as it usually does. So I RDP to the 4D Server machine to 
check out the server and saw the “Accept New Connections” button. 

At the time nobody was connected to 4D Server. I was the first person this 
morning to try and connect. 

I have no idea when something happened to 4D Server. This particular server 
does not always have 4D Client connects. It does mostly web server work and 
only occasionally do people connect with 4D Client. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

RE: Error connecting to 4D Server

2019-04-08 Thread Tim Nevels via 4D_Tech
On Apr 8, 2019, at 10:24 AM, Allan Udy wrote:

> I haven't been following this thread closely Steve, but here's something 
> else to keep an eye on and consider
> 
> We too are having issues with one of our customers (with Windows merged 
> app server), who has been having relatively frequent client 
> disconnections. We believe there were TWO different issues at work...
> The second issue has been much more problematic -- it appears to us, 
> that in v17 (at least), 4D Server is capable of autonomously setting the 
> 'Reject New Connections' option, without user input.  That is, we've 
> seen a significant number of client disconnections, where upon 
> investigation we've seen that the '... New Connections' button on the 
> Application Server page of the Administration Window has been reading 
> 'Accept New Connections', indicating that the server is NO LONGER 
> accepting connections.  Every time we then use the server UI to click 
> this button, the Server application crashes in a most unladylike manner.
> 
> Tim Nevels (if I recall correctly), reported to us a couple of months 
> ago that he'd seen the same issue, once.

I ran into this problem again this morning. And this time it occurred on 
another server at a different client site. And Allan is right, when you click 
the “Accept New Connections” button 4D Server hangs and you get the Windows 
dialog box that 4D Server has stopped responding and you have to kill 4D 
Server. 

> We've been working with 4D Australia, and forwarding info to 4D France 
> to try and find out under what circumstances the internal server engine 
> will change the text on that button from 'Reject New Connections' to 
> 'Accept New Connections', but so far 4D France appears to be unwilling 
> to share that info.  I figure it may not necessarily be a bug in 4D, but 
> if we knew what conditions triggered the behavior we might be able to 
> solve the problem if it's environmental. That is, somehow the engine is 
> recognising that there's a condition where there are no new connections 
> being accepted, and so it changes the text on the button to 'Accept New 
> Connections, without a user actually pressing that button.

I think Allan is right. Something inside 4D Server is flipping the switch to 
stop accepting new connections and it is updating the 4D Server Administration 
window UI to show that. But it’s not doing the stop accepting connection part 
properly. So when you click the button to make it start accepting connections 
again it expects things to be in a certain state and it is not, so 4D Server 
hangs and crashes.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*


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

RE: Error connecting to 4D Server

2019-04-08 Thread Tim Nevels via 4D_Tech
On Apr 8, 2019, at 10:24 AM, Chip Scheide wrote:

> not a merged server expert - at all - BUT
> 4D server does (or at least did in earlier versions) reject new client 
> connections during a backup.
> 
> it is possible that 4D server is doing a backup, changing the 
> setting/disabling connections during backup - then failing (in some manner) 
> to correctly reset to allow connections?
> 
> again - maybe - if this is the issue
> either someone is trying to connect, an external process (an other server?) 
> is trying to connect, or a deamon is trying to run during the backup and this 
> action is "confusing" 4D server and it is failing to reset to allow 
> connections.

If a backup is running you can still connect to 4D Server. You just get a 
message that a maintenance operation is occurring. It is not a total rejection 
of connections. It is accepting a connection, then sending back a message of 
the backup running. 

This is different from what we are seeing. You never get connected to 4D 
Server. 4D Client tries for a while and then gives you a runtime error.

So I don’t think this is connected to or related to the backup process. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Printing Structure Diagram

2019-03-30 Thread Tim Nevels via 4D_Tech
On Mar 30, 2019, at 2:00 PM, roofto...@mac.com wrote:

> We are in the midst of analyzing a very old 4D application. We’d like to 
> print/plot/PDF a structure diagram, in all it’s glory, to hang on the wall.  
> It must represent all structure elements such as Tables, Fields, Relations, 
> Indexes, etc….  I have seen these diagrams for other platforms but I haven’t 
> been successful in extracting such from 4D.  
> 
> Way back in the day I could print a tiled version of the structure from the 
> Structure editor window but that print menu seems to be disabled (at least 
> for me) in current versions of 4D.  Ideally I would like to export the 
> database as xml or JASON and load it into another charting specific 
> application to manipulate and print.  I just need to find the proper 
> application (or 4D component/methods) that can consume the xml/JASON and 
> provide the needed diagrams.
> 
> An example of what I am hoping for can be found in the top image of Vanessa 
> Talbot’s 4D blog entry titled, “Detailed Analysis of Your Database Structure” 
>  Here is the link if it is allowed on the Nug: 
> "https://blog.4d.com/detailed-analysis-database-structure/“  Something, 
> clean, clear, and readable.
> 
> FYI: We are on 4D v16R5 at the moment.  Moving to v17 soon.
> 
> Any help is appreciated!

I’m not aware of anything that can do what you want. You may have to build it 
yourself. 

The structure export to XML provides the coordinates for each table, so you 
could process that with some programming and create an SVG with a bunch of 
boxes representing each table. Then you’d have to fill in all the fields inside 
each box. Not too difficult. The tricky part is drawing the relation lines. All 
the data is there, but drawing lines like you see in the structure window would 
be an interesting challenge. 

I decided to see what it took to create a printed copy of what you see in the 
structure editor. Like what you used to be able to do in previous version of 
4D. I got it done, but it’s a multistep brute-force approach. 

The structure file I was using for this test has all the tables laid out to not 
overlap. Related tables are near the one table so relation lines are readable 
and traceable. If your structure window is a fricking mess with tables piled 
upon each other and relation lines going all over the place, the method below 
will just print out your fricking mess. But if you have an organized structure 
window, here is how you can create a giant image file that you can print out in 
tiles. Grab scissors and glue stick and create your giant printout of your 
structure. 

In my example it resulted in 15 image files. The final, big .png image file was 
9,006 x 8,110 pixels and 13MB in size.  Then printed at 200% “Tile scale” it 
created 8 pages on 8.5" x 11” paper — 4 pages by 2 pages . 

Here are the notes I made to accomplish this:

- Set Structure window background to white
- Right-click in open area and choose “Structure Properties”
- Set “Fill Color” to white
- Capture images of structure
- Open structure window and expand to as big as possible
- Move to top left corner
- Take horizontal band pictures
- Take picture of window (⌘⇧4 then hold down space bar and 
click on structure window)
- Click horizontal scrollbar in the right size “page” area to 
move over 1 full screen page to the right
- Repeat until you have moved horizontal scrollbar all the way 
to the right and taken pictures each time
- Move to top left corner again
- Click vertical scrollbar to move 1 full screen down
- Take horizontal band pictures (see above)
- Repeat going down until you have taken pictures of all of the 
structure window
- Doing it this way you have every image the exact same size. Makes it 
easier to de-tile them and create a single, big image.
- Crop images to remove window frame
- Should be able to create Automator to do this with Acorn, but 
couldn’t get it to work
- I used BatchCrop to do the work
- x = 0, y = 67, width = 4063, height = 1961
- Need to special crop all images in the final column at the right so 
the match previous column
- Need to special crop all images in the final row so they match 
previous row
- Combine images into a single big image with 4D method

C_TEXT($folderPath_t;$fileName_t)
ARRAY TEXT($fileName_at;0)
C_LONGINT($index;$i;$j;$imagesPerRow_l;$numRows_l)
C_PICTURE($emptyImage_c;$rowImage_c;$finalImage_c)

$numRows_l:=5
$imagesPerRow_l:=3

  // folder of structure images
$folderPath_t:=System folder(Desktop)+"cropped"+Folder separator

  // load files names in folder
DOCUMENT LIST($folderPath_t;$fileName_at;Ignore invisible)

  // sort by name
SORT ARRAY($fileName_at;>)

  

Re: Backup and journal file configurations

2019-03-25 Thread Tim Nevels via 4D_Tech
On Mar 25, 2019, at 4:41 PM, Jim Hays wrote:

> I'm having trouble understanding how to control the use of backups and
> journal files.
> 
> Here are some things we do, or want to do:
> - Deployed servers have backups fully configured, with logs, recovery
> settings etc.
>  We're doing this, and have not needed mirrors or anything of that level
> over the years.
> 
> - Development server should NOT have backup and journal files.
>  We switch data files a lot and it becomes a mess of files and requests to
> find the journal, create a journal, or errors with the journal.
>  There should be no interruptions when running automated builds and tests
> 
> - Single user instances should not have backups and journals.
>  We use single user development, and for built application demos.
>  The data is generally disposable or for demo purposes
> 
> How do we manage this?
> - is there a tech note about this sort of thing?
> - programmatically turn settings on/off?
> - where is the "USE LOG FILE" setting kept?
>  (why is it not in backup.xml?)
> - edit or externally manage the backup.xml file
> 
> Thanks for any tips!

Backup settings are stored at the path 
"{structure.4DB}/Preferences/Backup/Backup.xml”. So each structure file has 
it’s own backup settings. So you should never copy the “Preferences” folder 
from 1 machine to another.

When you are moving data files around between systems, just copy the entire 
data file folder. That will have the .4DD, .4DIndx, .Match and .journal files. 
If they are all in the same folder you can open that data file with another 
structure and it will not ask you for the location of the .journal. The key is 
to have all these files in the same folder and to always move the entire folder 
between machines. 

I wouldn't worry if you have .journal files hanging around on your development 
machine when you open another data file. Who cares? But if it really bothers 
you, then once you open that data file with your development structure just go 
to Database Settings and turn off the journal file. Then your development 
machine will stop writing to the journal file. And if you are a “neat nick” 
then go delete the .journal file from the data file folder. 

Also, you set the use of a journal file at the structure level in your 
development machine. Leave it off. Then the first time you deploy that 
structure file to a server machine it will not ask for or use a journal file. 
So if you want to use a journal file on that server, then go to Database 
Settings and turn it on. The next time you deploy a new structure file to that 
server it should notice there is already a .journal file in use with that .4DD 
and continue to use it. 

Now if you copy that datafile folder back to your development machine, you have 
to copy the .journal file too. I believe .journal file usage is internally 
stored in a .4DD, so once you have it set up, they must stay together, or you 
get the messages you are talking about.

That’s how I understand it.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Printing a PDF document from 4D

2019-03-19 Thread Tim Nevels via 4D_Tech
On Mar 19, 2019, at 8:50 AM, Julio Carneiro wrote:

> Has anyone here had the need to print a PDF document from 4D, and found a 
> solution?
> 
> I am not talking about generating a PDF from 4D. I have an existing PDF 
> document and I need 4D to print it for me! Exactly, user selects a PDF 
> document and I have 4D command it to be printed.
> 
> I can use LEP, a plugin, whatever, but so far I have not found a way to do 
> it, with a 100% assurance the document will come out faithfully.
> 
> Oh, and this in on Windows.
> 
> Thanks for any pointers.

Acrobat Reader has a command line interface to cause it to print a PDF. It’s 
not well documented and it has changed a bit over time with different versions 
but it does work. Check this out:

https://superuser.com/questions/1226609/adobe-reader-send-to-printer-command-line

You may need to provide the full path the AcroRd32.exe to get it to work via 
LEP. Also if you don’t specify  it will print to the default 
printer. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*


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

Doris Beaulieu 31 Year Anniversary at 4D

2019-03-13 Thread Tim Nevels via 4D_Tech
LinkedIn sent out an email today that Doris Beaulieu has worked for 4D for 31 
years, since March 1988. I’ve never known a time when she were not at 4D. 
Always there to greet developers and 4D Partners at every 4D Summit too. 

Congratulations! I hope they give her a party or something at 4D. She deserves 
it.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Dropbox Upload and Dropbox Download Methods

2019-03-11 Thread Tim Nevels via 4D_Tech
On Mar 10, 2019, at 9:34 AM, Douglas von Roeder wrote:

> Agree with Kirk — thanks for posting this!

The place that does my ftp hosting is killing it, so I needed to find a new ftp 
host. Then I thought… why not use Dropbox? I’ve got a 1TB of space there that 
is not being used. 

I’m just getting started using it and so far it’s working OK. I did run into an 
error today when trying to upload a file and replace one that already exists. 
Not sure if it’s a problem yet or not, but I may need to implement 
Dropbox_DeleteFile method if it continues.

Also wanted to point out that there is a special Dropbox link that you can use 
for “direct download” of content as opposed to the standard links that first 
take you to the Dropbox website. 

Here is a test of the “standard” Dropbox link to my company logo:

https://www.dropbox.com/s/i3tzh5ukwhbtvsv/islogo.png?dl=0

Here is a link that should direct download the same logo without taking you to 
the Dropbox website first:

https://dl.dropboxusercontent.com/s/i3tzh5ukwhbtvsv/islogo.png

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Dropbox Upload and Dropbox Download Methods

2019-03-08 Thread Tim Nevels via 4D_Tech
A few weeks ago I posted a message asking if anyone had written code to upload 
and download files to Dropbox. Got no responses other than “the API looks like 
it is easy to do”. 

Today I spent time writing a couple of methods to allow uploading and 
downloading files from Dropbox with native 4D commands using the Dropbox v2 
API. And people were right, it was not too difficult. The v2 API is implemented 
very nicely and documented fairly well. I found a few documentation errors, but 
they were easily dealt with. 

4D v17 provided all the commands needed to make it all work with very little 
code. Doing this with NTK would easily take 3 times the amount of code.

My current needs are very simple. I want to upload a file to Dropbox and 
replace any existing file if necessary. Dropbox maximum file size for a single 
upload operation is 150MB. That’s more than enough for my needs. But if you 
want to upload larger files — up to the Dropbox API max size of 350MB — you’ll 
have to implement an “upload session”. 

Download requirements are also simple. Just download a file from a Dropbox path 
to a path on your hard drive. Dropbox paths are in POSIX format. 

The Dropbox v2 API uses OAuth 2, but that basically boils down to creating an 
“App” and getting an “access token” the you use with all the API calls. I’ll 
leave it up to you to go read the docs and set that all up. It’s easy. 

The code uses dot notation, but with a little work it could be ported to work 
with older versions for 4D probably back to v14. Code is cross-platform without 
any extra effort needed.

Here is me giving back to the group so you don’t have to spend a day developing 
and testing code. If others implement more of the Dropbox v2 API, please post 
it to the iNUG to help others.

  // ===
  // PROJECT METHOD: Dropbox_UploadFile

  // PARAMETERS: $0 = results object
  // $1 = dropbox access token
  // $2 = dropbox path
  // $3 = file path

  // DESCRIPTION: Uploads a file to Dropbox using the v2 API
  // Max upload size in a single transfer is 150MB.

  // https://www.dropbox.com/developers/documentation/http/documentation

  // CREATED BY: Tim Nevels, Innovative Solutions ©2019
  // DATE: 3/8/19
  // LAST MODIFIED: 
  // 

C_OBJECT($0;$results_o)
C_TEXT($1;$dropboxAccessToken_t)
C_TEXT($2;$dropboxPath_t)
C_TEXT($3;$filePath_t)
$dropboxAccessToken_t:=$1
$dropboxPath_t:=$2
$filePath_t:=$3

  // declare local variables
C_TEXT($headerValue_t;$requestURL_t;$response_t)
C_LONGINT($statusCode_l)
C_BLOB($content_x)
C_OBJECT($headerValue_o;$response_o)
ARRAY TEXT($headerName_at;0)
ARRAY TEXT($headerValue_at;0)

  // setup http header
APPEND TO ARRAY($headerName_at;"Authorization")
APPEND TO ARRAY($headerValue_at;"Bearer "+$dropboxAccessToken_t)

  // set upload header values
APPEND TO ARRAY($headerName_at;"Content-Type")
APPEND TO ARRAY($headerValue_at;"application/octet-stream”)

APPEND TO ARRAY($headerName_at;"Dropbox-API-Arg")
$headerValue_o:=New object(\
"path";$dropboxPath_t;\
"mode";"add";\
"autorename";False)  // overwrite any existing file
$headerValue_t:=JSON Stringify($headerValue_o)
APPEND TO ARRAY($headerValue_at;$headerValue_t)

  // set url
$requestURL_t:="https://content.dropboxapi.com/2/files/upload;

  // load the file
DOCUMENT TO BLOB($filePath_t;$content_x)

  // check file size
If (BLOB size($content_x)>(1024*1024*149))  // over 149MB, too close to limit 
to try
$results_o:=New object(\
"success";False;\
"statusCode";408;\
"errorMessage";"File is to large to upload in one piece")
Else 
  // upload the file
HTTP SET OPTION(HTTP compression;1)  // do compression
HTTP SET OPTION(HTTP timeout;60*10)  // 10 minute timeout
$statusCode_l:=HTTP Request(HTTP POST 
method;$requestURL_t;$content_x;$response_t;$headerName_at;$headerValue_at)

  // build results object
Case of 
: ($statusCode_l=200)  // upload was a success
$results_o:=New object(\
"success";True;\
"statusCode";$statusCode_l;\
"errorMessage";"File upload was successful")

: ($statusCode_l=409)  // endpoint specific problem
$response_o:=JSON Parse($response_t)
$results_o:=New object(\
"success";False;\
"statusCode";$statusCode_l;\
"errorMessage";$response_o.error_summary)

Else   // other problem
$results_o:=New object(\
"success";False;\
"statusCode";$statusCode_l;\
"errorMessage";"HTTP Request failed"+Char(Carriage 
return)+Char(Carriage return)+\
$response_t)
End case 

Switching from FTP to Dropbox

2019-03-01 Thread Tim Nevels via 4D_Tech
I’m considering switching from using FTP to host update files to using my 
Dropbox account. I’m wondering if anyone has written some 4D code that allows 
uploading files to Dropbox and downloading files from Dropbox. 

I could get by uploading files to Dropbox via the macOS Finder integration 
option. For downloading a dropbox file, can you just use the 4D HTTP Request 
command?

Has somebody written a Dropbox Component?

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Object notation bug?

2019-02-22 Thread Tim Nevels via 4D_Tech
On Feb 22, 2019, at 8:43 AM, Kirk Brooks wrote:

> 2) if you need DIALOG just wrap it in another object. I like to use 'data'.
> So you can do this:
> 
> $obj:=New object("data";$oChildObject)
> 
> DIALOG("myForm";$obj)
> 
> It's simple to change the references on the form objects to
> Form.data.whatever. I find it more robust not the least of which because it
> allows you to have a null object without crashing your form.

I ran into something related to this. If you just want to return data in the 
“Form” object — you are not passing any data into the form — you must create 
the object before you call DIALOG. 

So this fails:

C_OBJECT($formData_o)

DIALOG(“myForm”;$formData_o) // somewhere on myForm you do this 
“Form.result:=“Continue”

// get values set in the myForm that were assigned to “Form” object
if($formData_o.result=“Continue”)
  // this never executes
end if


But this works:

C_OBJECT($formData_o)

$formData_o:=New object

DIALOG(“myForm”;$formData_o) // somewhere on myForm you do this 
“Form.result:=“Continue”

// get values set in the myForm that were assigned to “Form” object
if($formData_o.result=“Continue”)
  // this never executes
end if

$formData_o now has all the properties you set in myForm assigned to “Form” 
object. Like “Form.result:=“Continue”

You have to get $formData_o instantiated — if that’s the right word — in the 
method before you pass it into the DIALOG command because it is passed by 
reference. Then when you use the “Form” function in myForm it will update the 
correct object that you created with the "$formData_o:=New object” line of 
code. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D And NTLMv2 & LDAP/SMB Signing

2019-02-19 Thread Tim Nevels via 4D_Tech
On Feb 19, 2019, at 2:00 PM, Ronnie Teo wrote:

> My user’s IT is looking into implementing the following:
> 
> 1.   Enforcing NTLMv2 authentication on all servers & PC
> 2.   Enabling LDAP and SMB signing on all servers and PCs
> 
> They have asked for the following feedback :
> 
> 1.  Does 4D have any compatibility or limitation when the setting “NTLM v2 
> Response only & refuse LM/NTLM v1” is enabled for all Servers and PCs?
> 
> 2.  Does 4D have any compatibility or limitation with LDAP/SMB 
> signing(Including non-windows Servers i.e. Solaris, Linux, Redhat, etc)?
> 
> The current production environments are a 4Dv11 server running on Windows 
> Server 2008r2 and a 4Dv15 server running on a Windows Server 2012.
> Can anyone offer some input into the above?

If you can upgrade to 4D v17 there are some options that might be useful for 
you.

Single Sign On (SSO) on Windows

https://doc.4d.com/4Dv17/4D/17.1/Single-Sign-On-SSO-on-Windows.300-4203708.en.html#2949178

New 4D command “Current client authentication”

https://doc.4d.com/4Dv17/4D/17.1/Current-client-authentication.301-4179394.en.html

The docs do not specify what versions of NTLM the Current client authentication 
command supports. I would open a 4D Tech Support case and ask that question. 
They can find out the low level details of what it supports.  

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: About World Tour 2019: Some answers (JPR)

2019-02-15 Thread Tim Nevels via 4D_Tech
On Feb 15, 2019, at 2:00 PM, 4d_tech-requ...@lists.4d.com wrote:

> [JPR]
> Hi Guys,
> 
> As usual, I've again received a lot of mails, from USA and the rest of the 
> World, asking me if it's important to attend the WT2019, so once again,  I've 
> decided to do a global answer. All of the questions end with the same 
> subliminal question: Does it worth it? Will we learn something valuable in 
> the Training Day?
> … 
> I've spent a great lot of time to work with ORDA, to analyse, to measure, to 
> discover, to make mistakes, to correct these mistakes and make mistakes 
> again, in order to find the easiest possible path in the programming jungle. 
> My purpose is to share all this experience with you.

I am definitely attending the Chicago 4D World Tour. I’ve attended all the 4D 
World Tours that have been offered and attended every JPR presentation. I’ve 
been to every 4D Summit since 1991 except for one — I had a broken leg and 
could not travel. 

Why do I attend? Because I want as much info as possible about how 4D works and 
as many low level details as I can get my hands on. Why?

Because that’s how you become a “4D expert”. You really can’t become or call 
yourself a “4D expert” by simply saying “I’ve been using 4D for over years and 
I’ve written hundreds of thousands of lines of code.”  There is a lot you still 
don’t know. There is a lot that I still do not know. And with ORDA the area of 
what I don’t know about 4D has grown tremendously. 

Remember, JPR is one of the few people in the world that has Laurent 
Ribardière's and Laurent Esnault’s email address and can send a message and get 
a reply. If he has a question about how 4D works at a low level, he can get an 
answer. From the real 4D experts! That kind of access leads to an unprecedented 
understanding of how 4D works. 

I want to know what JPR knows about 4D because it helps me to me be able to 
deliver better 4D solutions to my clients. 

You are not wasting time at 4D World Tour events, you are investing your time 
to learn more that will result in you saving time in the future. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Query By Formula ([Table]) v17 Loss of Functionality

2019-01-17 Thread Tim Nevels via 4D_Tech
On Jan 17, 2019, at 1:57 PM, Alan Tilson wrote:

> I'm not sure what you mean. The window had 2 or 3 boxes per line. The first
> one seems only to allow fields to be entered. The 2nd for non-boolean
> fields is the comparison box, equals, is different from, etc. The 3rd is a
> value.
> 
> This is the default query window created from this code: QUERY SELECTION BY
> FORMULA([Table]). It appears to be exactly the same query window as QUERY
> SELECTION([Table]).
> 
> If you have something that works please let me know what steps to go
> through to do it!
> 
> Ps My understanding is that we cannot send images here. Is that still true?

To access the query by formula option in the new query editor you need to 
option-click on the “+” button at the far right of a line. When you do that, 
you get a new query line that allows you to enter a formula. You can delete the 
first line in the query editor with the “-“ button.

An interesting and hidden feature of the new query editor is that you can mix 
field lines and formula lines into a single query. 

And no, you cannot send images to this message board. You have to pass a link 
to something like this:

https://www.dropbox.com/s/aerxv021dfzllxz/Screen%20Shot%202019-01-17%20at%202.09.45%20PM.PNG?dl=0

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D Authentication Strategy...

2019-01-09 Thread Tim Nevels via 4D_Tech
On Jan 9, 2019, at 11:08 AM, Tom Benedict  wrote:

> You have clearly a lot of experience with this, and I have none, so I 
> probably shouldn’t have joined the thread. However, I have a long standing 
> interest in SSO and Authentication in general. 
> 
> What I’ve found, after working many years for a large enterprise organization 
> which has very high information security standards, is that System 
> Administrators don’t like custom user access systems and Auditors like them 
> even less. What they do like are things like Active Directory and LDAP. So my 
> point is that any 4D app in an enterprise environment should use the 
> enterprise standard. Now that 4D has the tools to use Active Directory, they 
> should be used exclusively, without any custom feature access management 
> buried inside the application. System Administrators want to set access 
> privileges in Active Directory, not in 4D (and they definitely don’t want to 
> do it both places). I’ve never done the work in 4D, so I don’t have any 
> implementation details on how this would be done in 4D, but it appears, from 
> the 4D Blog posting, that v17R3 can do this.

Hi Tom,

You can remove all users and access privileges from 4D and put time into Active 
Directory. You may have to create some Custom Active Directory Attributes to 
store the information needed for you access privileges — what groups a user 
belongs to as an example. Then you can use the 4D LDAP commands to query Active 
Directory for this information in the users account. It is totally doable with 
v17. 

I asked client that I have implemented the 4D SSO system I’ve been talking 
about if they wanted to move everything to Active Directory. We talked about 
what custom attributes would need to be created and the cost to do all of this. 
They decided to start with just the authentication part and leave the user 
access privileges in 4D for now. At some point in the future we plan to move 
all the user privileges out of 4D and put them into Active Directory. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D Authentication Strategy...

2019-01-09 Thread Tim Nevels via 4D_Tech
On Jan 8, 2019, at 6:38 AM, Robert ListMail  wrote:

> Right, I understand the SSO as originally explained—that was very helpful. 
> Yet, for testing purposes at my location (without the authentication server) 
> or at the client site when you might need to login as a specific user, how 
> might you switch to/from SSO or not? I suppose there is an authentication 
> sequence used by 4D where it tries to use SSO if the checkbox is checked in 
> preferences and if no server is found or the authentication 4D code is not 
> called then the traditional built-in 4D Password system will be in effect? 
> See? I’m not sure how to switch or when SSO is automatically in play.

Hi Robert,

When you turn on SSO on 4D Server with the “Authentication of user with domain 
server” checkbox, that just makes the “Current client authentication” command 
work. That’s it. Turning on that checkbox does not automate anything for you. 
The name of the checkbox may make you think that 4D will do something for you 
when you turn it on, but it really does nothing but make a single command 
return a value you can rely on. 

You are in control of everything. There is nothing handled for you 
automatically. You program your 4D application to work the way you want it to 
work. It is all up to you.  You must write code to do what you want. 

Seems like people think that turning on the “Authentication of user with domain 
server” checkbox on 4D Server will cause 4D to do something for you. Do some 
work for you. Make something happen for you. It doesn’t. All it does is make 
“Current client authentication” command return a value on Windows that you can 
trust. 

How you use the information from the "Current client authentication” command is 
completely up to you. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D Authentication Strategy...

2019-01-09 Thread Tim Nevels via 4D_Tech
On Jan 8, 2019, at 10:36 AM, Tom Benedict  wrote:

> Here’s a link to instructions on how to set up a test Active Directory 
> instance which might work for your testing. I haven’t tried it yet. 
> https://auth0.com/docs/connector/test-dc It might help.
> 
> As far as switching between 4D Authentication and SSO, I’m thinking that 
> would be very useful. Even Microsoft SQL Server offers the option of 
> Authentication via Windows Login (Active Directory) or SQL Server Login at 
> client login time. The documentation doesn’t mention that kind of support 
> though. 
> http://doc.4d.com/4Dv17/4D/17/Single-Sign-On-SSO-on-Windows.300-3743254.en.html
>  I haven’t verified this.

Hi Tom,

It is up to you the 4D Designer and developer of your application to do the 
switching. You must do this via programming code and settings changes you make 
in the Design environment. 4D’s SSO implementation is just to make the “Current 
client authentication” command work. That’s it. 

You say “switching between 4D Authentication and SSO”, but exactly what do you 
mean? Is “4D Authentication” mean using the built in 4D User and Groups system 
and the dialog box that 4D provides when you have assigned a password to the 
Designer user?

What do you mean when you say “SSO”? Are you saying you have turned on the 
“Authentication of user with domain server” checkbox? Because once you turn on 
that checkbox your database continues to function exactly the same as if it is 
off. Nothing new happens. 

If your database shows the 4D User dialog box to allow selecting a user and 
typing in a password, turning on the “Authentication of user with domain 
server” checkbox will not change that. The dialog box will still be displayed 
to users when they try to connect to 4D Server. 

You must change your database so that it does not display the 4D User login 
dialog box. You must make that stop appearing by using the “Default user” 
option.  

https://doc.4d.com/4Dv17/4D/17/Setting-a-Default-User.300-3743513.en.html

Then you can write code in your “On Startup” method to call the “Current client 
authentication” command and do something with the information it returns. You 
decide via your programming code whether to let the user get into your 
application or you call “QUIT 4D” and not let them in. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D Authentication Strategy...

2019-01-06 Thread Tim Nevels via 4D_Tech
On Jan 6, 2019, at 12:52 AM, Tom Benedict  wrote:

> It doesn’t look like your scheme gets access privileges from Windows Active 
> Directory, instead you are getting them from your Users table. Is that 
> correct?

No. I am getting access privileges by using the "Current client authentication” 
4D command. I depend on that command giving me THE TRUTH. The truth begins with 
a valid Window Login Name. Once I have this string of bytes that define a user 
name I can rely on then that is something to authenticate with. Current client 
authentication = “timnevels”, then “timnevels” is a string of bytes I can rely 
on. So that is part one. Define “the truth”. 

> Do you also use 4D Users & Groups to define Groups to manage access to 
> application features? So you don’t use the LDAP commands to get 4D Groups for 
> the authenticated user?

I could have used 4D Users and Groups, but I chose not to. I am using my own 
table based way to store allowed users and what they can do.

I could have also chosen to build all the 4D User and Groups information into 
the Windows Active Directory system and then I would query using LDAP to see if 
the user name was allowed into the 4D database and what that user could do.

You have fallen for the trap. I did the same thing until I realized that you 
have to trust something. The trap is to not break this into 2 parts. Who do you 
trust? And then what do you do with this trusted information? 

You need to separate 4D authentication into 2 parts: 1) getting a user name or 
identifier that you can trust. You can do it all yourself with 4D Users or your 
own [Users] table. Then you prove the user has authorization to use that user 
name by having them provide a password you can validate. 

Or you can trust someone else to do the password validation for a particular 
user name. That is what SSO is all about. You trust Windows Active Directory to 
validate a password for a particular Windows Login Name. 

I am trusting that "Current client authentication” 4D command gives me THE 
TRUTH. The truth begins with a valid Window Login Name. Once I have this string 
of bytes that define a user name I can rely on, then that is something to 
authenticate with. Current client authentication = “timnevels”, then 
“timnevels” is a string of bytes I can rely on. So that is part one. 

Part 2 is what you do with that valid user name. Once you have a valid user 
name, you can use whatever method you want to check permissions or privileges 
or groups that user name belongs to. You decide that. For me SSO is just user 
name and password validation. 

> Another question that comes to mind is why can't something similar to this 
> work under MacOS? Isn’t there an LDAP equivalent for MacOS?

There probably is. I would connect with 4D and see if they have considered 
that. I’m sure they did, but probably decide not to implement it because 
Windows deployment is the majority of 4D’s user base. 

Also, the Windows Active Directory is a standard that is supported on ALL 
Windows operating systems. So only a single thing must be implemented and 
supported. 

Not sure what is guaranteed to be available on ALL macOS systems from versions 
with a macOS server, without a macOS server, just doing File Sharing, etc. I’m 
guessing there are many LDAP possibilities for macOS, but no standard and 
nothing guaranteed like there is on Windows OS.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D Authentication Strategy...

2019-01-05 Thread Tim Nevels via 4D_Tech
On Jan 5, 2019, at 2:00 PM, Robert wrote:

> Tim, I just toggled on the checkbox on the server that activates this feature 
> but I’ve not implemented the code just yet….  So, how do you specify that you 
> are logging in with the local 4D password instead of SSO? Modifier keys? 
> Hidden Menu? Also, I’m not sure when the SSO login is in effect. Once the SSO 
> code is in effect will you lock yourself out if the authentication server is 
> down or you are developing on a different network without AD services?

Hi Robert,

You don’t want to use 4D’s password system directly. You can use it behind the 
scenes so that you have access to “Current user” command as has been discussed 
here at length. But for SSO to work, you don’t want the user to have to do 
anything. They do absolutely nothing. So do not let them chose to use SSO or 
not. 

I would not plan on the authentication server every being down. That is total 
death for a Windows network. That means NOBODY can log into any computer on the 
network. So if the authentication server is down, accessing your 4D database 
will be the least of their worries. They won’t even be able to boot their 
computers or access network file shares. 

One way to look at SSO in 4D is to boil it down to the implementation basics. 
You need to identify the user automatically without any interaction from a 
person.Who is trying to get access to my database? That’s it. 

You can use “Current system user” command to get the name of the user that has 
logged into the machine. On Windows OS this is the windows login name. 

4D SSO implementation boils down to a single command “Current client 
authentication”. Use that instead of “Current system user” command. This will 
give you a guaranteed Windows login name that has been authenticated via 
Windows Active Directory. This gives you reliable user identification. 

Seems like people just can’t seem to get their heads around using 4D’s SSO 
system to replace an existing authentication system. So i’m going to provide 
some code that I use in my “Login” method. It is designed to use 4D SSO 
implementation as primary authentication, but it also works without it and on 
macOS. <>authenticatedUser_b is used in other areas of the application so that 
I know if i used SSO to authenticate.

  // get the Windows login name
$windowsUserLogin_t:=Current client authentication($domain_t;$protocol_t)

  // check login validity
Case of 
: (Is macOS)  // running on macOS
$windowsUserLogin_t:=Current system user
<>authenticatedUser_b:=False

: (Not(Is compiled mode))
$windowsUserLogin_t:=Current system user
<>authenticatedUser_b:=False

: ($windowsUserLogin_t="")  // an authenticated login could not be 
retrieved
<>authenticatedUser_b:=False
  // show user messasge and quit
Msg ("Unable to authenticate user and retrieve Windows Login 
Name"+Char(Carriage return)+\
"Login Name: "+Current system user+Char(Carriage return)+\
"Domain: "+$domain_t+Char(Carriage return)+\
"Protocol: "+$protocol_t;"Error")
QUIT 4D

Else   // got authenticated login situation
<>authenticatedUser_b:=True
End case 

// look for user and load preferences and groups
If ($windowsUserLogin_t#"")
READ ONLY([Users])
QUERY([Users];[Users]WindowsLoginName=$windowsUserLogin_t)
If (Records in selection([Users])=1)
  // save user name & ID
<>CurrentUserName:=[Users]UserName
<>CurrentUserID:=[Users]ID
  // load preferences
LoadUserPreferences ([Users]ID)
  // load privileges
GetUserGroups ([Users]ID;-><>CurrentUserGroupsA)
$loginSuccessful_b:=True
End if 
End if 

  // display dialog of User to login
If (Not($loginSuccessful_b))
<>authenticatedUser_b:=False
OpenWindow (270;270;Movable dialog box;"Login";2)
DIALOG([Dialogs];"Login")
CLOSE WINDOW
End if 

The above code first tries to use "Current client authentication”. If 4D Client 
is running on Windows and 4D is configured to have SSO turned on — and it is 
working — you get a $windowsUserLogin_t value. The remaining code deals with if 
SSO is not available for use such as if you are not running compiled or are 
running on macOS. Convenience code basically for my use when doing development 
and testing. 

Once you have a user login name you can depend on — that’s what SSO and the 
“Current client authentication” command does for you — you can then check if 
that user login name is allowed into your database. In my case I just check for 
a record in the [Users] table. 

The above code also handles the situation where authentication totally fails 
and as a very last resort 

RE: WritePro expression undefined

2018-12-21 Thread Tim Nevels via 4D_Tech
On Dec 21, 2018, at 2:00 PM, David Ringsmuth wrote:

> Add,
> 
> 4D Write expressions did not require a value to be returned, so it was 
> acceptable to have embedded Query, Create Set, Intersection, Union, Use Set, 
> Selection to Array, etc…, commands in the 4D Write document.
> 
> Converted to WritePro, the same expressions return “Undefined”.
> 
> It is a change in behavior that requires editing 1000’s of documents.
> 
> And WritePro does not provide an easy way to replace those expressions with a 
> method call that will not return “Undefined”.

Hi David,

I also include methods in 4D Write documents that do queries and other 
operations that do not return a value. I’ve never put raw 4D commands in a 4D 
Write expression, but many places are methods without $0 defined. 

I wonder if 4D Write Pro will do the same thing with methods that do not return 
a value? Have you tested this?

And I agree with you that 4D Write Pro should not make this change in how it 
works compared to the 4D Write Plugin. It makes no sense. It should changed to 
work as it did before. 

A bug report/feature request needs to be submitted so that they can change this 
behavior immediately and you can then get a hotfix or nightly build that has 
this change.

I’m guessing this was just an oversight in the 4D Write Pro implementation that 
the team never considered. It should be fixed. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Annoying square

2018-12-13 Thread Tim Nevels via 4D_Tech
Next time you see it, take a full screen picture of your desktop. That might 
help identify your “square”

Tim

Sent from my iPhone!

On Dec 13, 2018, at 2:00 PM, Carl Aage Wange wrote:

> When I am working on forms or programming, a small solid square often
> appears in a fixed position above the form or program I'm working on. It
> disappears in user mode. This annoying square only appears in 4D and has
> been doing so in several versions. Anyone having the same experience?
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

e: v16 Replacement for 4D-Pack command: 'AP Get table info'

2018-12-11 Thread Tim Nevels via 4D_Tech
On Dec 11, 2018, at 4:07 AM, Jörg Knebel wrote:

> BUT I don’t want to export the entire structure just to check how this 
> parameter is set for one table.
> 
> The command "EXPORT STRUCTURE” suggests that the information is stored in the 
> structure file.
> 
> So, how can the parameter “leave_tag_on_delete” extracted  WITHOUT exporting 
> the structure?

Why do you care if you use EXPORT STRUCTURE command? I think this command 
executes very quickly. Test it and find out. 

But If you are concerned about performance, just create your own cache. Run 
this command once at On Startup and use the XML DOM commands to parse the XML 
and build 2 arrays: table number longint array and leave tag on delete boolean 
array. Then you can write your own “AP_Get_table_info” method that uses these 
arrays. Fast and you get the same information as the plugin command. 

> Next question would be: How to change this parameter to make sure data is 
> really deleted in case of an emergency?

I think that is going to require a human to edit the structure manually. 

Tim

Sent from my iPad

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

Re: Form Scaling & Optimal Fonts...

2018-12-07 Thread Tim Nevels via 4D_Tech
On Dec 7, 2018, at 3:43 PM, Chip Scheide <4d_o...@pghrepository.org> wrote:

> to me - form scaling means:
> I hit a key (press a button, whatever) and the form enlarges -
> think of Command/Control + on a web page.
> think of the designer form control 50% 100% 200% 400%
> 
> I have implemented this in v13 by using Object Set Font Size(+/-1) on 
> everything on the form (list forms only).
> 
> the form (and all the objects get bigger, and stay in place relative to 
> each other (maybe not so much for the web, but mostly).
> 
> I do not think of form scaling as changing the monitor resolution from 
> 1600 x 1200 to 800 x600

Absolutely correct, 4D Form Scaling does not change monitor resolution. My 
human clients do that so they don’t have to wear glasses. :)

Robert is just looking for a quick — check that checkbox — to solve his 
problem. Form Scaling is really not that fix. While it may work for him and fix 
his issue, he is being into using a legacy feature and using it in a way it was 
never intended to be used. 

They way you are doing scaling is a good way, may be the preferred way to do 
it. But you can only go up a point or 2 before object start colliding and 
overlapping each other. 

Web page form scaling on macOS with the command-+ and command- - keys works 
great in Safari. Same for Text Edit or Pages. They have programmed it to work 
correctly.

Maybe some day 4D will implement this type of scaling. That would be sweet!

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Form Scaling & Optimal Fonts...

2018-12-07 Thread Tim Nevels via 4D_Tech
On Dec 7, 2018, at 10:32 AM, Robert ListMail wrote:

> I showed a scaled up version of a few forms, during a migration to v17 and 
> later I decided to move everything to automatic stylesheets as recommended by 
> Keisuke that this is best practices now. So, Jefferey, are you using 
> automatic stylesheets?  
> 
> What determines the font size of automatic style sheets?  In Windows 10, what 
> should that size be…?
> 
> I have a client that kinda liked the scaled up larger forms…. I moved away 
> from that because of the “best practices” suggestions here and because the 
> button graphics were also scaled and did not look as sharp. 

If you use “automatic” style sheet then every few years when Apple — or 
Microsoft — decides to change the default system font you are covered. Remember 
on the Macintosh System 1.0 the font was Chicago, then later it was Charcoal, 
then Lucida Grande then Helvetica Neue and now its Apple's new San Francisco. 

So if 4D had style sheet support back in v2 days and you set it to “Automatic”, 
then as you upgraded your 4D database to new versions of 4D and you upgraded 
your Mac to each macOS version, the font would have automatically changed 
without you doing anything. That’s what Automatic is all about. It also changes 
the size too. If you you want that, or NEED that, then use it. 

I don’t want or need that. I want to choose what font and size I want to use on 
forms. I don’t want it chosen for me by the operating system. The new font 
usually has different metrics so you might see truncation at the right or 
bottom or other issues. I want to control when the font changes in my 4D 
applications.

So I have created a set of style sheets and I use them EVERYWHERE. Repeat… 
EVERYWHERE. NEVER do I choose a font or size from the Property list. Choose a 
style sheet. If I need something different from the style sheets I have 
defined, I create a new one. This also removes  cross platform font selection 
issues I’ve had in the past.

Note that it is OK to add a style like bold, or italic or underline to a form 
object that has a style sheet associated with it.  Same for colors. That helps 
when you want to occasionally add italic or an underline or red color to 
something. 

I use style sheets for printed forms too. No problem with having 50+ style 
sheets defined. 4D can handle it. I might have 8 style sheets for a single 
report to cover all the different elements on that report. Different sizes, 
bold, etc. And this also makes printing reports work well cross platform. You 
choose “Helvetica” on macOS and “Arial” on Windows or whatever you want that 
looks good. You determine what looks good by printing it out and giving it the 
eye ball and making that decision. After all you are the designer and software 
architect, so act like it and make these decisions. :)

Regarding the size of fonts used on forms, that’s a decision you and your 
client must make. Each client will have different needs. I’ll give you 2 
examples:

I have one client that has no “old people” and everyone is “young”. So they 
like everything 11 point. Why? Because they want to pack as much as they can on 
the screen and everyone has no problem reading that size. So that’s what they 
get. I set the style sheets and I’m done.

Another client has a mix of old and young people. Some of the “old” people 
don’t have as good eye sight as when they were young. (I’m in that situation 
myself.) So the “old” people crank down their monitor resolution. I’ve seen 
some that have it set at the maximum low value so that the screen renders at 
1024x768!  

That’s a problem because my default minimum window size today is 1000x660. And 
on Windows with the Taskbar at the bottom taking up pixels and the window title 
bar taking up more, and the Windows MDI window title bar even more, a 1000x660 
window can’t open full size. Scroll bars appear. The typical user with a 
typical monitor today using the default resolution of the monitor and 100% 
setting on Windows has no problem. But these “i can’t see because I’m old so I 
need to blow up the monitor size” people complain that they have to scroll all 
the time. 

So the fix for this customer had 2 parts. First, I increased font size on the 
style sheets by 1 point. From 11 point to 12 point. Amazing how much difference 
a single point makes with today’s systems. Young people didn’t notice or care. 
Second was I had all the “old” people with 1024/786 monitor resolution increase 
their resolution to 1280x720 or more. Some people still complained that it was 
“too small to read” and the only answer for that is “for you it is, but for 
everyone else it is fine. A pair of glasses would easily fix this”. They go 
quiet when you say that because that's the whole reason for the problem. 
Vanity. They’ve never worn glasses and they don’t want to start. 

So I’d talk with you client and tell them you can set the font size to 18 point 
if they want. But the consequence is less on each 

Re: Publishing a DB on the WWW. Howto.

2018-12-04 Thread Tim Nevels via 4D_Tech
On Dec 4, 2018, at 2:00 PM, Pat Bensky wrote:

> We've been looking into ways to make it easy for our customers to build
> custom websites using data from our 4D app (CatBase). I'm quite interested
> in the Wix solution but haven't had time to properly look into it. Anybody
> tried this?
> 
> Basically, you can create a database on your Wix website and populate it by
> importing a csv file (AFAIK this is the only upload format currently
> supported). They also have an API which will probably offer much better
> opportunities for integration but I haven't looked into that yet.
> 
> Then you can build your website interface using their excellent tools - no
> coding required. Create interactive forms, edit the database, etc. So the
> 4D developer doesn't need to know more than the basics of web
> design/development and can focus on what they know best ... 4D coding :)
> And the end-user should be able to easily create their website or you could
> offer that as an additional service.
> 
> All theoretical of course. It's something I hope to find time to experiment
> with soon (a nice little Christmas holiday project, perhaps!).

Hi Pat,

I just did a Wix database for a friend and it is pretty good. Great development 
tools for the average guy. WYSIWYG for the most part. Has many features. Full 
mobile support so it will adapt to tablet or phone or Desktop. So that’s a big 
plus. Has may tools for the store for managing contacts and processing orders. 
Great integration if you are doing a shopping cart for credit card processing 
with Stripe and also easy PayPal. Lot of options for easy coupon support, and 
“it’s on sale 20% off” type things. 

Has a mini database of course, but I did no integration work. No export or 
import work or connecting to 4D. The project was just set up a website with a 
store for a friend that wanted it to look very, very nice and have full iPhone 
and iPad support. Wix satisfied all of that. 

You’ll find it a pleasure to use and very beautiful. Great iPhone app that lets 
you deal with “chat” from the website in real time if you want to offer that 
feature. Only thing is you can only do what Wix lets you do.  If they have a 
button for it, or a menu item for it, or an option for what you want, you can 
do it, and it’s easy. If you want to do something it doesn’t provide, it’s 
super hard or you just can’t. 

So keep that in mind. As a 4D developer sometimes that is a hard pill to 
swallow. We usually get our way and build whatever we want/need. With Wix you 
use their tool. It is a website creation for mere mortals, not hard-core 
developers. 

I would recommend you get a free Wix account and try it out over the holidays. 
Spend some hours building a site and see if you like it and it does what you 
want. It is super popular so there is a lot of help and examples on the web. 
You may find out how to do automate database integration. Someone may have 
already done the hard work and you can read how they did it can copy it. You 
can upgrade to the paid version later if it meets your needs.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: ORDA to get "record number" value

2018-11-28 Thread Tim Nevels via 4D_Tech
On Nov 28, 2018, at 1:27 PM, Christian Sakowski wrote:

> Oh… didn’t noticed this. Thanks for the hint.
> But anyways… i think he has the answer(s).

This thread is as bad as the 4D Forums thread. Nobody will give this guy a 
direct answer, so he can move on and get some real work done. 

Gianluca,

You cannot get the “Record Number” by using ORDA. So if you need the 4D record 
number, abandon using ORDA and go back to using the traditional 4D commands 
that do fully support Record Number. 

You may have a strong desire to use ORDA right now because it is new a great 
and all that. But in this particular case, you will not have success if you 
need Record Numbers.

Get your work done migrating your database to stop using Record Numbers. Once 
that is done, you can go back to using ORDA for database access.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Need to convert HTML page with table to JSON

2018-11-28 Thread Tim Nevels via 4D_Tech
On Nov 28, 2018, at 3:01 AM, Keisuke Miyakowrote:

> the web site you mentioned uses this file
> 
> https://github.com/abdmob/x2js
> 
> but the real challenge is to cajole HTML code that is not strictly XML

Good idea. I had not thought to try and do a "DOM Parse XML variable" on the 
web page source. I just tried it and it worked! This web page is super simple 
as it is from a medical instruments test device, so the DOM was easily loaded. 
Just basic HTML, some CSS and a little Javascript. 

Thanks for the idea. Now I can use 4D’s built in DOM XML commands to extract 
the data I need. Gonna be easy to make the JSON.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Need to convert HTML page with table to JSON

2018-11-27 Thread Tim Nevels via 4D_Tech
I have a very simple web page that contains a single table that I’d like to 
convert to JSON. 

I can grab the web page with the HTTP Get command. So that’s easy.

I found a website that will let me past that web page text and it will created 
exactly the JSON that I need — http://convertjson.com/html-table-to-json.htm — 
so I know it must be very easy to do this.

I’m looking for a way to do this locally without having to use a web page like 
this or some service. Seems like there should be some javascript code I could 
use to do this. Also did a little googling and it seems jquery may have a way 
to accomplish this. 

Here is a bit of the webpage table html:




ID
Well# and Configuration
Start Time
Result




1
#914922015-08-07 10:27:49-


2
#1014922015-08-07 10:26:29+


3
#714922015-08-06 12:10:19+




Here is the JSON I’d like to get returned:

[
 {
   "ID": 1,
   "Well# and Configuration": "#9 1492",
   "Start Time": "2015-08-07 10:27:49",
   "Result": "-"
 },
 {
   "ID": 2,
   "Well# and Configuration": "#10 1492",
   "Start Time": "2015-08-07 10:26:29",
   "Result": "+"
 },
 {
   "ID": 3,
   "Well# and Configuration": "#7 1492",
   "Start Time": "2015-08-06 12:10:19",
   "Result": "+"
 }
]

Anyone have some sample code they can share, or point me in the right direction 
on how to build something to do what I want to do? 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D Server automatically setting 'Reject New Connections' ?

2018-11-26 Thread Tim Nevels via 4D_Tech
On Nov 26, 2018, at 3:06 AM, Allan Udy wrote:

> Has anyone else seen 4D Server spontaneously 'dropping' 4D Client 
> connections, and automatically setting the 'Reject New Connections' 
> option in the server Administration window?
> 
> We've seen this with both v16 and v17. Usually when the DBA goes to 
> 'Accept New Connections' in the server admin window, the server app 
> (compiled and merged) will throw up its arms in horror and crash -  "4D 
> Server has stopped working.  Windows can check online for a solution.."
> 
> We'd really like to be able to solve this problem

I’ve seen this happen 1 time on a v17.0 HF1 4D Server application that has been 
running for several months now. One day I got a call from the client that 
people could no longer connect to 4D Server. Existing users were fine, just 
nobody new could connect. I checked the server and found the button had changed 
from “Reject New Connections” to “Accept New Connections”. Nobody clicked the 
button.

I clicked the button to switch it back to allow connections, but it did 
nothing. I tried to quit 4D Server and do a restart and it would no quit. I 
finally had to End Task to restart 4D Server. Then users were able to connect 
again.

So yes, this is a real issue and not just a fluke you are experiencing. 

I am assuming you are using the new network layer, right? My application is and 
I’m guessing it’s another bug/issue related to this. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Explorer bottom toolbar not displaying...

2018-11-23 Thread Tim Nevels via 4D_Tech
On Nov 22, 2018, at 8:09 AM, Chip Scheide <4d_o...@pghrepository.org> wrote:

> listbox columns etc are saved -- does this include list boxes that are 
> dynamically built?
> i.e. are simply empty place holders in the designer environment?

Hi Chip,

I do not know. I’ve always built list boxes with the form editor and using the 
Properties palette. 

My guess is no. Thinking like a programmer when it is time to load a form you 
grab the form definition from the structure and then deal with it. If you have 
a saved window bounds/geometry you apply that to the form definition you loaded 
and then let the “On Load” form method event run. That’s thinking from a 
programmer/software engineer point of view. 

You are gonna have to test it to know for sure.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Explorer bottom toolbar not displaying...

2018-11-21 Thread Tim Nevels via 4D_Tech
On Nov 21, 2018, at 7:48 PM, John DeSoi  wrote:

> I'm happy there is a simpler work-around than finding some obscure file to 
> delete. But it would be better if 4D just fixed the issue. If you use 
> multiple monitors and change configurations this is an ongoing issue. Other 
> Mac applications have no problems, but I'm often surprised by how 4D windows 
> end up. I try to remember to quit 4D before unplugging my external monitor 
> because of all the problems.

I agree John. It would be great if a 4D engineer that has multiple monitors and 
also a laptop were assigned the task of updating their code to be more 
defensive about where it opened windows. Checking the window rect to see if it 
will be fully displayed with the current monitor configuration, making sure 
windows don’t appear partially offscreen, etc. I’ve been doing this for years 
in my own “OpenWindow” method and it’s a lot of work, but it can be done. And 
there are complications to make it work well on both macOS and Windows.

But I am now abandoning using my OpenWindow method and I’m now using a new 
method called “OpenFormWindow” that relies on the “save geometry” option so 
that windows remember where the user positioned them and how they configured 
listbox columns, splitters, etc. 

It’s a great 4D feature that you can use by simply checking a checkbox for a 
form and using the “Open form window” command. They just need to add a bit more 
polish to it and then we can enjoy using it without these “edge case” problems. 
I can’t do the work I was doing with my OpenWindow method because now 4D is in 
full control of where to position a new window. I have to trust them that they 
will do a good job. Sometimes they let me down. :(

This secret command key will help my users when this situation occurs. I can 
now tell them to just hold down the shift key before they select a menu item. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Explorer bottom toolbar not displaying...

2018-11-21 Thread Tim Nevels via 4D_Tech
On Nov 21, 2018, at 2:00 PM, Garri Ogata wrote:

> Greetings,
> 
> Thanks for all the tips. I ended up using the shift key when opening the 
> explorer window. That was a nice quick fix.
> 
> And I've added the tech tip to my code base and ran it also.
> 
> Thanks again for the help.
> 
> And Happy T-Day to everyone.

Garri is back! Seems like a long time since I saw any posts from you on the 
iNUG.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Explorer bottom toolbar not displaying...

2018-11-21 Thread Tim Nevels via 4D_Tech
On Nov 21, 2018, at 2:00 PM, Keisuke Miyako wrote:

> or, just close the Explorer and bring it back while holding down the shift 
> key.
> 
> Open form window (...;*) window bounds are reset with the shift key.

Thanks so much for telling everyone about this keyboard fix. And I’m sure it’s 
probably documented somewhere with a single sentence that most of us never 
bothered to read. 

As least now we all know… when a 4D window opens in a stupid location, close it 
and then open it again with the shift key down to fix it. A simple, elegant 
solution. No more wandering to the preferences folder and deleting a file to 
fix it. 

Do we know what version this was implemented in?

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: V17 MSC Reports Orphaned Methods...

2018-11-17 Thread Tim Nevels via 4D_Tech
Hi Robert,

You worry too much. Orphaned methods are nothing to lose sleep over.  It’s just 
a 4D bug in how it handles deleting methods connected to objects.  It does a 
less than perfect job of handling this. Sometimes it does it right, sometimes 
it screws up. Been this way for years in untold number of 4D versions. 

My philosophy is that when I see references to orphaned methods I simply delete 
them and move on. I don’t even give it a second thought. 

There is a line from an old Chicago song “you learn to live with it... but I 
don’t want to” that really sums it up for me. :)

Tim

Sent from my iPad

On Nov 17, 2018, at 2:00 PM, Robert wrote:

> Actually I was using build 229490 but now I’m using the most recent (229707) 
> with the same behavior as previously reported.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Using 4D v17 Dynamic Forms for Custom Label Printed by Tim Nevels

2018-11-09 Thread Tim Nevels via 4D_Tech
On Nov 9, 2018, at 2:00 PM, Donna GALLIS wrote:

> Tim will share a developer tool that allows creating the JSON object that 
> describes a 4D form.
> With this tool you easily create or edit a form. The interface also includes 
> a “preview” option
> so that you can see what the form would look like without actually needing to 
> print it.

I will also talk a little about Tech Note 18-18_DynamicFormObjectDefinition 
that was recently released. It’s “4D Partners Only” at this time, so I can’t 
share it directly with you, but I think I can talk about what’s in it and why 
it’s good and if you are going to be doing any v17 Dynamic Forms work it will 
help you greatly. 

Also some comments about v17 R3 and the things it provides that greatly helps 
in doing Dynamic Forms work. 

I wish I had the tech note and v17 R3 when I did my work. I had to brute force, 
trial and error figure out how to to make things work. 

I’m currently only using Dynamic Forms for printing and that’s the example I’m 
showing in the 4D Method meeting. But all the same concepts apply to using 
Dynamic Forms for input and output forms and dialogs. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Forms Stop Receiving Certain Events

2018-11-09 Thread Tim Nevels via 4D_Tech
On Nov 9, 2018, at 9:47 AM, Chip Scheide wrote:

> Other then having added tables and/or fields, rolling back the 
> structure to a previous one (say yesterday) is simple and is not a 
> significant issue.
> 
> If you have added fields and/or tables then there can be issues, 
> however, I am not well versed in this part of a roll back. I know that 
> if you simply changed one field type to another, with no other change 
> to the tables, this type of change is also NOT an issue to roll back.

4D is very forgiving when dealing with a data file that does not exactly match 
a structure file. If the data file has fields in a table, and your structure 
file does not have those fields, as long as you don’t load and save a record in 
that table, the data in the fields is safe. 

As soon as you load a record from the data file, 4D will compare it to the 
structure definition for the table. Any fields not defined in the structure 
file are ignored. Any fields that have a different type (like Alpha in the data 
file and Longint in the structure file) will automatically be converted as best 
as 4D can to the type that the structure file defines. If you then SAVE RECORD 
that record back to the data file you get all these changes. Unknown field’s 
data is lost, different field types are written back to the data file based on 
the structure file type. 

As far as a table in the data file that is not defined in the structure file, 
it also survives. You can’t access the table because it does not exist in the 
structure file. But the data stays in the data file. It’s basically orphaned. 
But, if you were to take that same data file and open it up with another 
structure file that does have that table defined, then the data is still there 
and accessible again. 

That’s the basics. I don’t know of any other database system that implements 
data files, records and field type changes the way 4D does. It really is a 
beautiful thing when you have a system that is changing and you are moving 
around between different versions. The trade off to this “beautiful” system, is 
performance. It takes extra time with every record load to do the 
field-by-field comparison and data type conversion if necessary. But with the 
hardware of today, it’s really a non-issue. No noticeable performance penalty.  
In the 4D world, any performance tradeoff is easily accepted for the benefits 
it can provide.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Forms Stop Receiving Certain Events

2018-11-09 Thread Tim Nevels via 4D_Tech
On Nov 9, 2018, at 9:47 AM, Sandor Szatmari wrote:

> I’m glad to learn that.  However, the way our backups are configured I only 
> see 4BL (the log) and and 4BK (the data) files.  Looks like I need to learn 
> more about the backup configuration process.  What is the recommended way to 
> configure backups so that I would have access to these individual files?  Or, 
> are they accessible individually during the restore process from the 4BK 
> file?  Also, if there is any good reading on this you could point me too, 
> It’d be appreciated.  Thanks for your response, very helpful indeed!

There is a checkbox in Backup -> Configuration called “Structure File”. Check 
that box and it will backup the .4DB file. You might also consider adding to 
the “Attachments” area the .4Dindy file, “Components” folder, “Plugins” folder, 
and “Resources” folder to the backup. That gives you a complete snapshot of 
what it takes to restore a 4D structure file. You need all these pieces.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D Authentication Strategy...

2018-11-09 Thread Tim Nevels via 4D_Tech
On Nov 9, 2018, at 7:34 AM, Robert ListMail wrote:

> I’ve inherited many 4D databases over the years and some have a custom 
> password system and some use the built in 4D system or a hybrid approach. I 
> know that 4D also allows authentication via Active Directory (single sign on) 
> but I’ve not implemented that. So, I’m looking to enhance a few legacy 
> systems and wanted to consider my authentication strategy... I’ll probably 
> want to keep the users and groups in the data file so that the data would 
> always be valid after structure changes and to store more data about each 
> user. Also, what if users could register on the system and use the system to 
> reset passwords and such just like a public web site, this would lighten the 
> load for the admin... I know this was all the rage 20 years ago. So, have you 
> rolled your own password system in 4D? What are the key benefits in your 
> situation?

I have a table called [Users] that stores authorized users of the database. In 
the past it was the sole authentication system. Didn’t use 4D’s password system 
because it is structure based and installing new version of the structure 
required extra work to reload the 4D password system. 

But I sorely missed the “Current user” command. I wanted to be able to use it 
in Triggers. I tried several ways to pass this information into triggers and 
all were cumbersome and prone to failure in certain situations whereas the 
“Current user” command was so easy and always worked. Guaranteed.

So I started using what I call a dynamically built 4D password system. I still 
use the [Users] table to lookup if a person is allowed into the database but 
once I know the user is allowed in I do this:

GET USER LIST($userName_at;$userNumber_al)
$i:=Find in array($userName_at;$theUserName_t)
If ($i<1)  // 4D user does not exist, so create it
$i:=-2  // created by the Administrator user
$i:=Set user 
properties($i;$theUserName_t;"";$password_t;0;!00-00-00!;$groups_al)
// pause for 1 second to work around -9978 Bad user password error 
   DELAY PROCESS(Current process;60) 
   CHANGE CURRENT USER($theUserName_t;”**")
End if 

That makes sure there is a 4D password system user — with the name I want — is 
available. If not, I create it and then CHANGE CURRENT USER to that user so 
that “Current user” command now works. That’s the primary reason for me to do 
all of this. 

It is simple and does not require any special saving and loading of the 4D 
password system when the database stops or starts. 

I’ve now started moving away from even storing passwords in the [Users] table 
and doing all authentication with the 4D SSO Active Directory integration. It’s 
so simple to use once you clear away the debris surrounding it. Here’s my 
implementation and why I do it this way.

First, you must be using Windows 64bit 4D Server v15 R5 or newer and have New 
Network Layer turned on. Of course you need all your users to authenticate to 
Active Directory using the default NTLM protocol, but it does support Kerberos 
if you do some extra setup work. Once you have all that in place, you just 
check the “Authentication of user with domain server” checkbox on 4D Server and 
setup is done. It is ready to use. 

In your [Users] table add a field for the “Windows login name” that a person 
uses. Windows guarantees it is unique for a domain. If you want to support 
multiple domains you can do that too by adding a “domain” field to the table. 
To allow someone to access the database, create a [Users] record with the name 
you want reported by “Current user” and the Windows login name that person will 
be using. That’s your lookup key.

In "On Startup" you use the “Current client authentication” command to retrieve 
the Windows login name that was verified and authenticated with Active 
Directory. Use that to query the [Users] table and if you find a match, let the 
user in. Authentication is done, no password needed, no checking of any 
password, you are doing SSO and you let Windows control the original sign on to 
the network and you trust that. 

Don’t use “Current system user” command. This returns the same login name, but 
it it not guaranteed to be authenticated to Active Directory. 

Example: A person could bring in a laptop from home, create a local user 
account on that machine with a matching Windows login name, sign in to that 
machine with that login and then plug that machine into the corporate network. 
They get a DHCP assigned IP address. Then they get a copy of 4D Client, put it 
on the machine and launch it. Bang, they are into the database. You can only 
trust “Current client authentication” to give you the Windows login name that 
has been reliably authenticated. 

You don’t really need to store a password in the [Users] table. You are going 
to let Windows control authentication. Don’t be afraid of this, that’s how it 
is supposed to work.

I do still have a password field in my [Users] 

Re: versioning in 4D

2018-11-08 Thread Tim Nevels via 4D_Tech
On Nov 8, 2018, at 1:31 PM, Charles Miller  wrote:

> Does anyone know when I assign a version to a build of server, where that
> data is stored and where that might be so I can manually modify that number
> to do some testing

If you are talking about the “Product Version” that is displayed in the 
“Details” tab when you open the “Properties” window for the .exe file on 
Windows, you can set that when you build the 4D Server application.

https://www.dropbox.com/s/kcsnrk6x672oksv/Screen%20Shot%202018-11-08%20at%201.54.02%20PM.PNG?dl=0

Do this with some XML build keys:

$xPath_t:="/Preferences4D/BuildApp/Versioning/Common/CommonVersion"
$value_t:=$newVersion_t
DOM SET XML ELEMENT VALUE($buildAppXMLref_t;$xPath_t;$value_t)

$xPath_t:="/Preferences4D/BuildApp/Versioning/Common/CommonCopyright"
$value_t:=$newVersion_t+" ©1998-"+String(Year of(Current date))+" Innovative 
Solutions & The Midland Group"
DOM SET XML ELEMENT VALUE($buildAppXMLref_t;$xPath_t;$value_t)

If you are talking about the build number of 4D retrieved with the “Application 
version” command and the build number option, it always returns “0” for a built 
application. The docs tell you this. No way to natively know what 4D build was 
used when you built your merged with 4D Server application, or merged with 4D 
Volume Desktop 4D Client application. You have to store this info somewhere 
yourself and not use the “Application version” command.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Picture Buttons--Benefits of Picture Library

2018-11-07 Thread Tim Nevels via 4D_Tech
On Nov 7, 2018, at 2:00 PM, Robert ListMail wrote:

> I’ve been working with button images which the picture library... While doing 
> this I noticed one nice feature of the picture library. When dragging button 
> graphics from the picture library to a form (assuming that the picture 
> properties are defined as a split object), the destination object is assumed 
> to be a picture button and is sized properly (48x48). When I do this with the 
> resource folder as a source, I get just the graphic (not a button) and I have 
> to muck with the sizing properties since this apparently cannot be set via 
> the resource tab of the toolbox. Any suggestions about this subject?  What’s 
> the consensus about where to store these resources? I think 4D is suggesting 
> resources (the external resource folder) is the future but clearly there are 
> some picture folder benefits. What do you use?

Use what you like and what works best for you. That’s the real answer. 

I love Picture Library and use it for many reasons. Faster, easier, less chance 
of breakage when installing new versions and moving structures around. 

Also no need to do “duplicate resources locally” of every picture in 
“Resources” whether the user ever needs them or not. Picture Library works just 
like forms and methods. You only get what you need when you need it, and only 
if the locally cached version needs to be updated. That’s a big advantage to 
me. Why copy a 50MB “Resources” folder of images when 4D Client starts up?  The 
client may never need 49MB of those images. 

Picture Library is not going anywhere. There’s no talk of deprecation as far as 
I know. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Cannot Dismiss Form When Compiled... (Robert ListMail)

2018-11-07 Thread Tim Nevels via 4D_Tech
On Nov 7, 2018, at 2:00 PM, 4d_tech-requ...@lists.4d.com wrote:

> While upgrading a v11 structure to v17R3 (Windows), I’ve noticed that the 
> form (“PCDisplay”) loaded via Modify Selection cannot be dismissed when the 
> application is compiled. Can you spot the problem?
> 
> //
> DIALOG([DocketFile];"PullCaseSearch")
> If (OK=1)
>   QUERY([DocketFile];[DocketFile]DocketSite=vSite;*)
>   QUERY([DocketFile];[DocketFile]DocketDate=vDate)
>   If (Records in selection([DocketFile])>0)
>   RELATE ONE SELECTION([DocketFile];[IntakeFile])
> table([IntakeFile]))
>   NEXT RECORD([DocketFile])
>   ORDER BY([IntakeFile];[IntakeFile]CaseNo;>)
>   FORM SET OUTPUT([IntakeFile];"PCDisplay")
>   FORM SET INPUT([IntakeFile];"TestIntake")
>   MODIFY SELECTION([IntakeFile];*)
>   Else 
>   ALERT("No cases found for that docket.")
>   End if 
> End if 
> UNLOAD RECORD([IntakeFile])
> //

Hi Robert,

Is there an “Open window” company anywhere to be found, or is this all running 
in the default 4D splash screen window? That could be the issue. Need to stop 
using that window and process and start creating new processes and doing 
explicit “Open window” commands in the new processes. That’s the new 4D way. 
The single-window-never-open-a-window way is super legacy and is being left 
behind rapidly by 4D engineering. My opinion.

When you say “dismissed”, you mean the MODIFY SELECTION part disappears and you 
return back to whatever was there before? In the past you had to issue a 
“CANCEL” command from a button or somewhere to make MODIFY SELECTION go away.

Last possibility is to not use v17 R3. Drop back to v17.0 and see if it works 
like it did in v11. Could be v17 R series changes has killed this. Might have 
to go even farther back to v16 or v15 to keep this old legacy code functioning.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Backing up a VM - is it dangerous ?

2018-11-05 Thread Tim Nevels via 4D_Tech
On Nov 5, 2018, at 2:00 PM, Peter Jakobsson wrote:

> Many thanks for the useful replies.
> 
> I’ve contacted the IT contractor to try to negotiate a new backup strategy.
> 
> Hopefully it will be less of a sweat than the China trade talks :-)

Peter,

If you just enable 4D Backup you should be find as long as you have an idea 
when IT is doing the backup of your 4D Server machine. 

As you know, 4D Backup will make a guaranteed good copy of your live, running 
4D Server data file. So when IT does a backup of the machine they will backup 
the 4D Backup file. Only issue is if at the exact time 4D Backup is running 
they run the backup the copy of the backup file may corrupted. But if you know 
when they are doing the backup, just schedule 4D Backup to not run near that 
time. 

I had been doing this with one of my clients for many years. They are running a 
VM that 4D Server runs on. IT told me they are doing a snapshot every night on 
that machine at 3am. So I just set 4D Backup to run at 2am. Been working great.

Now that client has moved to v17 and I’ve got Volume Shadow Support running on 
4D Server. So any snapshots they do will now guarantee the data file is valid 
if the snapshot is restored. Still running 4D Backup, but now IT thinks 4D is a 
real, first class VM citizen since it has VSS. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Help->v11 to v17 Upgrade or New?

2018-10-23 Thread Tim Nevels via 4D_Tech
On Oct 23, 2018, at 2:00 PM, Tom Benedict wrote:

> Dani Beaubien writes:
>> 
>> I use the external git client for diffs against historical commits and I use 
>> the
>> Code Analysis component for diffs between what is in the 4D structure
>> compares against the last export to the external folder.
> 
> We did a similar thing based on Thomas Maul's MethodHistory component. We 
> added a UI and integrated it into our semi-automated build/version tracking 
> process. Compare method versions on screen filtered by date/version.
> 
>> Works quite well. Definitely a few extra steps but benefits to be able to go 
>> back
>> in time and see the change history tied to code commit is amazingly useful.
> 
> We use it for pre-release code review as well as post-release 
> troubleshooting, if needed. It helped improve code quality on an 8 developer 
> team.

I did a similar thing. I took Thomas Maul’s component and then customized it to 
suit my needs. I basically wanted to have a “Show History” option available in 
any open method window in Design. Accomplished that with a macro that calls a 
method to display a window with the current version of the method and the 
previous version of the method diff'd. It uses a JSON library to do the diff. 
Also a dropdown menu to select older versions of the method to compare and a 
“Copy” button to bring back older versions. 

I decide when I want to take a “snapshot” of the database and save the current 
version of each method. I usually do this just before I build and deploy a new 
version. But I can also save a version of any method at any time I want with 
another macro call from an open method window.

At first I built this thing to create thousands of text files of all the 
methods in hundreds folders all organized so that I could use GitHub to store 
the method text and do the diffs and all the things everyone says is so 
fantastic and cool and just must be done if you want to be a REAL developer.

I gave up on that because it is was becoming a large amount of work automating 
all of that and testing it and getting it all working and you still have to 
wander around on the website or with separate diff tools to get what I wanted 
which was “open a window showing the current version of a method and let me 
compare and diff it against previous versions.”

I ended up with a very simple to use and maintain system that uses a 4D 
external database. Yeah, remember those things that’s been around for many 
versions that you can only access with SQL? Turned out it was so much easier to 
deal with, control and maintain than the whole GitHub thing. And it’s easy to 
add indexes to these external databases via SQL code so look ups are super 
fast. 

This also works with 4D Team Developer so that a group of developers I work 
with can use it from 4D Client. Same code works on 4D or 4D Client. Everything 
is stored on 4D Server in a single folder named “Method History” that contains 
3 files: Method History.4DB, Method History.4DD and Method History.Match. 

So before you decide that you have to do GitHub because that’s what everyone 
says you should do, consider what you really want and really need and weigh 
that against how much work it’s going to take to accomplish that. Of course I 
know some love to spend tons of time building super complex things because it 
gives them great satisfaction, but I’ve got other more fun and interesting 
things to do with my spare time. :)

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Icon & Picture Button Sources...

2018-10-23 Thread Tim Nevels via 4D_Tech
On Oct 23, 2018, at 2:00 PM, Robert wrote:

> As I recall, Tim Nevels mentioned a favorite picture button resource which 
> has escaped me... Tim, can you refresh my memory...?

https://glyphlab.com

You have to pay money, but for me it was worth it as I paid once and got a 
library of high quality images I’ve been using for years in all my projects.  
For me, well worth the one time price.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Built Server—Best Practices...

2018-10-16 Thread Tim Nevels via 4D_Tech
On Oct 16, 2018, at 2:00 PM, Robert wrote:

> I recently started to use built client/server more often since I inherited a 
> client that was already doing that. I was told by another developer that when 
> doing a structure change that I can simply swap the .4DC file and I’m done. 
> 4D TS suggests that this is not wise and that I should probably use rsync or 
> simply supply the whole built client each time. So, what do you do?

Hi Robert,

The “Best Practice” is to do what 4D TS says — update the complete package and 
don’t fool with individual files. But I — and many others — live dangerously 
because we think we know what we are doing, are willing to suffer the 
consequences when we screw up and want to do a faster manual update of an 
application. 

If you know that all you have done since the last deploy is edit the .4DB in 
the Design environment adding and editing forms, methods and things in the Tool 
Box (excluding Resources) and the structure, then the only thing that will 
change when you do a build is the .4DC and .4DIndy. I have one client that I do 
this for constantly. Done it probably over 50 times over the years. Never a 
problem that I didn’t create by not following the above rule. 

I have another client that I NEVER do this for. I’ve got a very easy to use 
auto update system in place and it is actually easier and faster to just 
replace the complete application package with each update. (If I ever find the 
time and get motivated, I’ll create a system to do this for the first client.)

> Also, when building the built client/server do you use the 4D commands with 
> the XML project or do you use the GUI?
> 
> I was happily using the GUI and editing the engined server link file in the 
> client such that it points to the correctly deployed server as it defaults to 
> the local development server…..  However, I found another issue, the backup 
> settings and maybe the cache settings were not set on the deployed server 
> deliverable and I set these manually. How do you manage these settings?

I use a hybrid system. I first use the Build dialog to set everything that I 
can and then do a test build to prove that it works. Then I have a “Build 
Application” method that takes the BuildApp.xml file from the dialog and adds 
all the custom build keys that I need to do a deployment build. 

For backup settings, you have to find a way to copy the current “Backup.xml” 
file from the installed version to the new version. One way is to script that 
during the installation of the new version. Might be a way to automate creating 
this file during a build, but you would have to communicate with the running 4D 
Server somehow and extract the needed information and then manually build 
Backup.xml so that it was identical to the one on the server. Put that in the 
right location in the new version. 

Backup settings and the “Log” folder is one of the reasons why for the one 
client I just install the .4DC and .4Dindy. Then I don’t have to worry about 
copying these things from the old version to the new version. 

For cache settings just turn on the Database Settings -> User Settings on the 
machine and it takes care of itself.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D field type Date and json to selection big question

2018-10-13 Thread Tim Nevels via 4D_Tech
On Oct 13, 2018, at 2:00 PM, Andrea Angeli wrote:

> I found a problem receiving a json array in a field of type date with no 
> time, but also with time no 00:00:00.000Z.
> So I wanted to share this problem in order to understand what I should aspect 
> from 4D.
> 
> I know that this is a big question, but what do you think 4D should 
> interpretate the first two json objects in my below string example in a field 
> of type Date?
> 
> Below a json string example:
> 
> [{“Date”: “2018-10-12”}, {“Date”: “2018-10-12T14:00:00.000Z”}, {“Date”: 
> “2018-10-12T00:00:00.000Z”}]
> 
> Here a simpe 4D code to test:
> 
> $t_json:="[{"+Char(Double quote)+"Date"+Char(Double quote)+":"+Char(Double 
> quote)\
> +"2018-10-12"+Char(Double quote)+"},"+\
> "{"+Char(Double quote)+"Date"+Char(Double quote)+":"+Char(Double quote)\
> +"2018-10-12T14:00:00.000Z"+Char(Double quote)+"},"+\
> "{"+Char(Double quote)+"Date"+Char(Double quote)+":"+Char(Double quote)\
> +"2018-10-12T00:00:00.000Z"+Char(Double quote)+\
> "}]"
> 
> JSON TO SELECTION([Reservations];$t_json)
> 
> All field records are filled with date 10-12-2018 (MM-DD-) so the field 
> Date looks like I aspected, but if I want to search for that date:
> 
> Query([Reservation];[Reservetions]Date=!2018-10-12!)
> 
> I’m going to find only one record. The last json object with Date = 
> “2018-10-12T00:00:00.000Z”.
> 
> If I write a query like this:
> 
> Query([Reservation];[Reservetions]Date>=!2018-10-12!*)
> Query([Reservation];&;[Reservetions]Date<=!2018-10-12!)
> 
> I will find all records in the json string.
> 
> I have to suppose that a field of type date is a data time field.
> 
> Anyone got this problem?
> 
> Of course the date in the other json objects are not correct, but 4D received 
> the value and display the correct date for me (10-12-2018) so I’m going to 
> aspect to find all 3 records with the first query.
> 
> Obviously now I correct the json date in the json string in order to fix the 
> problem, but if someone is going to send me a big json with dates as the 
> first two json objects I will get wrong dates in all records on my 4D data 
> file that will be very hard to catch.
> 
> If the json value is wrong like text or number the date on the field will be 
> 00-00-00 that is ok for me. It’s mean that the date format is wrong.
> 
> json to selection is a great feature in 4D, I can get data from a json string 
> very quickly but in this case I need to check all properties that should fill 
> date fields and correct the time values if not T00:00:00.000Z.

The first thought I had is that it has something to do with GMT or UTC time, 
and how JSON TO SELECTION is handling that. The first date has not time 
component. The other 2 dates have a time component and that ends in “Z” which 
is telling 4D that the date and time are in “zulu” format or expressed as a GMT 
date and time. 

I noticed in your post signature you are in Rome, Italy. So you are not in GMT 
0 zone are you? Could it be that 4D is trying to be “smart” and adjust the date 
to the day before since the time is midnight? 

If you remove the “Z” from the time and run it again, do you get the same 
results? No “Z” indicates the date and time are express in your local time. 

After saying all that, the real issue is with a 4D “Date” field. In the past 
this was a value stored internally as a month integer, day integer and a year 
integer. That’s it. That was long before 4D tried to handle date time stamps 
and GMT time conversion things. 

It makes me wonder if the Date field is now more than just 3 integer values. If 
there is also something else stored that is causing this issue. Like maybe a 
GMT offset value. 

I can think of only 3 people that might know this low level detail of how the 
4D data file “date” field is designed and how 4D handles GMT date time values:: 
Miyako, JPR and Thomas Maul. Maybe one of them will see this post and be able 
to shed some light on what might be happening.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Defining and documenting Objects

2018-10-11 Thread Tim Nevels via 4D_Tech
On Oct 11, 2018, at 9:37 AM, Peter Jakobsson wrote:

> I think I might happily pay the price of recreating the variable table for 
> every process (since I never noticed any adverse effect of that) and use 
> naming conventions to avoid conflicts to get those features ! ;)
> 
> The original selling point of 4D was that it was stateful and that 
> statefullness is what gave us massive productivity gains. Lower level 
> languages like the Microsoft developer platforms, Delphi and even 
> Javascript/Python type environments had the versatility but you had to pay 
> the price in coding according to the classic, stateless styles. 4D is now 
> allowing us to do stuff you could do in these languages but there’s a great 
> big banana skin potentially associated with that transition which is 
> productivity. For example when I started building widgets in 4D, they could 
> be “very nice” but my productivity absolutely plummeted since you need to 
> spend most of the time on designing plumbing systems, event models and custom 
> data structures instead of solving business problems which have traditionally 
> been the 4D developer’s domain.
> 
> Just a thought.
> 
> Sometimes it’s difficult to tell novelty value and practical value apart. 
> (Well it is for me at least :-) )

I agree with Peter that sometimes it just makes sense and is much less of a 
hassle to use a process variable, or an interprocess variable. I know exactly 
how they work and their limitations. And I know the benefits of using them and 
when it could cause “issues” in what I’m building. Taking all those 
considerations into account I make the decision to use them or not. No regrets. 
Do the work and move on.

I know some developers will say “yeah, but them damn process variables use 
memory, precious memory”. Or they might say “it takes time, precious micro 
seconds of time, to instantiate the process variable table for each new 
process”. OK. 

So you are in an environment where you have to worry about a few megabytes of 
extra memory being used? You sure about that? Every machine any of my 4D 
databases currently run on has at least 8,000MB of memory to use. I really 
don’t care if I were to “waste” even 20MB. So I disregard the wasting memory 
argument in most situations.

And as for wasting time, we don’t even need to go there with the massive power 
current hardware has. 

If you want to talk about wasting time and memory, consider the “hard core” 
developer that believes in “functionalizing” their code and keeping methods 
very small and with limited scope. So they literally have 10,000+ methods to 
work with. And the call stack to perform an operation may be 10+ levels deep. 
That’s 10 stack frames of memory and 10 method calls to build up and tear down 
and memory movement to pass parameters, etc. These developers think this is a 
good waste of memory and time. Maybe it is, maybe it isn’t. The point I’m 
making is nobody is noticing that this is faster or slower with today’s 
hardware. 

We ain’t running on 25Mhz 68040 processors with 4MB of RAM any longer. (Thank 
God!) So let’s just focus on getting the work done as efficiently as we can and 
be as productive as we can. Use the tools 4D provides and the ones that make 
you the most productive. That’s my approach. Get the work done, bill the 
customer a very reasonable amount, and move on. For me that has resulted in 
many years of happy clients and repeat business. 

My philosophy on new 4D features is that it is just another tool for my 
toolbox. That is all. The new features are not necessarily “better” than doing 
it the “old way”.

I can remember back in the 4D v2 days when there was only one way to do many 
things in 4D. No choices. I’m so happy that now we have so many choices and 
ways to do things.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Volume shadow copy v17

2018-10-10 Thread Tim Nevels via 4D_Tech
On Oct 10, 2018, at 1:48 PM, Chuck Miller wrote:

> Has anyone implemented this feature and tested to make sure it works as 
> advertised.

Hi Chuck,

I’ve got it implemented on one v17 application. Easy to setup. Just launch 4D 
Server as Administrator and 4D creates a Windows Service called “VSS {database 
name}. From then on it’s all low level, hidden magic to me.

I don’t know how you would easily test it to prove it works. A test would be 
rather complicated to even set up.

I guess you would have rig up some kind of environment where 4D Server was 
doing a giant cache flush that took many seconds, and just as that is happening 
you force the VM to take a snapshot. Then maybe you crash 4D Server? 

Then you would have to restore the snapshot and do some kind of datafile audit 
to see if any data was lost and also do an MSC to ensure no data file damage. 
Just guessing. 

Seems like conducting a test of this super low level feature that also 
integrates with the VM snapshot feature would be super hard to setup and then 
prove that it worked. 

You might have to just depend on 4D doing it right and that does work. That’s 
what I’m doing. But maybe I’m a little too trusting. :)

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Notes on converting pictures to v17

2018-10-08 Thread Tim Nevels via 4D_Tech
On Oct 8, 2018, at 11:28 AM, 4d_tech-requ...@lists.4d.com wrote:

> Unexpected discovery - the picture library is still a useful thing!

This is so true. I’m still a big user and believer in the Picture Library. 
There are two big benefits for me:

1. If you are updating your 4D application often and using images on forms, 
it’s convenient to not have to worry about adding and updating image files in 
the Resources folder when you deploy the update. Picture Library is stored in 
the .4DB and .4DC file so you know every image referenced will always be found. 
Just copy the new .4DC and .4DIndy files and you have deployed your application 
update. 

2. If your application is running under 4D Server your 4D Client users benefit 
from the built in 4D Client “download only what I need when I need it” 
architecture. If you use the Resources folder to store all images, and that 
group of images is 300MB in size, 4D Client must download the entire 300MB 
Resources folder at startup when you deploy a new version of your application. 
Could be a a noticeable delay. 

Picture Library works just like methods and forms. Using the Picture Library, 
when an image is needed, 4D Client checks its locally cached resource file to 
see if it exists, if not it download that single image. Not all 300MB of 
images. And if 290MB of images are never needed or used by a particular client 
they never have to download them. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: v13 - Relate One Selection issue

2018-10-02 Thread Tim Nevels via 4D_Tech
On Oct 2, 2018, at 2:00 PM, Chip Scheide wrote:

> given this table configuration
> 
> Animal <-- Animal_Sample_Link ---> Samples
> 
> if there is at least 1 [Sample_Animal_Link] record shouldn't the 
> following code load the animal record(s)?
> 
> QUERY([Sample_Animal_Link];[Sample_Animal_Link]Sample_ID=[Samples]Sample_ID)
> RELATE ONE SELECTION([Sample_Animal_Link];[Animal])
> 
> I ask because it is not, even after a restart of 4D

Four thoughts came to mind:

1. index damage so the query or relation is failing

2. Could there be other relations that 4D could go through to get from 
Sample_Animal_Link to Animal? Maybe 4D picked another set of relations to 
follow to get from here to there. Result is wrong selection of records.

3. Are you running this code from a button or a menu item while a MODIFY 
SELECTION or DISPLAY SELECTION is running? Sometimes 4D will not do certain 
relational things because it can “break” the MODIFY SELECTION or DISPLAY 
SELECTION if any of the tables in question are involved.

4. If you do a  QUERY or QUERY WITH ARRAY instead of a RELATE ONE SELECTION, do 
you get the expected selection of records? If so then see #2 or #3 above. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Creating a form object to use as dynamic form

2018-09-24 Thread Tim Nevels via 4D_Tech
On Sep 24, 2018, at 2:00 PM, Rudy Mortier wrote:

> I can’t figure out how to do this … 
> 
> Using a dynamic form, I am trying to build a generic list of records to 
> display to the user and to allow him to select 1 record.
> 
> I used the example from the tech note on how to create a dynamic form that 
> shows a listbox.
> 
> To build this $form object variable, the commands New object and others are 
> used.
> 
> This listbox object is added to the $page object in the $form object, which 
> will be used in the DIALOG command.
> 
> $obj:=New object("type";"listbox";"listboxType";"collection";\ 
> "dataSource";$colName;"left";0;"top";0;"width";$width+15;"height";$height)
> 
> $page:=New object("objects";New object("myListBox";$obj)) $form:=New 
> object(“pages";New collection(Null;$page))
> 
> $form:=New object("windowTitle";"Select a 
> Map:";"windowMinWidth";500;"windowMinHeight";300;"pages";New 
> collection(Null;$page))
> 
> Now, this dynamic form only shows a listbox, and I want to add a button to 
> the form. I assume this button object has to be added to the ‘Objects’ object 
> in $page.
> 
> But, how do I do that? I tried object arrays and collections, but neither of 
> them produces the correct result. 

The new Dynamic Forms feature in v17 is new and documentation is very limited, 
as you already know. Example code is even more limited.  It takes a lot of 
trial and error to get it to work. I’ve spent hours getting things to work for 
my little project. And some things I’ve still not been able to figure out. 
Example: how to set the color of a line or a rectangle. 

What is desperately needed is the ability to dump a 4D form created in the Form 
Editor to JSON. Then you would be able to convert an existing form to a dynamic 
form and you would have example code to understand what is needed to make that 
button or configure that listbox to work the way you want.  Hoping that 
command/feature will be released in a v17 R.

I’ve done some work with Dynamic Forms and here are some tips/info on building 
them:

You have to create a starter object for the form. Once that form object is 
created, you can then add more object to it for each item on the form. Here is 
sample code that will create that starter object

$formObject_o:=New object(\
   "markerHeader";0;\
   "markerBody";72;\
   "method";"label_SetObjectFontSize";\
   "pages";New collection(\
   Null;\
   New object(\
   "objects";New object)))

You don’t really  need “markerHeader” or “markerBody” for a display form, but I 
need them because I’m building forms that are used for printing. 

Next you need to add objects to “pages” collection. Page zero is “Null” in my 
example, I’ll add objects to Page 1.

Here is code to add a rectangle to Page 1:

$object_o:=New object(\
   "type";"rectangle";\
   "fill";"transparent";\
   "strokeWidth";1;\
   "left";10;\
   "top";10;\
   "width";100;\
   "height";100)

$objectName_t:=“myRectangle”
OB SET($formObject_o.pages[1].objects;$objectName_t;$object_o)

Here is code for an object that is a “input” variable. In this case it is not 
enterable as I’m using it for printing.

myVariable_t:=“some value to display”

$object_o:=New object(\
   "type";"input";\
   "dataSource”;”myVariable_t";\
   "dataSourceTypeHint";"text";\
   "enterable";False;\
   "borderStyle";"none";\
   "fill";"transparent";\
   "textAlign";"left";\
   "left”;20;\
   "top”;20;\
   "width";200;\
   "height";11;\
   "fontFamily";"Arial";\
   "fontSize";9;\
   "fontWeight";"Bold”)

$objectName_t:=“myVariable”
OB SET($formObject_o.pages[1].objects;$objectName_t;$object_o)

Finally, here is code to add a button to a form:

$object_o:=New object(\
   "type”;"button";\
   “text”;"OK";\
   “action”;”Cancel";\
   "left";100;\
   "top";100;\
   "width”;70;\
   "height”;20)

$objectName_t:=“myButton”
OB SET($formObject_o.pages[1].objects;$objectName_t;$object_o)

As you can see dot notation comes in very handy when working with Dynamic 
Forms. Each object you add to a page needs a unique name. You decide what  that 
name is.

Also property names are case sensitive, and even some property values are case 
sensitive. Using the wrong case will not cause an error, but the object will 
just not work. So read the docs and if it says that a “type” value is “button” 
then don’t try “Button” because it may not work. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: PDF generation on Windows - Latest Thinking

2018-09-12 Thread Tim Nevels via 4D_Tech
On Sep 12, 2018, at 2:00 PM, Kirk Brooks wrote:

> Win10 has a native PDF print engine like MacOS does. You can use it.
> I don't think PDFCreator 1.7 whatever will even run on Win10 (but you
> probably found that out).

PDF Creator 1.7 works just fine on Windows 10. No problems. And it has many 
more configuration options than the built in Window 10 PDF driver. And it does 
not have a nuisance bug the Windows 10 driver has (see below). Now you have a 
choice. 

But you MUST use PDF Creator 1.7 version. Version 2.x or 3.x absolutely will 
not work with 4D. So when you install version 1.7 be sure to turn off “check 
for updates” otherwise your users will get nagged to update — and when they do 
you’ll get a call that PDF printing has stopped working. You have been warned.

My advice is if you don’t need any of the configuration options of PDF Creator, 
dump it and go with the Windows 10 PDF driver so there is nothing to install. 

Also be aware that PDFs created by the Windows 10 PDF driver are much larger 
than the exact same PDF created on macOS or with PDF Creator. macOS makes the 
smallest PDFs of all 3. So if size matters, avoid Windows 10 PDF driver.

One critical issue/bug with the Windows 10 PDF driver is that it will fail to 
work if there is a comma “,” anywhere in the file path — folder name or file 
name — of where to save the PDF. Verified, confirmed and a big PITA for many as 
can be seen on the web via Google search. Hope Microsoft will fix this someday.

Example: you have a folder with the name “Nevels, Tim” that contains documents 
for me. Impossible to use Windows 10 PDF driver to create a PDF inside this 
folder. The comma kills it. And yes, commas are totally valid characters in 
file names and folder names on Windows and macOS. 

The workaround I implemented was to check the file path and if there is a 
comma, create the PDF in a temp directory on the drive first. Once the PDF is 
created, use MOVE DOCUMENT to place it in the “Nevels, Tim” folder. MOVE 
DOCUMENT has no problem with comma’s in file paths.

As you can probably guess I’ve done way too much PDF creation work using all 3 
of these solutions. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: PDF generation on Windows - Latest Thinking

2018-09-12 Thread Tim Nevels via 4D_Tech
On Sep 12, 2018, at 2:00 PM, Koen Van Hooreweghe wrote:

> Sure it works. We use it with 4D v16 on Windows.
> 
> It is mentioned in the language reference: 
> http://doc.4d.com/4Dv16/4D/16.4/Integration-of-PDFCreator-driver-under-Windows.300-3978065.en.html
> But I think the example has a mistake. The second parameter of the SET PRINT 
> OPTION command should be 3 (=PDF) not 2.
> 
> I cannot test right away (I'm on Mac), but I saw in my code I put the command 
> with 2 in comment and I have this line with 3.

This is true. If you use PDF Creator you use the same setting as you do on 
macOS. But if you use the built in Windows 10 PDF driver you must use option 2. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D for iOS: anyone?

2018-09-11 Thread Tim Nevels via 4D_Tech
On Sep 11, 2018, at 10:03 AM, Vincent de Lachaux wrote:

> in works, coming in a next R release (probably R4)

I’m glad to see that Vincent is working on this project. He has a long history 
of making the 4D projects he works on much better and more useful. 

I believe he is the engineer that wrote the new Query Editor that replaced the 
one we've had since 4D v2 days. It’s filled with powerful and useful features. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

RE: Help?

2018-09-11 Thread Tim Nevels via 4D_Tech
On Sep 11, 2018, at 2:29 AM, Randy Engle wrote:

> Started my app, held down alt key.
> Dialog:  Open Data File
> Click OK
> "Immediately" held down Shift-ALT-Right Mouse
> Selected "Application Process" to trace

> 
> Hit trace in first line of code on ON STARTUP Method.This is the first 3 
> lines of the On Startup and On Server Startup methods in EVERY database I 
> have... just for situations like this. 

I add this at the top of On Startup and On Server Startup methods. 

If (Shift Down)
   TRACE
End it

I’m never fast enough to do the right click thing reliably. 

Tim

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

Re: 4D for iOS: anyone?

2018-09-11 Thread Tim Nevels via 4D_Tech
On Sep 11, 2018, at 2:29 AM, Rudy Mortier wrote:

> Thanks a lot for the feedback.
> 
> I did go back and edit the templates and fields, so that might be the problem.
> 
> About the selection of data that is downloaded: wouldn’t it be possible to 
> control that in the ‘On mobile authentication method’?

It could be. I’m just not sure where they intend to implement providing that 
control.  Could be done in several places. We’ll have to wait and see how the 
product developers with the v17 R releases to learn more.

Tim

Sent from my iPad

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

Re: 4D for iOS: anyone?

2018-09-10 Thread Tim Nevels via 4D_Tech
On Sep 10, 2018, at 2:00 PM, Rudy Mortier wrote:

> Has anyone tried 4D for iOS?
> 
> How are the results?
> 
> I have tried with a simple database and tried to publish 3 tables. The form 
> templates seem to not always display the correct data.
> 
> In the test environment, It doesn’t download the data for all 3 tables: 
> sometimes only one, sometimes 2. And there is not a lot of records in the 
> tables.
> 
> Is there any place we can get some help?

I did a quick conversion of a database to v17 R2 and created a simple iOS 
application. It worked almost flawlessly (see below problems). Go through the 
wizard to define the tables and fields to use and the list and detail forms to 
use. Then click the build button and wait maybe 90 seconds and the iPhone 
Simulator program launched and there was my working iOS application. Very 
impressive… when it worked.

Of course the capabilities of the first version are severely limited. Limited 
configurability of the detail and list forms. You get many templates but you 
can just select what fields to display and in what order and that’s about it. 

Also it is just read only. It downloads all records from the tables you 
included to the iPhone and you can then do simple searching on a key field and 
view the information. That’s it. No filtering of what records to download. No 
updating or editing of the data. When you want to refresh the data you go to a 
settings area in the iOS application and click a refresh button to re-download 
all the data from a 4D Server that has the 4D Mobile feature turned on. 

So applications created with this first version are of limited use in the “real 
world”. Of course this is just the first version released in v17 R2. So I would 
expect R3 to add many more capabilities and fix a lot of bugs. Hopefully by v17 
R5 it will be “fully functional” with the ability to edit data, recreate new 
records, automatically sync the data back to 4D Server and provide more widgets 
on the forms. 

I didn’t have the problem you experienced… once I got a project completed. It 
downloaded all the data from all the tables in my application and it displayed 
the data as expected. 

So maybe your 4D for iOS template or definition file got corrupted somehow 
during your development of it. I know that I had to start over 3 times. I’d get 
started, then change my mind and try to go back in the wizard and edit and 
change the template or fields and couldn’t get it to work. So I’d trash it and 
start again from scratch. By the third time I was able to go straight through 
the process to the end and it worked. 

It’s definitely not ready for prime time at this point, but again it’s not 
really intended to be. I’d consider it v0.9 version. I wouldn’t even call it 
1.0 yet. I’m reserving judgment until v17 R5 to see what it’s like then. 
Remember at 4D Summit they said 4D for iOS was really a v18 feature. So expect 
it to be ready for prime time by then. Now it is just something to play with… 
in my opinion.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: What constitutes use of 4D View Pro?

2018-09-10 Thread Tim Nevels via 4D_Tech
On Sep 10, 2018, at 1:02 PM, Chris Belanger wrote:

> I am a little confused about what constitutes use of 4D View Pro and, hence, 
> requires a license.
> 
> There are a number of features of listBoxes that are described as being 
> features of 4D View Pro.
> 
> https://blog.4d.com/automatic-row-height-in-listboxes-a-new-4d-view-pro-feature/
> 
> In this case, it is the “automatic row height” feature of a listbox, where it 
> can automatically adjust the height of a specific row according to its data.
> 
> If one uses this command, does that constitute use of 4D View Pro and hence 
> require a license? Since I develop on a test server (partner) I would not 
> know if a 4DView license is being ‘used’ or not.
> 
> My feeling is that if you stay away from using a 4D View Pro plugin on a 
> form, that you are not using 4D View Pro, but…

It is a unique situation to be sure. It has been discussed at a 4D Road Show I 
attended and it was confirmed that some listbox features required a 4D View 
license. 

And yes, your 4D developer license has a 4D View Pro license included so you 
would not know a feature you were using would not be available to an end user 
if they did not have a 4D View Pro license. 

It’s one of those things you just have to be aware of and deal with. 

I would think a good solution would be to add some indicator to the Property 
window in Design so that every feature that requires a 4D View Pro license is 
obvious. Maybe you make those properties a different color like blue or purple. 
At least then when you were building the listbox with the Form Editor you’d 
know what you were getting into. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Isolating the Cause of a Server Crash

2018-09-01 Thread Tim Nevels via 4D_Tech
On Sep 1, 2018, at 2:00 PM, Dave Nasralla wrote:

> One of our systems is crashing about every 3 days and I can't seem to
> isolate the cause. Lately these are crashes with a Mac crash report
> appearing on the screen.
> Some system details are:
> - 4D Built Server app with v17.0 HF1 (64 bit Server with 64 Mac and
> 32 bit Windows Clients)
> - Mac and Windows Clients
> - Mac OS 10.13.5
> 
> What I know so far:
> - I have the Server Debug file. It ends with a "." and so the last
> command appears to have executed.
> - I'm using the Report Info component, logging every 5 minutes. There
> doesn't seem to be memory problems or run away cache issues.
> - I also know who was one each time it crashes and said out an email
> to those users to find patterns (so far I've found none).
> - The crashes typically happen around 10am to 11am.
> - The client and server builds match.
> 
> I'm debating turning on the client debugger files and then harvesting
> them afterwards when the user logs back in. I'm open to other
> debugging techniques.
> 
> There are other v17 systems running on the same machine with zero issue.
> 
> Below is a snippet of the crash report. It seems to be different each
> time, but here is the latest. Thread 73 crashed, so I only included
> that one.
> 
> Thanks,
> 
> dave nasralla
> 
> Process:   Corporate [93958]
> Path:  /Users/USER/*/Corporate
> Server.app/Contents/MacOS/Corporate
> Identifier:4d.com.Corporate Server.app
> Version:   17.0 build 17.226566 (???)
> Code Type: X86-64 (Native)
> Parent Process:??? [1]
> Responsible:   Corporate [93958]
> User ID:   501
> 
> Date/Time: 2018-08-31 11:00:05.952 -0500
> OS Version:Mac OS X 10.13.5 (17F77)
> Report Version:12
> Anonymous UUID:723511FD-4CA0-6E8B-0642-883209248DFC
> 
> 
> Time Awake Since Boot: 370 seconds
> 
> System Integrity Protection: enabled
> 
> Crashed Thread:73  LabProjects List (id = -114)
> 
> Exception Type:EXC_BAD_ACCESS (SIGSEGV)
> Exception Codes:   EXC_I386_GPFLT
> Exception Note:EXC_CORPSE_NOTIFY
> 
> Termination Signal:Segmentation fault: 11
> Termination Reason:Namespace SIGNAL, Code 0xb
> Terminating Process:   exc handler [0]
> --
> 
> 
> Thread 73 Crashed:: LabProjects List (id = -114)
> 0   4d.com.Corporate Server.app   0x00010694fdbe
> V4DConnection::OnPostpone(bool) + 40
> 1   4d.com.Corporate Server.app   0x000106b095f7
> V4DServerUser::PostponeServiceConnection() + 35
> 2   4d.com.Corporate Server.app   0x000106b20567
> V4DServer::exec_ConnectionPostpone(V4DRequestReply&, V4DTaskConcrete*,
> short) + 395
> 3   4d.com.Corporate Server.app   0x000106b211ca
> V4DServer::exec_streamreq(V4DRequestReply&, V4DTaskConcrete*) + 100

Hi Dave,

Crashing every 3 days is a real problem and totally unacceptable. So what can 
be done to try and make this situation better? We need to make changes to make 
this crashing stop. But what changes? 

Here is my thinking as I read this crash report. Keep in mind I’m not an expert 
on this, so I may be wrong in some areas. If I am wrong hopefully those that 
know more can correct me — and in turn help me and others understand more about 
how to read these macOS crash reports. (Thinking about Miyako, JPR, Christian 
Sakowski and Rob Laveaux — they are real experts in this area. Real macOS 
programmers that know how to read these things properly.)

The crash report is supposed to provide a programmer with information on 
exactly here the program crashed and the cause of the crash. If you have the 
special 4D “debug” version it will contain more “symbols” and thus when 4D 
crashes you get better names for functions instead of just memory address 
offset. I think you even get 4D command names that were involved in the crash. 
But the basic crash dump info that we have here can help point to the general 
area of concern. Here is a website that helps explain crash dumps and how to 
read them: 

https://www.maketecheasier.com/read-macos-crash-reports-troubleshoot-mac/

This is 4D v17.0 build 226566 that is running compiled in 64bit mode (Code 
Type: x86-64). So first thought is that this could be a 4D 64bit issue. That’s 
important because some of the code is completely different between 32bit 4D and 
64bit 4D. The 64bit code could be newly written code, the 32bit code could be 
legacy code that has been around for years. 

Thread 73 “LabProjects List” is what crashed. Do you have a table named 
“LabProjects” or maybe a MODIFY SELECTION or a listbox window that shows 
records in this table? Or a process that has that name? Makes me think that you 
do. That’s another pointer to where in your application the crashing problem 
occurred.

Exception Type is "EXC_BAD_ACCESS (SIGSEGV)” and that means "the 

Re: 4D Write Pro WP feature request - need your support

2018-08-30 Thread Tim Nevels via 4D_Tech
On Aug 30, 2018, at 2:00 PM, Luc Devar wrote:

> I certainly hope we can open/save .docx document with 4D Write Pro in a near 
> future as this is mandatory for me also.  I have an application install on 
> several sites that write contracts from clauses stored in a 4D DB and I need 
> to use 4D write and compatibility with MSWord is a must.  Right now being 
> compatible with .doc document only is already a problem.  

The 4D people say that we should go vote for feature requests and that they 
really do listen.

So let’s all go do that. Go to 4D Forums and vote 4 stars on every post by 
every person in “Feature Requests” that wants 4D Write Pro to be able to 
import/export to Word. There are many. I just did and it only took a couple of 
minutes to click the 4 stars for each post.

Here is what you do:

Log into forums.4d.com
Click on “Feature requests” in the “Public forums” area
In the “Search” area type in “4D Write Pro” and hit return
On the first page that is displayed you will see 8 threads on this topic
Open each thread and for every single post in that thread click the 4 stars in 
“Your rate”

You just voted for the feature request, multiple times.

Maybe if 10 or more people here on the iNUG go do this it will add up and make 
somebody notice and say “hmm… this appears to be a feature people want. We 
should add that in the next version.”

I love Paul Dennis response: "This is so obvious it shouldn't even be a 
request.”

I have to agree. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D Write Pro WP feature request - need your support

2018-08-29 Thread Tim Nevels via 4D_Tech
On Aug 29, 2018, at 3:12 PM, Chuck Miller wrote:

> I also have one client that is a huge 4d write user. We also need to have 
> ability to convert to Microsoft word. Additionally, there are some things we 
> do not seem to be able to do in write pro so for now, we will be maintain 4d 
> write licenses across multiple servers and standalone dos. At the last Summit 
> many spoke of this issue and 4D stated that they were going to implement 
> export to word and not rtf.

That’s fantastic news! Glad to hear support for Word is coming. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: 4D Write to 4D Write Pro

2018-08-29 Thread Tim Nevels via 4D_Tech
On Aug 29, 2018, at 2:00 PM,Richard Wright wrote:

> Is there a cross reference of language commands between 4D Write and 4D Write 
> Pro or do we have to all figure it out for ourselves? 
> 
> I’m mystified as to why wrappers for the old commands could not have been 
> created so as to make the move to 4D Write Pro relatively painless. E-node 
> did this very nicely when they created the new API for AreaList. All the old 
> commands still work because they are internally mapped to the new ones. Why 
> can’t this be done for 4D Write Pro? If it’s truly ready to go, scrap 4D 
> Write but create a shell plugin that maps all the old commands to the new. 
> With Mac Mojave being the last OS to support 32 applications it’s going to 
> get serious pretty soon.

Hi Rich,

You have to figure it out for yourself. And you have to rewrite — from scratch 
— all existing 4D Write Plugin code. No direct one-to-one- command replacement. 
Some commands not available now. Some commands now require multiple 4D commands 
to accomplish the same thing. 

They said that this was a project where they decided from the very beginning to 
not provide any programming language legacy support. None. Zero.  

The only legacy support they promised to provide is to convert legacy 4D Write 
documents. 

You are on your own dealing with any programming code. 

This is the general takeaway I get with this issue. The 4D Write Plugin still 
works and can coexist with 4D Write Pro. So you can start migrating — which in 
this case is rewrite it from scratch — and continue to use your old code. Once 
you have all the code rewritten and tested and working, you can dump the old 
code, and you’ll have to when you remove the plugin because all the plugin 
command will no longer tokenize. So get ready to delete a bunch of methods. 

The only reason to stop using 4D Write Plugin is if you want 64bit 
compatibility. That’s basically it. If you can live with 32bit 4D Client you 
are fine. But if you want to run 64bit 4D Client and use 4D Write, you must 
switch to 4D Write Pro. 

For one of my clients they are excited about getting SDI mode on Windows. 
Everyone has multiple monitors and they have wanted this for a long time. Now 
they can have it. But they are the 90 user 4D Write Plugin client. So to get 
SDI you MUST go to 64bit compiled version. So they are going to have to pay for 
the 4D Write code rewrite just so they can get SDI. So they are swallowing it, 
but not super happy about it. 

Crazy thing is that to get SDI all you really need to do is check a checkbox 
and recompile. But if you use 4D Write, then it requires a lot more work.

As they say… it is what it is. 

But I have a crazy idea… 

What if someone created a 4D component that had the major 4D Write Plugin 
commands with all the same parameters but as 4D component methods. And each 
method accomplished the same results as the plugin command. Then you could 
remove the 4D Write Plugin, install the component and run a syntax check to 
expose every method and line using the plugin commands. Then you open each 
method and force a retokenization to magically change each line to use the 
component method instead of the plugin command. That gets you 90% of the way 
there without a major code rewrite.

I did exactly this for 2 clients — different than these 2 clients — when I 
upgraded them from v2004 to v11 and 4D dropped the 4D Open for 4D plugin. I 
created a “4D Open for 4D SOAP” component that allowed me to not rewrite all 
the 4D Open code. It was a lot of work, but in the end it was less than 
rewriting all the existing code. And I could use it for 2 clients. The 2 shared 
the upgrade cost. 

When I get ready to do the SDI work for 1 client and need to rewrite all the 4D 
Write code, I’m going to look into doing the same thing. Might be possible. 
Might not be possible. But at least I’ve done it before so probably a day or 
two of analysis and prototyping work will tell me if it can be done. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

4D Write Pro WP feature request - need your support

2018-08-29 Thread Tim Nevels via 4D_Tech
On Aug 29, 2018, at 2:00 PM, Richard Wright wrote:

> You’re kidding, right? 4D Write Pro can’t read and write Word documents?

Nope, it is true. For this version. I have 2 clients that are big 4D Write 
users (one with a 90 user license) and use 4D Write to create Word documents. 

I've asked about this at every 4D Summit where they demoed 4D Write Pro. At the 
first showing several years ago the answer was “we will support all the current 
4D Write Plugin features”. Then at a later 4D Summits it was said, it is not 
there now but it is coming. At the last 4D Summit the answer was “we don’t 
think any/many developers use it”. Even though I’m the one saying to them “I 
use it a lot for 2 clients!”

So maybe you can flex some OEM muscle and get this put on the “must have” 
feature list for the next version. I hope you can because I’ve had zero luck, 
and I was speaking directly to the 4D Write Pro lead engineer.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: New record numbering system and CALL WORKER

2018-08-27 Thread Tim Nevels via 4D_Tech
On Aug 27, 2018, at 2:00 PM, John DeSoi wrote:

> I don't know. In some simple tests without any contention from multiple 
> processes, both reading and writing took 0 ms. 
> 
> I did not know Storage was slow until this thread came up. I did not see that 
> in the documentation, maybe only something you learn about if you go to the 
> conference. Without some published benchmarks, it sounds like 4D folklore at 
> this point.

We have to take Miyako’s word for this. He’s the one that says storage is 
“slow”. But as we all know, “slow” is a relative term. What’s slow to Miyako 
may be plenty fast for another.

After more thought about this topic, I’ve decided to do so real world testing 
and benchmarking to see what kind of speeds we are talking about. That’s the 
only real way to know which is the fastest way and which is the slowest way.

I’m still formalizing exactly what I will test and how I will test. 

I’ll test the traditional table based sequence number system. We all know how 
that works. I’ll make a super basic one so I can do some speed tests. I’ll also 
test the Storage sequence number system that was your initial idea and 
implement they way I outlined in my previous email. 

I’ll want to test this in the most harsh environment I can. So it will be done 
in client/server so we have network I/O to deal with. 

I’ll also want to have many processes requesting sequence numbers at the same 
time to introduce record locking and waiting for the table based system, and 
the built in Storage locking mechanism which I assume also has a built in 
queuing systems to stack up calls and handle them in FIFO order. 

So maybe I’ll start up 4D Server and 4D Client and then on 4D Client launch say 
50 processes. Each process will loop say 100,000 times creating sequence 
numbers. Just do it brute force hard with no delays.  I’ll add some timing code 
and we’ll see who’s the winner. 

And I’ll also see if I can create any deadlock situation that some have pointed 
out could be an issue when using shared storage.

Anyone have other ideas on how to set up a good test case, let me know. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: New record numbering system and CALL WORKER

2018-08-26 Thread Tim Nevels via 4D_Tech
On Aug 26, 2018, at 2:00 PM, Keisuke Miyako wrote:

> I totally agree with Christian, in fact,
> the point (slow, should be avoided if possible) was right there in the Summit 
> keynote.
> 
> on the point of "slow"
> of course it is a relative thing and perhaps not a big deal depending on the 
> context,
> but you only have to run code with Storage and the speed difference is quite 
> palpable.
> it is not a 4D specific phenomena, it is intrinsic to how blocking based on 
> mutex works.
> 
> on the point of "good coding"
> 4D forces you to forfeit exclusive access with the "Use/End use" code block,
> so unless you implicitly use storage in a stacked subroutine (super bad idea),
> it is hard to violate the FILO tule unintentionally.
> 
> a more subtle gotcha is to make the mistake of
> using objects and collections as if they were values, not references.
> it's not limited to storage, but it can really bite you when you make the 
> mistake with storage.


Good to know. John and my idea of using storage for sequence numbering is a bad 
idea. That’s why I posted here to get comments on if it was a good idea, or a 
bad idea. Now I know it’s a bad idea. 

Storage is slow, so avoid using it if you can. But if you need it, it’s there 
to be used as a tool. But only in certain circumstances. 

I’ll watch and see what others do with storage to learn when it is a good thing 
to use. 

Tim

Tim Nevels 
timnev...@mac.com 
Innovative Solutions
785-749-3444


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

Re: New record numbering system and CALL WORKER

2018-08-26 Thread Tim Nevels via 4D_Tech
Humm... interesting comment. Why do you say Storage is slower and can produce 
deadlocks? Tell us why you believe this. 

Was my example an example of “not well programmed”? Be honest. Give me real, 
solid,  constructive criticism. This is a forum for exchanging ideas and 
learning. I’ve been wrong many times in the past. I may be wrong now. I am 
interested in learning and improving and understanding more. 

Please elaborate on why “you should avoid Storage where you can”.  

I thought Storage was a wonderful new 4D feature. But you say it should be 
avoided. Why?

Tim

Sent from my iPad

> On Aug 26, 2018, at 3:03 AM, Christian Sakowski 
>  wrote:
> 
> Hopefully not. You should avoid Storage where you can. They are slower and 
> can produce (if not well programmed) dead locks.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: New record numbering system and CALL WORKER

2018-08-25 Thread Tim Nevels via 4D_Tech
On Aug 25, 2018, at 4:33 PM, Christian Sakowski 
 wrote:

> i mainly use Storage as „constants“. I store global attributes and user 
> specific options and access rights. Those are in fact mostly read only.

Hi Christian,

And that is a great use of “Storage”. I’ll be doing the same thing in new 
databases I create.

But lets explore other possibilities. What could “Storage” be use for in other 
cases? Is it a good use of “Storage”?

One of the great things about 4D is that features designed and intended to be 
use for one situation turn out to be very useful in other situations. And I 
love the “big brains” on the iNUG exposing these new uses.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: New record numbering system and CALL WORKER

2018-08-25 Thread Tim Nevels via 4D_Tech
On Aug 25, 2018, at 2:25 PM, Christian Sakowski 
 wrote:

> This is not necessary. For just reading you don’t need to use „use“.
> For generating sequence numbers, you have to use „auto increment“. Nothing 
> else.
> For invoice numbers, you now can save the number to the database within 
> transactions with SUSPEND/RESUME TRANSACTION (of course, locking and waiting 
> if necessary…)

Hi Christian,

You are correct, it is not necessary to “Use” a shared object if you are only 
going to read it. I’m still getting used to this new 4D feature. Thanks for 
reminding me of that.

Regarding sequence numbers and using the “auto increment” or the “Sequence 
number” command, I always use that. I agree it’s the best, period. 

But this is really a discussion of how one might use shared storage. Rightly or 
wrongly. Trying to understand how to use this new 4D feature and gather some 
ideas on possible ways of using it. I’m still learning and trying to understand 
it. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: New record numbering system and CALL WORKER

2018-08-25 Thread Tim Nevels via 4D_Tech
On Aug 25, 2018, at 10:33 AM, Pat Bensky wrote:

> Thanks John.
> But how would that work in a multi-user setting? Whatever method is used
> for assigning the new numbers, it must run on the server, otherwise we're
> back to the problem of using semaphores, checking record locking, etc.
> Also I should point out that there could be a large number of tables for
> which the record numbering system needs to be used. We have a RecordNumbers
> table which has one record for each table that requires this function. so
> we must have ONE process that accesses and updates that table.

I like John’s idea of using the new shared object “Storage”. This has a 
built-in, super efficient, locking mechanism using the “Use/End Use” system. My 
first thought were that this could be the ultimate “next sequence number” 
system if you have already used the “Sequence number” attribute for a table 
(which is already the ultimate “next sequence number” system for a table in 
terms of speed and reliability in a multi-user and transactional system. 

So here is an idea for a basic sequence number system based on shared “Storage” 
object. The goals are:

- Make it as fast as possible
- Make it work on single-user and client/server with the least amount of code
- Use built-in 4D features wherever you can
- Works anywhere and everywhere, no special cases to deal with
   - any process cooperative or preemptive
   - in triggers
   - inside or outside transactions
   - from a form or from a process with no UI
- Don’t care about “lost numbers” (holes in the sequence numbers are OK)

Sorry Pat, you’ll have to complicate the system to make it work for your 
specific needs, but that should be doable with a more complex storage object. I 
just wanted to present the concept I have here in the simplest terms for easy 
digestion.

1. Initialization - this needs to be done once for a database application. If 
you are running single-user, do this in the “On Startup” method. If you are 
running client/server do this in “On Server Startup”

Use (Storage)
   Storage.myNextNumber:=1
End use

2. GetNextNumber - this is a method that will return the next number from the 
shared storage. Set the method property for “Execute on server”. This will make 
it work in single-user or client/server with no code changes. 

// Method: GetNextNumber

C_LONGINT($0)

Use (Storage)
   $0:=Storage.myNextNumber
   Storage.myNextNumber:=$0+1 // increment sequence
End use

3. Permanent storage of the next number - If you want this to maintain it’s 
value across launches of the application, use a table in the database. So in 
the “initialization” part above instead of setting "Storage.myNextNumber:=1” 
you would query a table and get the next number value from a field in a record. 
When the database quits you update that value so it is available for the next 
“On Startup” or “On Server Startup” You would put this code in the “On Exit” or 
“On Server Shutdown”.

4. What if my database crashes and my code does not get a chance to do a proper 
save of the next number to the database? A valid consideration and one I think 
should be addressed. We all know that 4D will crash sometimes, so best to be 
prepared and handle it as best we can. 

How about in the “initialization” part you also start a new process whose job 
is to save the next number from the storage object to a database record. Have 
this process run as often as you are comfortable with. If you are journaling 
your data file — and you should be — the record update will be in the journal 
file so that if 4D crashes, on the next startup it will integrate the change 
into the database and you’ve not lost anything. 

You could bypass the whole shared storage approach and just do database 
operations on records, but I would speculate that using shared storage is just 
a tad bit faster than doing a query, wait for record to be unlocked, increment, 
save record, unload record operation. Might not be, I’ve not done any testing 
to see which is faster. Just seems like less overhead to not call the database 
engine every time you need a next number. But it does introduce a "cache within 
a cache” situation. And the potential risk of losing that last sequence number 
before your process “flushes” it to the database cache and writes to the 
journal file. But one of my above stated goals was maximum speed, so I think 
this will buy you a tiny bit of extra speed. 

Here is some example code for saving the next number storage value to the 
database. Put this in a method that is called in either “On Startup” or “On 
Server Startup”. To make is super simple, [MyNextNumber] table only contains 1 
record and 1 field. And no other process is ever allowed to do any write 
operations to table [MyNextNumber]. The only process to modify it is 
“SaveMyNextNumber” then you don’t have to worry about possible record locking 
issues.

$processID_l:=New Process(“SaveMyNextNumber”;0)

// Method: SaveMyNextNumber

ALL RECORDS([MyNextNumber]) 
if 

Re: Remove Remembered Password

2018-08-23 Thread Tim Nevels via 4D_Tech
On Aug 23, 2018, at 2:00 PM, Chip Scheide wrote:

> not - not a merged app.
> C/S
> 
> I was not saying you are wrong, just that there may be other 
> ways/issues in stopping password saving.

Hi Chip,

I know, sorry if I sounded rough. I’ve had a few message with Tim Penner at 4D 
about this today and there are actually 2 Tech Tips that relate to this topic. 
Once you find if you search “remember password” and another if you search 
“mdp”. Each returns a different Tech Tip, but not both together. 

I searched “remember password” and got the one about ".4dlink” files. This is 
what you are talking about. And it is all true and accurate. 

http://kb.4d.com/assetid=76151

But the other Tech Tip — if you search for “mdp” — talks about the same subject 
but for built applications because they do not use “.4dlink" files, they use 
“.mdp" files. 

http://kb.4d.com/assetid=76632 

So now we have the complete story, just in 2 pieces. Tim may create a 3rd Tech 
Tip that combines all this info and is keyword indexed so that you can find it 
by searching several ways. And now the iNUG has this knowledge stored for us.

So with your code example and my code example the next poor soul should have a 
much easier time dealing with this issue.

And maybe someday, just maybe — 4D will add another build app XML key that will 
“remove remember password” from the login screen and this will be just another 
oddity in the world of 4D. 

And, of course, you can avoid all of this if you build your own login screen 
and abandon 4D’s. But that’s a whole new can of worms to deal with that I’ll 
leave to others to discuss.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Remove Remembered Password

2018-08-23 Thread Tim Nevels via 4D_Tech
On Aug 23, 2018, at 8:50 AM, Chip Scheide wrote:

> there is another issue here.
> if using a 4Dlink file (and maybe if not)
> the password is/can be saved in the link file.
> 
> I have code in my startup routine that handles this issue too.
> this code locates the link file, and then removes the password from the 
> file.
> 
> $Link_File_Path:=System folder(User Preferences_User)
> $Database_Name:=utl_Database_Name 
> $Database_Name:=$Database_Name+".4DLink"  //becaus ethe link file does 
> not carry that part of the database name
> 
> If (Folder separator=Colon_Char)  //link file is in a specific location
> $Link_File_Path:=$Link_File_Path+"4D:Favorites 
> v13:Remote:"+$Database_Name
> Else   //windows - link file may be in either of 2 locations
> $Database_Name:=txtutl_Strip_Characters ($Database_Name)  //windows 
> does not like leading spaces
> $Link_File_Path:=System folder(Desktop)
> 
> If (Test path name($Link_File_Path)#Is a document)  //file Does NOT 
> exist
> $Link_File_Path:=System folder(User Preferences_User)
> End if 
> $Link_File_Path:=$Link_File_Path+$Database_Name
> End if 
> 
> If (Test path name($Link_File_Path)=Is a document)  //file exists
> $xml:=DOM Parse XML source($Link_File_Path)
> DOM SET XML ATTRIBUTE($xml;"md5_password";"")
> DOM EXPORT TO FILE($xml;$Link_File_Path)
> End if


Hi Chip,

My particular 4D application is a 4D Server/4D Client that is compiled and 
merged with 4D Volume Desktop. They operate differently than 4D separately. So 
your above code works in your situation, but it does not in mine. Trust me. 
I’ve spend HOURS working on this and it DOES use a “.mdp” file and NOT a 
‘.4dlink” file. 

Is your application compiled and merged with 4D Volume Desktop?

Tim

Tim Nevels 
timnev...@mac.com 
Innovative Solutions
785-749-3444


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

Remove Remembered Password

2018-08-22 Thread Tim Nevels via 4D_Tech
Here is some code I wrote today due to a request by a client to stop allowing 
users to remember their password when using the built in 4D user login window. 
This is that “Remember password” checkbox that you can’t make go away. The 
workaround is to just delete the file that stores the user name and password 
that is remembered. 

There is an article in the 4D Knowledge Base about this, but it is for older 
versions of 4D where the path to this saved “.mdp” file has different. I used 
that as a starting point and the got it to work with the 4D v14 version that I 
needed. Should work with 4D v14+. 

Works on macOS and Windows. You do need to provide the “application name” 
because I could not reliably determine this with so many possible variations 
like: using 4D, using merged single-user application, using merged client 
application or user has changed the application name. 

  // ===
  // PROJECT METHOD: RemoveRememberedPassword

  // PARAMETERS: $1 = application name

  // DESCRIPTION: When using the 4D password system
  // you can choose the "Remember password" option which 
  // will save your username and password. This will allow 
  // you to bypass the login prompt and automatically log in from then on.

  // When the "Remember Password" option is selected, the 4D user name
  // and password are saved to a file. File name is the application name+".mdp"
  // This method will delete that file, if it exists.

  // Should work with 4D v14+ versions. (Unless they change the location, 
again.)

  // Windows path
  // C:\Users\{username}\AppData\Roaming\{applicationName}\Favorites 
v{applicationMajorVersion}\Remote\

  // macOS Path
  // /users/{username}/Library/Application 
Support/{applicationName}/Favorites v{applicationMajorVersion}/Remote/

  // CREATED BY: Tim Nevels, Innovative Solutions ©2018
  // DATE: 8/22/18
  // LAST MODIFIED: 
  // 
C_TEXT($1;$applicationName_t)
$applicationName_t:=$1

  // declare local variables
C_TEXT($applicationMajorVersion_t;$filePath_t)

  // get 4D application major version
$applicationMajorVersion_t:=Substring(Application version;1;2)

  // strip off extension
If (<>macOS)
   $applicationName_t:=Replace string($applicationName_t;".app";"")
Else 
   $applicationName_t:=Replace string($applicationName_t;".exe";"")
End if 

  // build file path to the .mdp file
$filePath_t:=Get 4D folder(Active 4D Folder)+"Favorites 
v"+$applicationMajorVersion_t+Folder separator+\
   "Remote"+Folder separator+$applicationName_t+".mdp"

  // delete file if it is there
If (Test path name($filePath_t)=Is a document)
   DELETE DOCUMENT($filePath_t)
End if 


Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Sending Text Messages From 4D

2018-08-22 Thread Tim Nevels via 4D_Tech
On Aug 22, 2018, at 2:00 PM, Jim Hassler wrote:

> We had a need to send texts to company employees so we have the luxury of 
> knowing the cell phone provider.  So, we use something like this…
> 
> Case of
> 
>: ([User]Company Cell Phone Provider="AT")
> 
>   aEmailAddress{1}:=$cellPhoneNum+"@txt.att.net"
> 
>   emSEND EMAIL ("Linbeck Lean Video";<>CR+[Video]Web 
> Address;$fromAddress;"aEmailAddress";"";"";"")
> 
> 
>: ([User]Company Cell Phone Provider="Verizon")
> 
>   aEmailAddress{1}:=$cellPhoneNum+"@vtext.com"
> 
>   emSEND EMAIL ("Linbeck Lean Video";<>CR+[Video]Web 
> Address;$fromAddress;"aEmailAddress";"";"";"")

Thanks for the info. Several people have responded that most providers have a 
free email service that allows sending a text. I’d love to be able to do this, 
but for this client it’s just not possible to always get the person’s cell 
phone provider. So we will have to use a pay service.

Of all the SMS web services out there twilio.com seems to be the most popular 
with 4D developers. I have a few say they can provide me with some code to do 
the http work with Twilio’s API. So I’ll probably go that route.

It was a bit unclear to me exactly what the cost is with Twilio. Their website 
lists many services available for sending and receiving SMS and even MMS. From 
what I could gather it costs about $1.00 a month for the pay-as-you-go option, 
and 1 cent for each SMS sent. 

It is not exactly 1 cent for every SMS because you pay Twilio $0.0075 for each 
SMS and they you pay another fee to the carrier of the person’s cell phone. 
AT is $0.0025 per SMS and Sprint is $0.005 per SMS. In any event the cost 
seems incredibly low. 

If someone knows the exact pricing scheme for Twilio, I’d love to hear it. I’m 
not sure I completely understand it. 

One other question is do you need a cell phone account to send SMS with Twilio? 
If so, I guess the company could get a cell phone for the business and just 
never use it. It would be just so you could send SMS via 4D. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Sending Text Messages From 4D

2018-08-22 Thread Tim Nevels via 4D_Tech
I have a client that has asked me to add the option to send text messages to 
cell phones from 4D. I know this is possible via some websites or web services 
for a fee. Has anyone done this and can recommend a web service that you were 
able to use from 4D to do this?

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Creating Windows Taskbar Icons with 4D Version Numbers

2018-08-16 Thread Tim Nevels via 4D_Tech
On Aug 16, 2018, at 2:00 PM, Cannon Smith wrote:

> Thank, Tim. This is a great tip! In fact, it would make a good Tech Tip.

For what it’s worth — if is even necessary — I authorize 4D, Inc. to use this 
idea to create a Tech Tip. 

On macOS I do something different to get the same effect from the Dock. I 
rename the applications. So “4D.app” becomes “4D v17.0 HF1.app”. Then when you 
hover over the icon in the doc you see the version info instead of just “4D". 

I didn’t mention this before because I assumed all the macOS developers already 
knew, but maybe not. So here it is for completeness. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: First day experience using 4D v17.0 HF1

2018-08-16 Thread Tim Nevels via 4D_Tech
On Aug 16, 2018, at 9:01 AM, Tom Benedict wrote:

> Thanks for the report Tim. I'm very impressed that anyone is doing 
> development on 4D Server over the internet.

This has only become possible in the last maybe 5 years due to the increases in 
internet speeds, and the changes 4D has made to optimize network traffic 
between 4D Server and 4D Client. I believe the new network layer is a major 
contributor to this. 

Trying to do what we have been doing 10 years ago with a 10 Mbps down and 1Mbps 
up internet connection would have been a horrible experience. 

The 4D Server that I’m connecting to has 1Gbps up and 1Gbps down internet 
connection. My brother has Google gigabit internet access that is 1Gbps up and 
1Gbps down. I’ve connected to this 4D Server and it is almost like being on a 
LAN. Completely usable and a good experience. 

I’ve been told 1Gbps service is coming to my area later this year. I’ll 
definitely upgrade to that. 

> When deployed does your app use 4D Client or does it have a web front end? I 
> ask because in our experience 4D performance over a WAN was intolerable. 
> Minutes to open a record. But that involved long queries and loading records 
> from multiple tables and executing lots of code/forms/etc. We also were 
> dealing with tables with millions of records and 200 - 300 concurrent users. 
> Our app may not be typical though.

The production database does not use 4D Client to connect to 4D Server. It uses 
a custom REST server over http. It was designed from the beginning to be fast 
one a WAN on the internet. We have no speed issues in production. I’m only 
talking about development work with 4D Server/4D Client and using the Design 
environment and doing some testing of development work. 

Some operation are super slow still going over the WAN as opposed to a LAN. 
These have not been optimized. Liberal use of the “Execute on server” method 
property and rewriting some code to reduce network traffic would speed these 
areas up. When we run across a “slow” area that we are “sensitive” about, we 
take some time to make changes and have seen the performance improve. But 
hardly ever is it exactly the same speed as on a LAN. We accept that. We just 
want it to be usable when doing development and testing. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

PDF Creation on Windows under v16 -- Changed?

2018-08-16 Thread Tim Nevels via 4D_Tech
> On Aug 16, 2018, at 9:01 AM, Allan Udy  wrote:
> 
> After recently upgrading one of our vertical market apps to v16R6 (from 
> v14), we're getting reports from several user sites that the (relatively 
> simple) PDF reports that they've been emailing to their clients are now 
> failing on a more regular basis.
> 
> Failure consists of:
> 
> a) attached PDFs not actually appearing at the email destination, or
> 
> b) some of the attached PDFs that do arrive are corrupt and are unreadable.
> 
> At this stage there seems to be a mix of both Win 7/8 clients using PDF 
> Creator, and Win 10 clients using the built-in pdf writer (our software 
> auto switches depending on the OS).
> 
> We know that there are SMTP Server, spam filter and ISP issues at work 
> (as there always have been), and we're working through this trying to 
> get more info, but it would be useful to know if anyone else noticed the 
> appearance of more problems with PDFs under v16 compared with earlier 
> versions?

I recently got bitten by a rather obscure Windows 10 bug relating to the built 
in "Microsoft Print to PDF” driver. Where in the past using 4D and PDF Creator 
printer driver to produce PDFs works without issues, sometime PDF would be 
produced using Windows 10 and "Microsoft Print to PDF” would not open. Reported 
they were corrupt. The file size looked about right, but they would open.

I worked for hours trying to track this down. I tried a shorter file path, that 
didn’t help. I switch to PDF Creator, that worked but the client really wanted 
to use Microsoft Print to PDF and not have to deal with PDF Creator (and I 
wanted that too). Finally I tried a different file name, “test.pdf” and it 
worked. 

The issue is that if there is a comma “,” in the file name or file path when 
using Windows 10 and Microsoft Print to PDF the resulting PDF will be created 
but corrupt, or will not be created at all. Yeah… how’s that for a kick in the 
teeth. Comma in a file name makes it go crazy.

Go see for yourself and Google "windows pdf driver and comma in filename”. 
There are many people finding this and going crazy. 

In my particular situation the client wanted/needed commas in file names and 
sometimes in folder names. So the workaround for me was to check for a comma in 
the file path for the PDF and if found — and using Microsoft Print to PDF 
driver — I create the PDF in a temp directory with a name with no comma, Once 
the PDF is created I MOVE DOCUMENT it to the original file path that has the 
comma in it. That works!

Thank you Microsoft for wasting 4 hours of my life one day to find and resolve 
this bug.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Creating Windows Taskbar Icons with 4D Version Numbers

2018-08-15 Thread Tim Nevels via 4D_Tech
Today I wanted to add 4D v17.0 and v17.0 HF1 to my Windows 10 taskbar. 
Sometimes I will have several versions of a 4D version in use and I like to 
have the 4D version number appear when I hover the mouse over the taskbar icon. 
That way I know which version I’m launching. 

So how do you do that? I’ll show you so you don’t have to spend the time 
googling how to do it like I did once.

Normally when you right click on the icon in the Windows taskbar of a running 
application and select “Pin to taskbar”, Windows will assign the program’s name 
to the taskbar icon. But when you have several version of 4D in the taskbar the 
names assigned are “4D”, “4D (2)”, “4D (3)” etc. Not very useful for knowing 
which one points to which version. 

Here is what my Windows 10 taskbar looks like and what I see when I hover the 
mouse over the 4D icons:

https://www.dropbox.com/s/we8rgykyzp0lx9s/Screen%20Shot%202018-08-15%20at%209.25.02%20PM.PNG?dl=0
https://www.dropbox.com/s/kc1iqs2vywdcrhe/Screen%20Shot%202018-08-15%20at%209.17.45%20PM.PNG?dl=0
https://www.dropbox.com/s/ny3ouuo3a138myz/Screen%20Shot%202018-08-15%20at%209.17.54%20PM.PNG?dl=0
https://www.dropbox.com/s/iha0l0okha8jfvx/Screen%20Shot%202018-08-15%20at%209.25.28%20PM.PNG?dl=0
https://www.dropbox.com/s/4yc6q564db4tv12/Screen%20Shot%202018-08-15%20at%209.25.35%20PM.PNG?dl=0
Here is how you can set the name that will appear when you hover over the icon 
in the taskbar.

The programs pinned to the taskbar are stored here:

%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar

So copy this and paste into the address bar of a window and hit enter and this 
folder will open.

https://www.dropbox.com/s/agswr25q7380bac/Screen%20Shot%202018-08-15%20at%209.26.21%20PM.PNG?dl=0

Shortcuts for all the pinned taskbar items are in this folder. Simply change 
the name of the shortcut to something meaningful and then restart Windows. You 
must restart Windows so that it will reload the taskbar shortcut names. 

Now when you hover the mouse over an icon you will know what version of 4D the 
icon is going to launch.

Just trying to make things a little nicer in the Windows world…

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

First day experience using 4D v17.0 HF1

2018-08-15 Thread Tim Nevels via 4D_Tech
I’m working on a project where we upgraded from 4D v16 R3 to v17.0 HF1 today. 
Development on this project uses 4D Server Team Developer over a WAN for most 
of the developers — I’m one of them. I’m using an iMac Pro and my internet 
connection is pretty good — cable modem with 150Mbps down and 15Mbps up. 

We have been using the new network layer and it has proven very reliable in our 
development environment with v16 R3. I could connect to 4D Server and stay 
connected all day long without any disconnects. Maybe 1 disconnect problem a 
month if that. So nothing to complain about really. 

After spending many months all day long using v16 R3, today I immediately 
noticed things were faster with v17.0 HF1. So nice to install a new version of 
4D and immediately feel a performance boost. Time will tell if there are any 
new issues with v17, but so far it’s all good news.  Connected all day without 
any issues. 

I am LOVING the object dot notation and using collections and the new Dynamic 
Forms feature. Collections work like arrays with JSON. So instead of needing to 
do OB GET ARRAY, manipulate the array, and then OB SET ARRAY you can work on it 
“inline” with dot notation and collections. 

Let’s say you want to create an object with this structure:

{
"markerHeader": 0,
"markerBody": 72,
"method": "label_SetObjectFontSize",
"labelWidthInches": 3,
"labelHeightInches": 1,
"minimumFontSize": 7,
"objectsToAdjustFontSize": [],
"pages": [
null,
{
"objects": {}
}
]
}

Here is some v17 code that will create it:

$object_o:=New object(\
"markerHeader";0;\
"markerBody";72;\
"method";"label_SetObjectFontSize";\
"labelWidthInches";3;\
"labelHeightInches";1;\
"minimumFontSize";7;\
"objectsToAdjustFontSize";New collection;\
"pages";New collection(\
Null;\
New object(\
"objects";New object)))

Yes, that is a single line of code!

Say you want to add an object to the “objects” object. A rectangle definition 
for use on a form. Here’s some code to do that using dot notation:

$borderRectangle_o:=New object(\
"type";"rectangle";\
"fill";"transparent";\
"strokeWidth";0;\
"left";0;\
"top";0;\
"width”;216;\
"height”;72)

$object_o.pages[1].objects.borderRectangle:=$borderRectangle_o

Refreshingly convenient considering all of the work you would have to go 
through without dot notation to accomplish the same thing. No OB GET ARRAY and 
OB SET ARRAY needed. 

Just wanted to pass this info on to other developers thinking about doing the 
v17 upgrade. First day 4D Server Team Developer v17 experience over a WAN was 
very good. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: ORDA runtime error - seems like a bug in 4D

2018-08-13 Thread Tim Nevels via 4D_Tech
On Aug 13, 2018, at 2:00 PM, Jeffrey Kain wrote:

> This fails every time:
> 
> C_OBJECT($selManuAbbv)
> $tManufacturerName:="Levy's"
> $selManuAbbv:=ds.ManufacturerAbbv.query("Manufacturer = 
> :1";$tManufacturerName)
> 
> It's due to the single-quote in the string. Is this a bug in 4D?

Did you try doing something like this:

$tManufacturerName:=“Levy”+char(Quote)+”s"

That would tell you if it is a parsing/method editor issue or something very 
low level in the ORDA engine. 

Either way it is definitely a bug that must be fixed. 

Also, did you try v17.0 HF1? Maybe they snuck a fix into that. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

v17.0 HF1 Bug Fix delayed process not waking fix

2018-08-13 Thread Tim Nevels via 4D_Tech
Got an email about v17.0 HF1 being released. This fixed bug caught my eye:


ACI0098368 A delayed processes do not wake up if paused and then resumed: 
it stays in pause mode.

Could this be a fix for the Stored Procedure problem many have reported here 
where they get paralyzed and refuse to wake up and run again until you restart 
4D Server?

Anyone know if this is a fix for that bug. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: startup progress on server

2018-08-06 Thread Tim Nevels via 4D_Tech
On Aug 6, 2018, at 10:21 AM, Randy Jaynes wrote:

> Ok. So moving our STARTUP method into a stored procedure using
>   $procID:=New Process(“STARTUP”;512000;”On Server Startup)
> 
> takes care of BOTH problems.
> 
> So it looks like the Application Server process on 4D Server v16R6 and higher 
> is more sensitive to interface related commands like
>   OPEN WINDOW
>   SET MENU BAR
>   DISPLAY RECORD
> 
> For the record, this startup method was fine up through 4D v15.4 HF3.

Just curious, does SET MENU BAR actually work from a Stored Procedure process 
on 4D Server?I thought this was not supported. 

You can open a window from a Stored Procedure on 4D Server but I didn’t think 
you could install your own menu bar, and have your own items in the menu bar 
that you could select and have them perform actions. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Re: Frequent and Random Crashes - since 16 conversion

2018-08-04 Thread Tim Nevels via 4D_Tech
On Aug 4, 2018, at 2:00 PM, Bob Miller wrote:

> I've recently completed a conversion from 4D v15 -> v16r6 on Windows, for 
> a built-server application.  This also changed the client from a 32 bit 
> client to a 64 bit client and we went to the "new" network layer.
> 
> Since then, we've had many reports from both users with locally installed 
> clients as well as users on remote desktop servers that at least 4-5 times 
> a day they'll perform some operation (there's no consistency; they can be 
> anywhere in the program) and it will instantly crash - no error message 
> other than a dialog from 4D Volume Desktop that says, "4D Volume Desktop 
> has stopped working".
> 
> I'm wondering if this could be related to the new network layer?  I recall 
> some chat about a year ago about problems with this layer, but as I was 
> not using it at the time and was hoping it all would be worked out before 
> I was going to be using it, I kind of ignored it all.  Now I'm having 
> problems.
> 
> I"m using pretty standard plugins, but I can't trace the behavior to any 
> of these:
>4D Internet commands
>4D Pack
>ALP
>ObjectTools
>Win32API
>XL Plugin
>XML Plugin
> 
> Have others seen this?  I have about 180 users and this was not a problem 
> with v15r4.  I'm sure I've logged 100+ instances of such crashes, which 
> are probably only a small fraction of the overall problem.
> 
> Any insights would be helpful.

Hi Bob,

I must admit you were bold to go all the way with this v16 upgrade. You went as 
far as you could and adopted as many new parts of 4D as possible.

You went from 32bit to 64bit.
You went with the new network layer.
You went with to the R6 release.

I’d consider backing off on all of these, if you can. 

If you are not using any R6 features, switch to v16.3. It has bug fixes that 
v16R6 doesn’t have. And you have access to v16.3 hotfix versions with even more 
bug fixes than R6.

Switch from 64bit back to 32 bit for the clients. No problem leaving 4D Server 
running 64bit. I am assuming you are running a Windows server.

Turn off the new network layer and go back to legacy network. 

You can choose how you make these changes. Do one at a time, and see if it 
makes a difference. Or do all 3 at once and see if that makes a difference. If 
it does, then add one new feature at a time — no comment on what order — and 
see when it “goes bad” you’ll know which part is the culprit. 

I’d also make sure you are running the most current versions of all your 
plugins. 

That’s what I would do. Hope you can track down the issue and get your 4D 
Clients back to running stable again.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Query by Formula bug Client/Server with Automatic Relations

2018-08-02 Thread Tim Nevels via 4D_Tech
On Aug 2, 2018, at 9:12 AM, Chip Scheide wrote:

> with the auto many to one 
> I would *expect* the selection in the one table to be changed, after 
> running a query on the many table. I would also expect that the one 
> table record would be the one (in the one to many) of the first record 
> in the many.

So would you expect it to work the same in single-user and client/server? 

Rich is pointing out it works differently in single-user than it does on 
client/server. If it worked the same in both places he would not have posted 
this message. That’s the key point I took from his post.

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Query by Formula bug Client/Server with Automatic Relations

2018-08-02 Thread Tim Nevels via 4D_Tech
On Aug 2, 2018, at 9:12 AM, Richard Wright wrote:

> I just ran into a problem where running a Query By Formula bug in 
> Client/Server that has apparently been around for a long time:
> 
> Client/Server
> Two related tables and automatic many-to-one is turned on
> 
> 1.  Select a record in the One table
> 2.  Run a standard query to get the related records in the Many table
> 3.  Run Query Selection By Formula on the Many table where the formula uses 
> nothing from the One table at all
> 
> The current record and entire selection of the One table is lost. You don’t 
> even need step 2. Just run Query By Formula on the Many table. Even though 
> the formula has nothing in it that touches the One table, the One table’s 
> selection is cleared. It works fine in standalone.
> 
> I discovered this in v16 R2 but it’s also a problem in v13.5. Has anyone else 
> seen this problem?

Hi Rich,

I have seen this too. It’s a bug or difference in how single user and 
client/server works. I hate when there is a difference like this. It’s hard to 
track it down. 

I remember getting bitten by this issues some years ago and could not reproduce 
the problem. Always testing in single user developer mode. Lesson learned from 
this. Gotta do testing in client/server mode to make sure things work exactly 
like they do when you are testing in development. 

In most cases the “environment” is the same for a process in single-user and 
client/server. But sometimes it’s not. I guess this is an example of how 
executing on the server the “environment" is not exactly the same. 

What throws you off is if you do “execute on server” for a method and use 
pointers as parameters, 4D is kind enough to transfer the pointer values to the 
server “environment” for you so that it still works. 

The quirks and gotchas of the 4D world.

Tim

Tim Nevels 
timnev...@mac.com 
Innovative Solutions
785-749-3444


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

Re: ORDA question: how do I add related fields to an entity selection?

2018-08-01 Thread Tim Nevels via 4D_Tech
On Aug 1, 2018, at 9:49 AM, Jeremy French wrote:

> Try creating 2-tables with a one-to-many relation. Say "Owner" (one table) 
> and "Item" (many table.)
> In the Relation Inspector, name the relations:
> 
> Many to one as "theOwner"
> One to many as "theItems"
> 
> Don't forget to restart 4D before examining in the Debugger. With ORDA, any 
> structure change requires restarting 4D to be recognized.

They really need to fix that. 

Reminds me of how custom constants work. Such a PITA to have to restart to be 
able to use a newly created constant. So much a PITA that I’ve avoided custom 
constants because of it. And thus far 4D has never addressed that. 

Hope they treat ORDA differently than they have done with custom constants. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Changes to variable initialization in v16?

2018-08-01 Thread Tim Nevels via 4D_Tech
On Aug 1, 2018, at 9:49 AM, Noah wrote:

> Is is really 'that bad' to run in interpreted mode?

No. The real question to answer “is the application working and are the users 
happy?” If the answer is “yes” then who cares if it is compiled or not? 

Same goes for typing variable with “All variables are typed”. Sure it is the 
preferred, best practices thing to do. But if the application is working fine 
without it… who cares, really?

There will always be some that “require” that things be done a certain way, or 
they have what Larry David once said on his show Curb Your Enthusiasm “a tickle 
in their anus”. :)

If your’s feels fine, I wouldn't worry about it and continue enjoying using 4D 
the way you are now. That’s one of the great things about using 4D. There is 
not just one way to use it, there are many ways. Each with advantages and 
disadvantages. 

But do not complain in the future if not following these recommended best 
practices bites you in your anus. You’ll get little sympathy here. :)

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: v13 - Record to Blob?

2018-07-30 Thread Tim Nevels via 4D_Tech
On Jul 30, 2018, at 2:00 PM, Chip Scheide wrote:

> I do not see a command that allows this action (directly)
> am I missing something, or do I need to write something?

No 4D native command. You need Rob’s “API Pack” it has command to go "API 
Record to BLOB" and “API BLOB to Record"

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Orphaned blobs and SSD drives

2018-07-29 Thread Tim Nevels via 4D_Tech
On Jul 29, 2018, at 5:46 PM, John Baughman wrote:

> In planning for upgrading a client fo v16 I noted that the datafile needed to 
> be compacted so included a compact in my upgrade plan.
> 
> A few days before I was to do the upgrade my client replace the server’s hard 
> drive with an SSD. Ok, so when it came time to do the compact I noted that it 
> no longer told be that the datafile needed to be compacted. I ignored that 
> and proceeded to compact the datafile. As luck would have it the compact 
> failed due to orphaned blobs in one of the tables.
> 
> In my research of how to fix this problem I ran across this statement in a 
> tech note on the subject from 2011 (http://kb.4d.com/assetid=76195)…
> 
>   Note: Solid State Disk (SSD) drives do not face this challenge, so 
> there is actually no need to compact the data file on an SSD. In fact we 
> recommend NOT compacting the data file on an SSD because it contributes to 
> drive wear. For more information see Technical Note 10-09, SSDs and 4D v11 
> SQL.
> 
> Interesting! So I won’t try the compact again, but should I be worried about 
> the orphaned blobs? I think not, the database is working fine. Fixing the 
> orphans per the tech note involves compacting the address table for the table 
> in question. If I don’t need to do that I don’t particularly want to go down 
> that road.

That is interesting. But I think I would still compact occasionally, 
particularly if you do a mass deletion of records. It reduces the size of the 
data file, and that makes duplicating the data file faster. 

Orphaned blobs are not serious. They are due to a bug in 4D. It’s not really 
corruption. It’s just some blobs — the ones attached to blob fields that you 
have set to store the blob outside the record but in the data file — are 
hanging around in the data file and they are not attached to any records. They 
are like crumbs laying on the floor. If you don’t mind a little dirt on the 
floor no big deal. If you like a clean floor, then you want to remove those 
unused and unneeded orphan blobs. 

I certainly hope 4D has fixed the bug that caused these orphan blobs to appear. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Confused about ORDA

2018-07-29 Thread Tim Nevels via 4D_Tech
On Jul 29, 2018, at 2:00 PM, Rudy Mortier wrote:

> I am a bit confused… isn’t ORDA supposed to be faster than traditional 
> queries?
> 
> I did a test with a table containing 120,000 records. The query is on 4 
> indexed fields and returns 54,000 records.
> 
> Doing the query with ORDA takes 175 milliseconds.
> Doing the query with QUERY takes 4 milliseconds.
> 
> Why??
> 
> ORDA:
> $oQRYoption:=New object("queryPlan";False;"queryPath";False)  
> 
> $oTLD:=ds.T_Loggers_data.query("TLR.FK_REAP =:1 AND TLD_timestamp >=:2 AND 
> TLD_timestamp <=:3 AND Excluded 
> =:4";[REAP_sections]FK_REAP;$TSsectionStart;$TSsectionEnd;False;$oQRYoption)  
>  
>   
> 
> Traditional:
> QUERY([T_Loggers_data];[T_loggers_readings]FK_REAP=[REAP_sections]FK_REAP;*)  
> 
> QUERY([T_Loggers_data];[T_Loggers_data]TLD_timestamp>=$TSsectionStart;*)
> QUERY([T_Loggers_data];[T_Loggers_data]TLD_timestamp<=$TSsectionEnd;*)
> QUERY([T_Loggers_data];[T_loggers_readings]Excluded=False)

Might be the same reason a query run from the native 4D language is ALWAYS 
faster than the same query done via 4D SQL. The reason… the time to parse the 
raw text and convert that into a form the 4DDB engine needs. 

Example:

QUERY([Patients];[Patients]LastName="smith”)

4D can very easily convert this line of code into 4DDB code and then execute it 
because it is already tokenized by the method editor. Parsing is very easy. 
Nothing to look up. It knows it has a valid table number and a valid field 
number. Making the 4DDB engine code is then fairly easy. 

C_LONGINT($recordsInSelection_l)
Begin SQL
  SELECT COUNT(*) FROM Patients 
  WHERE LastName = 'smith' 
  INTO :$recordsInSelection_l
End SQL

4D must take the text "SELECT COUNT(LastName) FROM Patients WHERE LastName = 
'smith' INTO :$recordsInSelection_l” and parse it. It has to figure out what 
are the field names and convert them to a field number, figure out what is a 
table name and convert that to a table number and parse the WHERE clause. Once 
it knows all that it can build the 4DDB engine code needed to make it happen. 
All that takes some milliseconds.

That’s my understanding. Miyako or JPR and the 4D gurus that know the guts of 
4D better than I can correct me where I’m wrong. 

ORDA has to do text parsing too. And it’s parsing is most likely much more 
complex than the SQL parsing. ORDA has so many more possibilities. I’d be 
curious to see the above comparison done in ORDA and see if it is as faster or 
slower that SQL. 

Also, it was never my impression that ORDA would result in faster execution 
times. It was always presented to me that ORDA was a tool for developers that 
would allow you to write code faster than you can now. Particularly when you 
need to do some complex operations. What takes many lines of native 4D code can 
new be done in a single line of ORDA. Faster for the developer, but maybe a tad 
bit slower on execution. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D v11 on Windows Server 2016 (Win 10 Clients)

2018-07-26 Thread Tim Nevels via 4D_Tech
On Jul 26, 2018, at 8:15 PM, Robert ListMail wrote:

> Apparently, the client did some testing in that regard, everything seemed to 
> work except the printing from 4D failed. I’ll just keep them going on the old 
> hardware until I’m ready to make the change to the new v17 version.

This is a known issue. Trying to print with Windows 8 and later results in text 
being the wrong size. Very tiny. The fix is to upgrade to at least 4D v13. Then 
printing returns to the way it was with v11. Text is the correct size. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

RE: 13.x Quick Report Export Max Output File Size?

2018-07-25 Thread Tim Nevels via 4D_Tech
On Jul 25, 2018, at 2:00 PM, Benedict, Tom wrote:

>> besides, Quick Report, as the name suggests, is for quick and simple tasks.
>> to be honest, I don't think it was designed to handle files larger than 4GB.
> 
> In that case I guess I'll have to write some code.

Don’t forget about EXPORT DATA(“”) command. You can easily dump the data with 
that from any table. All records or the current selection. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: WP SET ATTRIBUTES

2018-07-15 Thread Tim Nevels via 4D_Tech
On Jul 15, 2018, at 2:00 PM, Pat Bensky wrote:

> I'm  sending 4 Attributes (two pairs) plus the target object, so that seems
> correct to me ...
> 
> WP SET ATTRIBUTES ( targetObj ; attribName ; attribValue {; attribName2 ;
> attribValue2 ; ... ; attribNameN ; attribValueN} )

Hi Pat,

Notice the WP SET ATTRIBUTES command definition. Those semicolons “;” indicate 
individual parameters. You are trying to send 1 text parameter that is several 
text values separated by semicolons. You can’t do that based on the WP SET 
ATTRIBUTES command definition. The command requires 3 parameters to set 1 
attribName. Or you can pass in 5 parameters to set 2 attribName and 
attribValue. You want to set 3 attribNames, pass in 7 parameters. 
 
Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: Execute on Server Method Attribute

2018-07-14 Thread Tim Nevels via 4D_Tech
I would start simple. First be sure to declare the parameters with compiler 
directives. 

Then modify the method to only use a single text parameter. Change the 
parameter declarations too. Just for testing purposes. Test it. If it does not 
generate an error with 1 parameter, add a second parameter and test again. 

Tim

Sent from my iPad

On Jul 14, 2018, at 2:00 PM, Stephen J. Orth wrote:

> I'm completely confused...
> 
> No matter how I send the parameters (pointer, variable, text string) into
> this method with the EOS attribute enabled, Server is complaining that I'm
> accessing a parameter that does not exist.
> 
> I've looked at the documentation and my method follows exactly what is
> outlined, so why is Server having an issue running this method?
> 
> Any input is GREATLY appreciated!!!
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WP SET ATTRIBUTES

2018-07-14 Thread Tim Nevels via 4D_Tech
The WP SET ATTRIBUTES command needs 5 parameters. You are trying to send it 
only 2 parameters. 

Tim

Sent from my iPad

> On Jul 14, 2018, at 10:12 AM, Pat Bensky wrote:
> 
> Using v17
> This works:
> 
> *WP SET ATTRIBUTES*(oCurrentRange;wk font;"Arial";wk font size;14)
> 
> ​so why doesn't this:
> 
> $attributes:=wk font+";"+*Char*(34)+"Arial"+*Char*(34)+";"+wk font size
> +";14"
> 
> *WP SET ATTRIBUTES*(oCurrentRange;$attributes)
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13 - new behavior, all dev windows closed

2018-07-09 Thread Tim Nevels via 4D_Tech
On Jul 9, 2018, at 6:24 PM, Chip Scheide wrote:

> when (re)opening a database all windows previously opened in the design 
> environment are closed.
> what did I do, and how do I get 4D to leave all the design windows open?


Hi Chip,

I can think of 3 things:

1) Remember that if the Option key is down when you are entering Design — 
however you cause that to happen — will open with no windows. This was a very 
long-time-ago fix for when you had a corrupt method or form open. Going into 
Design it would try to open the corrupt method or form and that would cause 4D 
to crash. So to get around this you held down the Option key so that you could 
get into Design and not crash. Then, if you were lucky, you could delete the 
corrupted item and continue life.

Classic example: You have an invisible button on a form that has the “Standard 
Action” of “Design”. You assign a keyboard shortcut to the button of 
"Command-Option-Y". So to drop into Design when the form is displayed you just 
press Command-Option-Y. Notice that option key.

I had to change the shortcut on my 4D applications to Command-Shift-Y to avoid 
the problem of no windows open in Design. I couldn’t press Command-Option-Y and 
release the Option key before it got to Design and closed all my previously 
opened windows. 

2) 4D stores in the .4DB file the open windows and their location in Design for 
each 4D user. They are not stored in a “prefs” text files on disk somewhere. I 
know this because I work on a project with multiple developers and we all 
connect to 4D Server with our own 4D user account. Everyone gets their Design 
environment open windows preserved when doing 4D Server Team Developer work. If 
I get a copy of the .4DB file and put it to my local machine and open it and 
drop into Design, all my windows reappear. 

So it could be structure file damage. Maybe MSC repair on the structure file 
will fix the problem. 

3) If you crash, or something goes wrong when you quit 4D, it will not save the 
open window in Design information. 

Tim

Tim Nevels 
timnev...@mac.com 
Innovative Solutions
785-749-3444


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

Re: Pointer to field using field name

2018-05-17 Thread Tim Nevels via 4D_Tech
On May 17, 2018, at 2:00 PM, Alan Tilson wrote:

> Thank you Koen, Dennis & Chip,
> 
> I probably should have said what I was doing...which is that I'm copying
> certain fields from a sister table with some of the same field names. So I
> step though all the sister table fields and load the values (except for the
> first one which is the ID field) into the primary field. So I hate to look
> through all the field names looking for the one I'm to fill even though it
> probably is fast enough.
> 
> Loading the info into arrays seems like a step in the right direction. But
> I just thought of another idea...using EXECUTE FORMULA to load the pointer
> rather than to use the field value.
> 
> Is there something wrong with this?
> 
> EXECUTE FORMULA("$pField:=->["+tablename+"]"+fieldname)
> 
> It seems to work and it also seems like it would be fast!

Yes this works, but it could have an issue when running compiled by using a 
local variable. Might be more “safe” to use “pField” instead of “$pField” for 
the variable name. 

Also this approach is a bit brittle because it relies on a hard coded table 
name and field name. Change either and this code will fail. That is the 
advantage of referencing tables and fields by number. Never a problem with 
changing the name. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

Re: setting up mirror

2018-05-15 Thread Tim Nevels via 4D_Tech
On May 15, 2018, at 2:00 PM, Charles Miller wrote:

> Thanks for your update. I assume you have a process on mirror that runs and
> delays itself for x amount of time. What happens if you try and create a
> second log but first has not been integrated. What do you do? Would you
> mind sharing code. I know it should be pretty simple, but I always would
> prefer not to re-invent the wheel. If so, can you email me privately.

Journal files that get created by the “New log file” command are automatically 
named with a unique name. The name has the sequence number in it. Example: 
Datafile[0004-0034].journal.

The first number between square brackets is related to the backup number. Each 
time you do a BACKUP the first number get’s incremented. The second number gets 
incremented with each call to “New log file”. 

> What my plan is to get a directory listing and then sort by date created

It is not necessary to sort by create date. The journal files names are 
designed and formatted so that you can sort by file name and always get the 
oldest journal files first. 

Create date can also be problematic because if you copy a group of files from 
one server to another. Sometimes the create date and modify dates of files get 
changed. Sometime not. I’ve not figured out exactly what triggers this 
sometimes change to file creation/modification dates when coping between 
machines. 

No need to over complicate things. 4D designed the log file/mirroring system so 
that you can rely on journal file names for sequencing and to ensure 
uniqueness. 

Tim

*
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*

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

  1   2   3   >