CALL FORM: Some notes on a command that's easy to misunderstand

2017-03-16 Thread David Adams via 4D_Tech
I've seen CALL FORM come up in some recent threads where people have
mistaken ideas about how it works. I think that the mistakes are entirely
natural when coming from CALL PROCESS/On Outside call. I was going to add
some comments to the docs, but I just looked and don't see how you do it.
Presumably there's something you need to log into first (?) Instructions
appreciated. For now, here are a few notes:

Q: What form event is triggered by CALL FORM?
A: None.

Q: How does the form method know it's being called via CALL FORM?
A: Trick question. The form method isn't called. You specify what method is
called in the CALL FORM command itself.

Q: What does CALL FORM have to do with CALL PROCESS and On Outside Call?
A: In most cases, it replaces them with a superior mechanism. The old tools
still work, but CALL FORM offers a lot more possibilities and much better
reliability and control.

That's some basic stuff - and I think I'm just highlighting what the docs
already say. Conceptually, I think it's helpful to think of the command as

CALL FORM WINDOW

The "message queue" (see more below) *does not belong to the form.* When
you CALL FORM, *it is not the form that catches the call.* You can prove
this for yourself pretty easily. Here's a write-up I sent to Thomas Maul
for comment:

C_LONGINT($winref)
$winref:=Open form window("MyForm")
CALL FORM($winref;"MyForm_Setup";"Call form method parameter")
DIALOG("MyForm")

The queue is able to receive a message as soon as the window is defined and
before any form is associated with the window. That’s fine, but I wondered
about processing sequence. I tried it out and here is what I found:

* You can post a message to the queue before the form is opened (as in your
demo.)
* On Load executes.
* Then the pre-posted message is executed.

If you post a message to the queue from within On Load, then it is executed
after the message posted before the form was opened.

All of this behavior seems perfectly sensible to me, but it isn’t
documented one way or the other. Is this sequence of events something that
we can rely on? I expect that some 4D developers using this tool are very
likely to find it important exactly how On Load and the queue are sequenced.

Thomas very kindly got an answer about this from 4D Engineering. I think it
translates more-or-less exactly as "yes" ;-) So, this is a reliable
behavior:

* Open window
* Post calls with CALL FORM _even though there is no form_
* Load a form
* Post more events in On Before
* On Before finishes
* The calls posted _before_ the form opened run
* The calls posted _within_ On Before run.

Confusing? A little, but try it out - it's not bad at all. Here's what I
recommend:

* Open window
* Open form
* Run On Before and do what you need directly

Much easier to follow.

A bit more about the 'queue'. A message queue is normally a block of data -
think a bunch of parameters formatted as JSON, in some binary format, XML,
etc. That's not what 4D's "messages" are, they're commands. In fact, the
best names for the new commands are probably these:

EXECUTE METHOD IN WINDOW
EXECUTE METHOD IN WORKER

That's what's really happening. When you call a window or a worker, you're
pushing a line of code over for execution *within* that worker or window.
So, the code comes from the outside and is executed in the context of the
target window or worker. It has nothing to do with the form itself, from
out point of view.

There's a ton more to say about all of this, but that's all I've got time
for now.

Questions, comments, and corrections are very welcome. I think that these
new commands are great and that people should get excited about them. Just
playing with them for a couple of hours when you're relaxed is probably
enough to give you the bug. So, please, kick off questions and thoughts -
there are tons of great uses for these commands - I'd love to hear what
people are doing. Particularly simple things. I suck at simple examples...I
tend to write long...but everyone knows that already ;-)
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Problem accessing 4D via ODBC and Excel Power Query

2017-03-16 Thread rooftop99--- via 4D_Tech
Hi All,

(All Windows, 4D server v15.2, 32 bit Excel and 4D ODBC driver)

We use Excel to access data in our 4D database via ODBC.  Works great, except 
when we try and use the Excel add-in Power Query.  It generates a connection 
error: 

Unable to Connect
We encountered an error while trying to connect.
Details: “ODBC: ERROR [HY02470] Invalid attribute value: Invalid attribute 
value.”

Anyone else having this issue and know of a solution?

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

RE: 4D Server - Not letting go of users

2017-03-16 Thread Randy Engle via 4D_Tech
Hi Lahav,

Thanks for the note.
I'm pretty sure we are using the legacy network layer
But I'll check.

Thanks

Randy Engle
XC2 Software LLC


-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of lists via 
4D_Tech
Sent: Thursday, March 16, 2017 12:30 PM
To: Randy Engle via 4D_Tech <4d_tech@lists.4d.com>
Cc: lists 
Subject: RE: 4D Server - Not letting go of users

Hi Randy,

I see this quite a bit, and it has something to do with the new network layer.  
I have reported it to tech support, but never really saw the issues resolved.

The problem goes away if I use the legacy network layer.

Cheers,

Lahav



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

RE: 4D Server - Not letting go of users

2017-03-16 Thread lists via 4D_Tech
Hi Randy,

I see this quite a bit, and it has something to do with the new network layer.  
I have reported it to tech support, but never really saw the issues resolved.

The problem goes away if I use the legacy network layer.

Cheers,

Lahav

-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Randy Engle 
via 4D_Tech
Sent: March 16, 2017 1:25 PM
To: '4D iNug Technical' <4d_tech@lists.4d.com>
Cc: Randy Engle <4d.l...@xc2.us>; bob.mil...@parker.com
Subject: RE: 4D Server - Not letting go of users

Bob,

Yes!
This is what I'm referring to.

How come, why for?
What can we do?  
Anybody got an idea?

Thanks

Randy Engle
XC2 Software LLC


-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of bob.miller--- 
via 4D_Tech
Sent: Thursday, March 16, 2017 12:05 PM
To: 4d_tech@lists.4d.com
Cc: bob.mil...@parker.com
Subject: Re: 4D Server - Not letting go of users

RE> If a client/user does a force quit (i.e. Task Manager)

Just yesterday I had a problem where we had some 'license count exceeded' 
messages - very rare - and I noticed that we had people who were logged in for 
days.  Some had force-quit and others had simply closed their remote desktop 
sessions, but 4D Server never released them.  This is with Windows v15r4.


Bob Miller
Chomerics, a division of Parker Hannifin Corporation




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

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

RE: 4D Server - Not letting go of users

2017-03-16 Thread Randy Engle via 4D_Tech
Bob,

Yes!
This is what I'm referring to.

How come, why for?
What can we do?  
Anybody got an idea?

Thanks

Randy Engle
XC2 Software LLC


-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of bob.miller--- 
via 4D_Tech
Sent: Thursday, March 16, 2017 12:05 PM
To: 4d_tech@lists.4d.com
Cc: bob.mil...@parker.com
Subject: Re: 4D Server - Not letting go of users

RE> If a client/user does a force quit (i.e. Task Manager)

Just yesterday I had a problem where we had some 'license count exceeded' 
messages - very rare - and I noticed that we had people who were logged in for 
days.  Some had force-quit and others had simply closed their remote desktop 
sessions, but 4D Server never released them.  This is with Windows v15r4.


Bob Miller
Chomerics, a division of Parker Hannifin Corporation




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

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

Re: Host Structure in a component-Enhancing 4D Code-you really want to see this

2017-03-16 Thread bob.miller--- via 4D_Tech
Hi Nigel,

One word:  Niice!

How did you insert an event 'on object method close', when you added code 
to the button?


Bob Miller
Chomerics, a division of Parker Hannifin Corporation 




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

Re: 4D Server - Not letting go of users

2017-03-16 Thread bob.miller--- via 4D_Tech
RE> If a client/user does a force quit (i.e. Task Manager)

Just yesterday I had a problem where we had some 'license count exceeded' 
messages - very rare - and I noticed that we had people who were logged in 
for days.  Some had force-quit and others had simply closed their remote 
desktop sessions, but 4D Server never released them.  This is with Windows 
v15r4.


Bob Miller
Chomerics, a division of Parker Hannifin Corporation




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

Re: v13 MSC Maintenance Mode Activation—Mac.

2017-03-16 Thread Benedict, Tom via 4D_Tech
Hi Robert ListMail < >

>I’ve got a v13-based single-user web-serving 4D database running on a headless 
>Mac server (in a land far,
>far away) that I maintain via Mac Screen Sharing. Recently I’ve been unable to 
>launch MSC in
>Maintenance Mode (via option key depressed at startup) . Any ideas?

This is a bit of a long shot…

Any chance you can put a copy of 4D Server on that machine? I think it will run 
even if you don’t have a license. You can launch MSC from the menu.

HTH,

Tom Benedict
Optum

This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D Server - Not letting go of users

2017-03-16 Thread Charles Miller via 4D_Tech
On Thu, Mar 16, 2017 at 1:27 PM, Randy Engle via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> If a client/user does a force quit (i.e. Task Manager),
> Their user account on 4D Server persists, and takes up a license.
> I used to think that these would fall off in a short amount of time, but I
> found some that were 2-3 days old.
>
> Of course, if server is restarted, all is fine.
>
> This is Windows Server 2012
> 4D Server 15.3
>
> (Maybe 15.4 fixes this, I haven't checked.)
>
> Anybody else experience this?
>
> Thanks
>
> Randy Engle
> XC2 Software LLC
>

I think it depends upon setting on server re client time outs if you have
unlimited they may never drop off. You could kill the user

Regards
Chuck


-- 
-
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D, Sybase & SQL Sever connectivity
  http://www.informed-solutions.com
-
This message and any attached documents contain information which may be
confidential, subject to privilege or exempt from disclosure under
applicable law.  These materials are intended only for the use of the
intended recipient. If you are not the intended recipient of this
transmission, you are hereby notified that any distribution, disclosure,
printing, copying, storage, modification or the taking of any action in
reliance upon this transmission is strictly prohibited.  Delivery of this
message to any person other than the intended recipient shall not
compromise or waive such confidentiality, privilege or exemption
from disclosure as to this communication.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Host Structure in a component-Enhancing 4D Code-you really want to see this

2017-03-16 Thread Nigel Greenlee via 4D_Tech
Hi

Thanks(scroll down for link to a nice video)

Dont really know what was going on. Think i was being blind to an accidental 
reference to $tableNums. All working now.-replaced the locals with process vars 
and tidied it up and its all good. 

Incidentally i had lots of fun with updating records using an execute immediate 
statement with a built line of the update where part of the update was a long 
bit of text that contained sections lifted from my code-all kinds of characters 
i there, even wrapped in [ ] i was getting errors-changed to not using 'execute 
immediate’ and my errors went away.

Does anyone know a better way of to check if the table/structure exists.? i 
currently call this..and other than a Session Variable(<>DIff_bo_TablesChecked) 
don’t know of a way to avoid it

Begin SQL
CREATE DATABASE IF NOT EXISTS DATAFILE  <>; 
 Use LOCAL DATABASE DATAFILE  <> AUTO_CLOSE;  
EXECUTE IMMEDIATE :SQLTEXT;
Use database SQL_Internal;
End SQL


This code is for my own Code Manager. I have existing and long standing code 
that runs on my system setting method headers and saving out copies of the code 
and writing to a changes document a summary of the changes to a method. This 
code has always been a bit slow(there is a detectable delay as you close 
methods)

 I have always been guilty of forgetting to type my variables  and inspired by 
a comment on here about extracting variables from a method returned to a half 
baked piece of code I had that did the same..the difference was I want to 
extract not just locals i want to extract all the variables and make sure 
declarations are made at the top of methods. 

Being a bit obsessive I have been beating through this in my spare time over 
the past couple of weeks. Extracting Locals and interprocess variables was 
pretty easy the challenge was how to successfully extract variables. I was 
EVENTUALLY happy with the result of this(plenty of gotchas along the 
way)-having a method that ran over all my code and build the declarations.

The problem then was that it too was a bit slow-parsing a long method line by 
line uncompiled is just never going to be rocket fast so I wanted to move it to 
a component. I already had a component as part of my code manager because 
DIFFING two methods(based on 4D code published by David Dancy) was REALLY slow 
uncompiled and I had put that in a component.

I slowly moved parts of my 'variables extractor’ to the component till i had 
something that could be included in my code manager to build the variables on 
method save-now i can extract the variables from even in a large method in just 
about no time.

The SQL code I was working on was to  to store the history of changes in an 
external structure(I had already started on that-previously this was written 
out to a document and of limited use). Moving them to an external database 
means I can now easily create a view of method changes to show all the history 
of a piece of code, and do some things around that(fix/revert/report etc) 
...thats my next little side project.

 The compiled component code manager is now working the way I want and this 
nicely enhances my code

I thought i would share a little video of what happens in my code…

https://www.dropbox.com/s/j5x0vy45j1ikocg/Automatical%20Typing%20of%20variables.mp4?dl=0
 


Answers to inevitable questions:-

Did i have to change my structure to do this? Not at all. The are a couple 
methods in my host code-less now than before the component and I hoping to 
reduce them down further as well.

How does it know the type of the variables? I use a naming convention so it 
recognises by the variable type..if you have no naming convention it would be 
hard to do. I read the compiler directives as well

What about $1 etc? it recognises them by assignment(or from the compiler 
directives).  Almost always my code has $_l_MyVariable:=$1(In the top of the 
code) so we can deduce that $1 is a longint(and $_l_MyVariable:=$1-> means $1 
is a pointer!). I have considered using assignments to work out the type of all 
variables-but as I use a naming convention It was work I did not need to do.

What about ‘badly’ named variables. If i lazily type For($i;1;…)..old habits 
die hard! then the code wont know what the variable is so will declare 
//C_UNKNOWN..so i can just find them and fix ‘em..-

Could a different naming convention be used? Yes. -i have currently hard coded 
my naming convention but i plan to change that to pick up a document in which 
any naming convention can be defined

Could a different header model by used Yes-again i currently have my 
headers(different rules for project methods, form methods, triggers, object 
methods) hard coded  i also plan to change this to pick up the header 
definitions from documents.

What about if there are methods you don’t want this to happen in. I have a few 
method like that-as this code was in my 

v13 - Print settings and Setting Printers

2017-03-16 Thread Chip Scheide via 4D_Tech
I need some clarification please.

Docs for Set Current Printer say :
The SET CURRENT PRINTER command must be called before SET PRINT OPTION, 
so that the options available correspond to the selected printer. On 
the other hand, SET CURRENT PRINTER must be called after PAGE SETUP, 
otherwise the print settings are lost.

I make the following (in order) calls:
FORM SET OUTPUT($Table->;$Form)
PAGE SETUP($Table->;$Form)
SET CURRENT PRINTER($Printers{$Loc}) // where Printers{$Loc}) is an 
existing printer
PRINT SETTINGS

(all dialogs on OS X)
The first dialog (page setup) always says 
- Format for : Any Printer

The second dialog (Print job) shows the selected printer.

If I use a different printer (force code to select not the 
default/current printer)
The 'Page setup' dialog shows not the newly selected printer, but the 
old default printer; BUT the second dialog (print job) shows the newly 
selected printer.

If I called, in order:
PRINT SETTINGS(1)
SET CURRENT PRINTER($Printers{$Loc})
PRINT SETTINGS(2) or PRINT SETTINGS
The Page setup Dialog STILL shows format for 'any printer'


Is there some way to get these dialogs to agree - and present the SAME 
printer??

Thanks
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

4D Server - Not letting go of users

2017-03-16 Thread Randy Engle via 4D_Tech
If a client/user does a force quit (i.e. Task Manager),
Their user account on 4D Server persists, and takes up a license.
I used to think that these would fall off in a short amount of time, but I 
found some that were 2-3 days old.

Of course, if server is restarted, all is fine.

This is Windows Server 2012
4D Server 15.3

(Maybe 15.4 fixes this, I haven't checked.)

Anybody else experience this?

Thanks

Randy Engle
XC2 Software LLC



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

RE: tab seperated text - what to use for Cr

2017-03-16 Thread Chip Scheide via 4D_Tech
easy to get...

I am going to do a simple substation:
Cr will be replaced by ""

The users can 'read' it, and understand, the spacing will help to act 
like a return, and replacement in excel (or other program should be easy

Thanks everyone
On Thu, 16 Mar 2017 08:41:14 +, Epperlein, Lutz (agendo) via 
4D_Tech wrote:
> The easiest way to get what Excel wants to get, is creating example 
> data in Excel and exporting it as a tab delimited file.
> 
> The problematic characters are line wraps, tabs and quotes inside a cell.
> 
> The rules:
> 
> - field delimiter is tab, record delimiter is CR LF (0x0d 0x0a)
> 
> - Tabs inside cells are not allowed in tab delimited format.
> 
> - line wraps in cells are encoded as LF (0x0a), the whole cell 
> content is enclosed in double quotes (0x22)
> 
> - double quotes in cell content are escaped with double double quotes 
> and again the cell is wrapped in double quotes
> 
> 
> 
> Example:
> 
> "first line
> 
> second line"abc tab
> 
> do or don't "some text ""quoted""."
> 
> 
> 
> Hex view:
> 
> 000 22 66 69 72 73 74 20 6c 69 6e 65 0a 73 65 63 6f  >"first line.seco<
> 
> 020 6e 64 20 6c 69 6e 65 22 09 61 62 63 20 74 61 62  >nd line".abc tab<
> 
> 040 0d 0a 64 6f 20 6f 72 20 64 6f 6e 27 74 09 22 73  >..do or don't."s<
> 
> 060 6f 6d 65 20 74 65 78 74 20 22 22 71 75 6f 74 65  >ome text ""quote<
> 
> 100 64 22 22 2e 22 0d 0a >d""."..<
> 
> 
> 
> HTH
> 
> Regards Lutz
> 
> 
> 
> 
> 
>> -Original Message-
> 
>> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Tim 
>> Nevels via
> 
>> 4D_Tech
> 
>> Sent: Wednesday, March 15, 2017 8:39 PM
> 
>> To: 4d_tech@lists.4d.com
> 
>> Cc: Tim Nevels 
> 
>> Subject: Re: tab seperated text - what to use for Cr
> 
>> 
> 
>> On Mar 15, 2017, at 2:00 PM,Chip Scheide wrote:
> 
>> 
> 
>>> I am trying to export some data to tab separated format.
> 
>>> it is possible that there are carriage returns in the data.
> 
>>> Is there a character (or combination) that I can use to replace the
> 
>>> return to get excel to automatically wrap the text into one cell?
> 
>> 
> 
>> “Space" will work and had no cross-platform macOS/Windows Excel 
>> issues. I do this
> 
>> whenever
> 
>> 
> 
>> You might also try option-space if you are on macOS. That used to 
>> represent a “hard
> 
>> space” that some Mac software would recognize and treat like a “
>> soft return”. You
> 
>> would have to do some testing to verify how current versions of 
>> Excel handle this and
> 
>> how it is handled on Windows.
> 
>> 
> 
>> On Windows Excel will handle alt-Enter as a special line break 
>> character. But I believe
> 
>> this is just a LF ― line feed, char(10) ― character so it may be 
>> problematic since end
> 
>> of record delimiters are typically CR+LF.
> 
>> 
> 
>> 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: http://lists.4d.com/mailman/options/4d_tech
> 
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> 
>> *
> 
>> *
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: tab seperated text - what to use for Cr

2017-03-16 Thread Epperlein, Lutz (agendo) via 4D_Tech
The easiest way to get what Excel wants to get, is creating example data in 
Excel and exporting it as a tab delimited file.

The problematic characters are line wraps, tabs and quotes inside a cell.

The rules:

- field delimiter is tab, record delimiter is CR LF (0x0d 0x0a)

- Tabs inside cells are not allowed in tab delimited format.

- line wraps in cells are encoded as LF (0x0a), the whole cell content is 
enclosed in double quotes (0x22)

- double quotes in cell content are escaped with double double quotes and again 
the cell is wrapped in double quotes



Example:

"first line

second line"abc tab

do or don't "some text ""quoted""."



Hex view:

000 22 66 69 72 73 74 20 6c 69 6e 65 0a 73 65 63 6f  >"first line.seco<

020 6e 64 20 6c 69 6e 65 22 09 61 62 63 20 74 61 62  >nd line".abc tab<

040 0d 0a 64 6f 20 6f 72 20 64 6f 6e 27 74 09 22 73  >..do or don't."s<

060 6f 6d 65 20 74 65 78 74 20 22 22 71 75 6f 74 65  >ome text ""quote<

100 64 22 22 2e 22 0d 0a >d""."..<



HTH

Regards Lutz





> -Original Message-

> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Tim Nevels 
> via

> 4D_Tech

> Sent: Wednesday, March 15, 2017 8:39 PM

> To: 4d_tech@lists.4d.com

> Cc: Tim Nevels 

> Subject: Re: tab seperated text - what to use for Cr

>

> On Mar 15, 2017, at 2:00 PM,Chip Scheide wrote:

>

> > I am trying to export some data to tab separated format.

> > it is possible that there are carriage returns in the data.

> > Is there a character (or combination) that I can use to replace the

> > return to get excel to automatically wrap the text into one cell?

>

> “Space" will work and had no cross-platform macOS/Windows Excel issues. I do 
> this

> whenever

>

> You might also try option-space if you are on macOS. That used to represent a 
> “hard

> space” that some Mac software would recognize and treat like a “soft return”. 
> You

> would have to do some testing to verify how current versions of Excel handle 
> this and

> how it is handled on Windows.

>

> On Windows Excel will handle alt-Enter as a special line break character. But 
> I believe

> this is just a LF — line feed, char(10) — character so it may be problematic 
> since end

> of record delimiters are typically CR+LF.

>

> 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: http://lists.4d.com/mailman/options/4d_tech

> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com

> *

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

Re: tab seperated text - what to use for Cr

2017-03-16 Thread Aaron via 4D_Tech
In my excel version a tab delimited file as long as the field has DoubleQuotes,
then the tab delimited file can contain a LineFeed hex:0A in that field
Then it will not cause a row break, it will instead contain a new line within 
the cell.

If you don’t have the double quotes then excel will treat the LineFeed as a new 
row

Regards
Aaron


> On Mar 15, 2017, at 5:12 PM, 4d_tech-requ...@lists.4d.com wrote:
> 
> Send 4D_Tech mailing list submissions to
>   4d_tech@lists.4d.com
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>   http://lists.4d.com/mailman/listinfo/4d_tech
> or, via email, send a message with subject or body 'help' to
>   4d_tech-requ...@lists.4d.com
> 
> You can reach the person managing the list at
>   4d_tech-ow...@lists.4d.com
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of 4D_Tech digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: tab seperated text - what to use for Cr (Arnaud de Montard)
>   2. Re: tab seperated text - what to use for Cr (Chip Scheide)
>   3. Re:  tab seperated text - what to use for Cr (Tim Nevels)
>   4. Re: tab seperated text - what to use for Cr (Tilman Haerdle)
>   5. Weird variable (non-)refresh issue (bob.mil...@parker.com)
>   6. Re: Weird variable (non-)refresh issue (Jim Dorrance)
>   7. Re: tab seperated text - what to use for Cr (Keisuke Miyako)
>   8. Re: Weird variable (non-)refresh issue (Keisuke Miyako)
>   9. Re: Unique Files Verification Software (Bruno LEGAY)
>  10. Larry Sharpe (Lee Hinde)
>  11. RE: Larry Sharpe (Randy Engle)
>  12. Re: Larry Sharpe (Tom Dillon)
>  13. Re: Larry Sharpe (Douglas von Roeder)
> 
> 
> --
> 
> Message: 1
> Date: Wed, 15 Mar 2017 20:15:34 +0100
> From: Arnaud de Montard 
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: tab seperated text - what to use for Cr
> Message-ID: 
> Content-Type: text/plain; charset=utf-8
> 
> 
>> Le 15 mars 2017 à 19:46, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> a 
>> écrit :
>> 
>> I am trying to export some data to tab separated format.
>> it is possible that there are carriage returns in the data.
>> Is there a character (or combination) that I can use to replace the 
>> return to get excel to automatically wrap the text into one cell?
> 
> linefeed (char10)?
> 
> -- 
> Arnaud de Montard 
> 
> 
> 
> 
> 
> --
> 
> Message: 2
> Date: Wed, 15 Mar 2017 15:31:50 -0400
> From: Chip Scheide <4d_o...@pghrepository.org>
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: tab seperated text - what to use for Cr
> Message-ID: <20170315153150307794.d1310...@pghrepository.org>
> Content-Type: text/plain; charset=iso-8859-1
> 
> I tried that -
> it too creates a new row in excel when opened/imported.
> 
> On Wed, 15 Mar 2017 20:15:34 +0100, Arnaud de Montard via 4D_Tech wrote:
>> 
>>> Le 15 mars 2017 à 19:46, Chip Scheide via 4D_Tech 
>>> <4d_tech@lists.4d.com> a écrit :
>>> 
>>> I am trying to export some data to tab separated format.
>>> it is possible that there are carriage returns in the data.
>>> Is there a character (or combination) that I can use to replace the 
>>> return to get excel to automatically wrap the text into one cell?
>> 
>> linefeed (char10)?
>> 
>> -- 
>> Arnaud de Montard 
>> 
>> 
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 
> 
> 
> --
> 
> Message: 3
> Date: Wed, 15 Mar 2017 14:38:43 -0500
> From: Tim Nevels 
> To: 4d_tech@lists.4d.com
> Subject: Re:  tab seperated text - what to use for Cr
> Message-ID: 
> Content-Type: text/plain; charset=utf-8
> 
> On Mar 15, 2017, at 2:00 PM,Chip Scheide wrote:
> 
>> I am trying to export some data to tab separated format.
>> it is possible that there are carriage returns in the data.
>> Is there a character (or combination) that I can use to replace the 
>> return to get excel to automatically wrap the text into one cell?
> 
> “Space" will work and had no cross-platform macOS/Windows Excel issues. I do 
> this whenever 
> 
> You might also try option-space if you are on macOS. That used to represent a 
> “hard space” that some Mac software would recognize and treat like a “soft 
> return”. You would have to do some testing to verify how current versions of 
> Excel handle this and how it is handled on Windows. 
> 
> On Windows Excel will handle alt-Enter 

Re: Larry Sharpe

2017-03-16 Thread Charles Miller via 4D_Tech
On Wed, Mar 15, 2017 at 5:17 PM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> Larry passed away last week.. Obit here:  http://www.mtdemocrat.com/
> obituaries/larry-sharpe/  obituaries/larry-sharpe/>
>

Sorry to hear about this. My thoughts and prayers are with his family.

Chuck


-- 
-
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D, Sybase & SQL Sever connectivity
  http://www.informed-solutions.com
-
This message and any attached documents contain information which may be
confidential, subject to privilege or exempt from disclosure under
applicable law.  These materials are intended only for the use of the
intended recipient. If you are not the intended recipient of this
transmission, you are hereby notified that any distribution, disclosure,
printing, copying, storage, modification or the taking of any action in
reliance upon this transmission is strictly prohibited.  Delivery of this
message to any person other than the intended recipient shall not
compromise or waive such confidentiality, privilege or exemption
from disclosure as to this communication.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**