Updater v16

2017-10-10 Thread Sujit Shah via 4D_Tech
The manuals say

"in the application in production, call the RESTART 4D
 command:
this command triggers execution of a utility program named "updater" that
exits the current application, replaces it using the "pending" update if
one is specified, and restarts the application with the current data file.
The former version is renamed."

What does this magical "updater" actually do? what files must be included
in the update for it to work. Sorry its not immediately clear.

-- 

xxx
"There must be ingenuity as well as intention, strategy as well as
strength. "
**
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: Is Table Number Valid Cannot Validate New Temporary Table

2017-10-10 Thread Kirk Brooks via 4D_Tech
That's pretty cool - being able to get a pointer into a local var like
that.

On Tue, Oct 10, 2017 at 10:17 AM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> of course it works compiled :)
>
> > 2017/10/11 1:12、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> のメール:
> > Will that trick work compiled?
>
>
>
>
> **
> 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
> **
>



-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
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: NB: Pre-emptive mode hassle

2017-10-10 Thread David Adams via 4D_Tech
> This would be super useful!. Great feature that would make it much easier
to adapt methods so that they would run in
> preemptive mode. The 4D engineers probably never even thought about doing
something like this.

If you don't mind and are on the forums, would you mind putting in a
feature request? And, for what it's worth, it would be super weird if they
*hadn't* thought of this. The languages they write in have all kinds of
compiler pre-processing instrucxtions and compiler macros.

> I would suggest something like this:

> //%C-   to turn off compiling code
> SET TEXT TO PASTEBOARD($stuff_t)
> //%C+   to turn on compiling code

> That’s how you do it with range checking using //%R- and //%R+.

Nice! I was thinking of how you turn off warnings (look at
Compiler_Suppress_Warnings in our source if you don't know that one), but
your way is vastly better. It's actually a really exciting feature request
the way you have it, submit it!

> We have to remember to bring this up at 4D Summit next year in the Q
session so it is publicly directed at Laurent. You
> get him to publicly say “yeah, that is a good idea, we’ll do it”. That’s
the best way to cut through the red tape and get a
> new feature implemented.

Hmm. Yes. That sounds like an efficient way to manage software development.
Cough-cough. Hopeully, the feature request system has some value. (Time
will tell.)

> That is exactly the advice JPR gave at the 4D World Tour. If it ain’t
broke, don’t rewrite it!
> Use it for new code or if you have to redo things to get a performance
boost.

Fair point, but my point is a bit different: It is suprisingly hard to
reuse *any* code. Error handlers, utility methods, tons of stuff that we
all have around. And not for obvious reasons like showing UI. So then what?
You've got two different versions of your code to make one preemptively
safe? When the only difference is, say, the TRACE command. Duplicating
routines and making the drift apart is a bad sort of code decay. That's the
hardship, not the idea of writing fresh code for fresh problems.

> Too many developers go crazy when 4D adds some new features and get it in
their head they MUST
> rewrite everything to use the new features. That’s not perspective. I
think “nice, another tool
> in the toolbox that I can use for something new when I get the chance."

Honestly, I can't remember anyone I've met like that. Plenty of people dive
in to check out a new featureabout 6-12 months after they're
introduced. I doubt a lot of people are trying to use preemptive mode. Or,
if they are, they're not saying anything here.

> I'd love to hear from other people that are using preemptive processes
> regarding things they found that are good, bad, surprising, exciting, and
> me'h.

> CALL FORM. CALL FORM. CALL FORM. That’s the most useful new command I’ve
found.
Yes, it solves a lot of problems that I don't have ;-) I'm just not into
complicated 4D GUI work by choice. If I were doing that sort of thing, I'd
use CALL FORM for sure. (EXECUTE METHOD IN WINDOW.) The old Outside
Call/CALL PROCESS system was dangerous garbage. And don't get me started on
GET/SET PROCESS VARIABLE. Rob's IPC channels in NTK work great. The design
is better than CALL FORM and would be familiar to anyone that's used
conventially message queues. (You send messages, you don't push code into
another thread and expand it.) But plug-ins aren't thread-safe.
**
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: NB: Pre-emptive mode hassle

2017-10-10 Thread Tim Nevels via 4D_Tech
On Oct 10, 2017, at 1:16 PM, David Adams wrote:

> * TRACE is not thread-safe. It's also meaningless compiled. And yet, it
> blocks you. Why?

Probably the 4D engineers never thought to exclude it. It should be excluded 
since it has no impact when running compiled. 

> * SET TEXT TO PASTEBOARD is not thread-safe. I only use it for debug stuff,
> it would be nice to have an option to have a compiler declaration syntax to
> say something like:
> 
> // %i C:123
> ... or whateverlike the range check compiler comments. The idea being
> you can say "just compile this out, don't include it when you see it" and
> then the command number. (Made up number above.)

This would be super useful!. Great feature that would make it much easier to 
adapt methods so that they would run in preemptive mode. The 4D engineers 
probably never even thought about doing something like this.

I would suggest something like this:

//%C-   to turn off compiling code
SET TEXT TO PASTEBOARD($stuff_t)
//%C+   to turn on compiling code

That’s how you do it with range checking using //%R- and //%R+. 

And for all you byte hounds that strive to make everything as small as possible 
you could bracket all your debug code with this to reduce your compiled size.

We have to remember to bring this up at 4D Summit next year in the Q session 
so it is publicly directed at Laurent. You get him to publicly say “yeah, that 
is a good idea, we’ll do it”. That’s the best way to cut through the red tape 
and get a new feature implemented. 

> But it's going to be easier to write
> fresh code than rewrite or reuse old code in a lot of real-world databases,

That is exactly the advice JPR gave at the 4D World Tour. If it ain’t broke, 
don’t rewrite it! Use it for new code or if you have to redo things to get a 
performance boost. 

Too many developers go crazy when 4D adds some new features and get it in their 
head they MUST rewrite everything to use the new features. That’s not 
perspective. I think “nice, another tool in the toolbox that I can use for 
something new when I get the chance."

> I'd love to hear from other people that are using preemptive processes
> regarding things they found that are good, bad, surprising, exciting, and
> me'h.


CALL FORM. CALL FORM. CALL FORM. That’s the most useful new command I’ve found. 
And it works from any type of process. So super useful for interprocess 
communication. No more CALL PROCESS(-1) or using IP variables. Just CALL 
FORM($winRef_l;”methodName”;param1;param2;…). So clean and nice.

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
**

Re: NB: Pre-emptive mode hassle

2017-10-10 Thread David Adams via 4D_Tech
Thanks Tim!

More findings:

* I don't get it. I really am unclear how exactly things are supposed to be
set up. It's confusing, at least to me. I've tried diagrams and writing it
out...but I'm still not clear.

* I want to use the 'indifferent' execution mode everywhere I can, but
that's not working out.

* You cannot set execution mode in batch mode the way you can with the
invisible, etc. attributes.

* Dang, it's seriously time-consuming and hard to nail it down. Hopefully,
the tools will improve a lot in future versions. I have some optimism that
they will.

* TRACE is not thread-safe. It's also meaningless compiled. And yet, it
blocks you. Why?

* SET TEXT TO PASTEBOARD is not thread-safe. I only use it for debug stuff,
it would be nice to have an option to have a compiler declaration syntax to
say something like:

// %i C:123
... or whateverlike the range check compiler comments. The idea being
you can say "just compile this out, don't include it when you see it" and
then the command number. (Made up number above.)

* If you're building a component and you want the shared methods to be
accessible to preemptive methods in the host, it looks like you *must*
declare the component method as 'can be run in a preemptive', etc. The
'indifferent' option doesn't seem to work. That could be documented, I have
no idea.

And, as a reminder, no IP variables. For existing pseudo-constants, use
real custom constants instead:

Managing Custom Constants with Code
http://kb.4d.com/assetid=77806

All thanks and praise to Cannon!

With all of the above said, my biggest advice is *wait*. This stuff is
going to have to get better. (The compiler in particular.) If you have some
tasks where preemptive threads are going to be a big help (workers or
regular processes), fine, go for it. But it's going to be easier to write
fresh code than rewrite or reuse old code in a lot of real-world databases,
so try and start with something this is either 1) super simple or 2) mostly
based on new code.

I'd love to hear from other people that are using preemptive processes
regarding things they found that are good, bad, surprising, exciting, and
me'h.
**
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: San Fransisco Font

2017-10-10 Thread Alan Chan via 4D_Tech
Interesting, we don't actual use stylesheet. Back to old days (non-unicode), we 
need to assign different font for different languages. Due to different OS 
version and platform, we allow users to set font but not font size and saved by 
machine. These
setting has been embedded in our system for decades and still in place after we 
switched to unicode years ago. So far it works well with Traditional Chinese 
and Simplified Chinese. All other forms (input, output and printings) are set 
during on load
with Object set Font based on object name style.

Of course, this is not in v16 and not there yet.

Alan Chan

4D iNug Technical <4d_tech@lists.4d.com> writes:
>changing the font according to what you get from this,
>or any other ways to obtain the system font name,
>is going to fail when the app starts to display and accept text outside the 
>latin alphabet.

**
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: San Fransisco Font

2017-10-10 Thread Keisuke Miyako via 4D_Tech
> 2017/10/11 1:25、Richard Wright via 4D_Tech <4d_tech@lists.4d.com> のメール:
> I don’t recall seeing any such recommendation or discussion in the manuals. 
> I’ve been using the System Font in a couple of style sheets for years without 
> issues, for generic dialogs and buttons. It doesn’t make sense that one can 
> select it for a Style Sheet if 4D is recommending not to select it.
> I’m also not sure what you’re trying to convey with the links.
> I took a look at the Apple page on CTFont and don’t see any mention of a 
> System font, just a list of font functions.

the link is one step away from the list of constants that corresponds to the 
automatic stylesheet feature.

https://developer.apple.com/documentation/coretext/ctfontuifonttype?changes=latest_major=objc

as you can see, the list is pretty extensive.

the point I was trying to make was that a regular stylesheet with the system 
font name assigned
is not going to work the same way as the automatic stylesheet feature.



**
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: Deprecated Constants

2017-10-10 Thread Jeffrey Kain via 4D_Tech
We've left a few "During"s in place where it wasn't entirely clear how to 
replace it. Still works fine...

Most of them were easy to replace, but for a few of them it seemed best to 
leave the old code alone and flag it for a future rewrite.


--
Jeffrey Kain
jeffrey.k...@gmail.com




> On Oct 10, 2017, at 1:18 PM, John Baughman via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I know it was not recommended to use During even when it was not deprecated, 
> but if anyone else has used it, how have you managed it now that the form 
> event has been deprecated.

**
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: Deprecated Constants

2017-10-10 Thread John Baughman via 4D_Tech
By coincidence, I am cleaning up a v14 database for deployment this afternoon 
as a v16 R4 database. A couple of thoughts on your question…

> _o_Extras Folder

The extras folder was deprecated in v11 I think with instructions to 
use the Resource folder.

> The other 9 entries relate to List Box constants:

As for the List Box commands, you should be able to find suitable replacements 
in the List Box theme in the docs


I had several hundred _o_ items in my databases and was able to replace all of 
them except 1. The easiest way I have found to do this is with Find In Design 
and Replace in Context. For example. 
  
  Find in Design: _o_
Finds 100 calls to_o_STRING(20;$whatever)

  Find _o_String(20;
  Replace in Content:  TEXT(

The one that I am conflicted about is _o_During. I would really like to keep 
this one and have done so in other databases that I have deployed, but it makes 
me nervous doing so. Anyone else feel the same. It is hard to replace in some 
cases as During was a catch all event that was and is remains useful in certain 
situations. Being a catch all, it is difficult to determine what Form events to 
use to make sure in the replacement. I guess I could just use an Else.

I know it was not recommended to use During even when it was not deprecated, 
but if anyone else has used it, how have you managed it now that the form event 
has been deprecated.

John





> On Oct 10, 2017, at 6:31 AM, Douglas Cryer via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi all,
> 
> I just ran an upgrade to v16 (R5) to see what work might be required.  By far 
> the biggest issue will be images that still reside in the library.  Aside 
> from that I got 19 instances of constants that are now deprecated:
> 
> _o_Mac To ISO - 1 Instance no longer required…
> 
> _o_Extras Folder - 9 instances but could not find any mention of this in the 
> deprecated features.  What is the general migration policy as I assume the 
> Extras Folder will no longer be supported?
> 
> The other 9 entries relate to List Box constants:
> _o_lk_header height - used to be Listbox header height
> _o_lk_hor scrollbar position - used to be Listbox hor scrollbar position
> _o_lk_ver scrollbar position - used to be Listbox ver scrollbar position
> 
> also Listbox display header has not been deprecated but has now become lk 
> display header.  What is the “lk" ?
> 
> Any thoughts would be appreciated…
> 
> Regards,  Dougie
> 
> 
> telekinetix Limited- J. Douglas Cryer
> Phone : 01234 761759  Mobile : 07973 675 218
> 2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
> Email : jdcr...@telekinetix.com   Web : 
> http://www.telekinetix.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
> **

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.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: Is Table Number Valid Cannot Validate New Temporary Table

2017-10-10 Thread Keisuke Miyako via 4D_Tech
of course it works compiled :)

> 2017/10/11 1:12、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> のメール:
> Will that trick work compiled?




**
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
**

SuperReport Pro version 3.4 released

2017-10-10 Thread Philippe Ganter via 4D_Tech
SuperReport Pro version 3.4 is now available at http://www.e-node.net/srp

Version 3.4 includes the new "first line indent/hanging indent" and "keep 
together" properties, as well as many enhancements and fixes.

(and yes: version 4 beta, 64-bit is available in the private beta forum, feel 
free to request).

Best regards,
-- 
Phil
forums.e-node.net

**
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: NB: Pre-emptive mode hassle

2017-10-10 Thread Tim Nevels via 4D_Tech
On Oct 10, 2017, at 11:12 AM, David Adams wrote:

> Typical, my "summary" is longer than the original.

You are a true trail blazer, David. And you know what they say… trail blazers 
are the ones that take the arrows. And you are definitely bloody from all your 
preemptive process work. Possible new title: Bloody, angry man shaking his 
fist. :)

And you make a good point that this is version 1 of the preemptive stuff. A lot 
of missing features, bugs and work arounds needed. But I bet by 4D v18 all 
these preemptive issues will get worked out and it will then things will be 
much easier.

And keep those summary long. They usually contain a lot of valuable 
information. 

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
**

Deprecated Constants

2017-10-10 Thread Douglas Cryer via 4D_Tech
Hi all,

I just ran an upgrade to v16 (R5) to see what work might be required.  By far 
the biggest issue will be images that still reside in the library.  Aside from 
that I got 19 instances of constants that are now deprecated:

_o_Mac To ISO - 1 Instance no longer required…

_o_Extras Folder - 9 instances but could not find any mention of this in the 
deprecated features.  What is the general migration policy as I assume the 
Extras Folder will no longer be supported?

The other 9 entries relate to List Box constants:
_o_lk_header height - used to be Listbox header height
_o_lk_hor scrollbar position - used to be Listbox hor scrollbar position
_o_lk_ver scrollbar position - used to be Listbox ver scrollbar position

also Listbox display header has not been deprecated but has now become lk 
display header.  What is the “lk" ?

Any thoughts would be appreciated…

Regards,  Dougie


telekinetix Limited- J. Douglas Cryer
Phone : 01234 761759  Mobile : 07973 675 218
2nd Floor Broadway House, 4-6 The Broadway, Bedford MK40 2TE
Email : jdcr...@telekinetix.com   Web : 
http://www.telekinetix.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: San Fransisco Font

2017-10-10 Thread Richard Wright via 4D_Tech
I don’t recall seeing any such recommendation or discussion in the manuals. 
I’ve been using the System Font in a couple of style sheets for years without 
issues, for generic dialogs and buttons. It doesn’t make sense that one can 
select it for a Style Sheet if 4D is recommending not to select it. I’m also 
not sure what you’re trying to convey with the links. I took a look at the 
Apple page on CTFont and don’t see any mention of a System font, just a list of 
font functions.



Richard Wright
DataDomain
rwri...@datadomainsoftware.com


> Date: Tue, 10 Oct 2017 00:46:50 +
> From: Keisuke Miyako 
> 
> on the use of system font:
> 
> the only correct (that is, intended) way to use the system font in 4D is to 
> use it indirectly with the automatic stylesheet feature.
> 
> it is NOT recommended to use "system font" via the default stylesheet, or any 
> stylesheet, except the automatic stylesheet, or change an object's font to 
> "system font" using OBJECT SET FONT. all these features simply reference the 
> font by its name, but the system font is not just another font name, it is 
> more than that.
> 
> from a technical point of view, it is resolved via the Theme API on Windows
> https://msdn.microsoft.com/en-us/library/windows/desktop/bb773210(v=vs.85).aspx
> and CoreText API on macOS.
> https://developer.apple.com/documentation/coretext/ctfont?language=objc
> 
> the system font is rendered according to context, that is, the control (form 
> object) type, its size (notably its height) the screen DPI on Windows and 
> even the language or languages that appear in the text. if you simply apply 
> the SF font like any other font, you won't get the full benefit of the system 
> font feature.

**
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: [offish]Volume of mail

2017-10-10 Thread Kirk Brooks via 4D_Tech
You know it's not like the French Forum has a legion of posts either.

I just opened the 'v16 Corner' and the first 50 posts span from last Friday
to March (of this year). 50 topics in 7+ months. The 'Current
versions(v16-v15-R)' first 50 is from yesterday to July. These are the
English ones. The French area is a little more active.

At a glance I think this list is fairly representative at least of English
speaking users.

I'll say one thing for interacting via a mailing list - I like being able
to have iNug as a subfolder in one of my email accounts. Makes it easy to
search (I've got the iNug going back to '06), easy to interact with and I
don't have to log into something else. I still find the forums
unflatteringly reminiscent of '90s era forums though supporting images is
nice.

On Thu, Oct 5, 2017 at 12:44 PM, Randy Jaynes via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I think we’re all too lazy to get up and move all the way over to the 4D
> forums.
>
> I do go there for research and find the forums much more active, and with
> far many more users than we see here.
>
> And with 4D themselves pushing us in that direction, I see more and more
> of us who have been on this list for 20+ years posting less and less here.
>
> I don’t think it’s a diminished community because the forums certainly
> seem to be thriving, and I have to admit the ability to add links and
> images and so on makes it easier to illustrate our problems. What I _don’t_
> like is that it’s much more work to get it done.
>
> I think mailing lists are just a thing of the past and a few of us are
> holding on for all we’re worth.
>

-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
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: Is Table Number Valid Cannot Validate New Temporary Table

2017-10-10 Thread Kirk Brooks via 4D_Tech
Miyako,
Will that trick work compiled?

On Tue, Oct 10, 2017 at 9:06 AM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> why not simply use Get last table number?
>
> and you don't really need to use SQL to get a table pointer from name,
> just do something like...
>
> C_POINTER($p)
> $name:="Table_1"
> $formula:=""
> PROCESS 4D TAGS($formula;$formula;->$p)
>


-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
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: Is Table Number Valid Cannot Validate New Temporary Table

2017-10-10 Thread Keisuke Miyako via 4D_Tech
why not simply use Get last table number?

and you don't really need to use SQL to get a table pointer from name, just do 
something like...

C_POINTER($p)
$name:="Table_1"
$formula:=""
PROCESS 4D TAGS($formula;$formula;->$p)

> 2017/10/10 23:02、Mark Scardigno via 4D_Tech <4d_tech@lists.4d.com> のメール:
> Is there a workaround for this?



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

Re: NB: Pre-emptive mode hassle

2017-10-10 Thread David Adams via 4D_Tech
Right, I just scanned a big code base for methods passed to CALL WORKER
(some my code, some not) and found that 5 out of 7 won't run in preemptive
mode.

Oh crap.
**
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
**

Is Table Number Valid Cannot Validate New Temporary Table

2017-10-10 Thread Mark Scardigno via 4D_Tech
Hello,

I’m trying to use a temporary table in 4D but after creating the table 
successfully, "Is Table Number Valid" always returns, “Indice out of range” 
when I try to use the new table number. If the client logs out and then back in 
again, the table number is valid. Please see code below. Is there a workaround 
for this? 4D v15 R4

Regards,
Mark

$tmp_table_name:="TempTable_4dt"
$fields:="Code Int32, Title VARCHAR(80), Name VARCHAR(80)"

 // Create the temporary table
vSQL:="CREATE TABLE IF NOT EXISTS "+$tmp_table_name+" ("+$fields+")"

Begin SQL
EXECUTE IMMEDIATE :vSQL;
End SQL


If (OK=1)
FLUSH BUFFERS
 // Get the new temp table's number and a pointer to it for later
$tmp_table_num:=Util_GetTableNum ($tmp_table_name)

 // Check if we got a good table number.
If (Is table number valid($tmp_table_num))

 // * ERROR 

 // Indice out of range error when trying to get the table number. The table 
gets created but
 // the client can't see it. If the client logs out and back in again, then the 
table will be valid.

End if 
End if 

 // 
 // Util_GetTableNum

If (Count parameters=1)
C_LONGINT($0;vNum_I)
C_TEXT($1;$table_name)

vNum_I:=0

$table_name:=$1

Begin SQL
SELECT TABLE_ID 
FROM _USER_TABLES 
WHERE TABLE_NAME = :$table_name 
INTO :vNum_I
End SQL

$0:=vNum_I
End if 


**
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: Post Key command not working in converted 4Dv16 database

2017-10-10 Thread David Adams via 4D_Tech
Hey John,

Yeah, I pretty well guessed something like that was going on in your
case...I mostly answered for the sake of the archives. I often ask
questions and am offered well-meaning and sensible answers...but there's
almost as often a good reason why I'm bearing down on the particular point
raised. So, understood.
**
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: NB: Pre-emptive mode hassle

2017-10-10 Thread David Adams via 4D_Tech
Typical, my "summary" is longer than the original.
**
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: NB: Pre-emptive mode hassle

2017-10-10 Thread David Adams via 4D_Tech
To summarize the bit above:

-- If you pass non-preemptive code to a pre-emptive worker, it won't work.

-- That's not a bug, that's a limitation.

-- 4D doesn't automatically handle this situation well, but they've said
that they'll make ON ERR CALL work, which seems like a reasonable response.

-- The Compiler should check methods passed to workers. Maybe it will,
maybe it won't. I think that it should (obviously), but I don't get to
decide.

-- For now, what you need to do is remember to *manually* check code passed
to the second parameter of CALL WORKER. It's on us.

-- The easiest way that I've found to take this step is as follows:

* Create a method marked to run in preemptive mode. You don't run it, it's
just a place to expose code to the compiler.

* Use Find in Design to locate all CALL WORKER calls.

* Copy and paste in whatever methods you pass in the second parameter.
These are what get run through EXECUTE by the worker, once received.

* Use the compiler to check syntax.

Now you should see errors on the methods that are going to fail. A bonus
from doing things this way is that you get an error the *specific* methods
that are causing trouble. For those that don't know, when you compile 4D
scans the visible call tree for each method that _might_ be called from
within a preemptive process. However, it only reports specific errors at
the top level. It's pretty frustrating trying to figure out what the
problem is (don't forget triggers). The docs say that this is the way the
Compiler works, so it's not technically a bug (unexpected behavior.) It is,
however, a giant, time-sucking hole that makes getting code into preemptive
mode harder than it needs to be. Seems like a good feature request - the
compiler gathers the necessary information during its scan and then throws
it away and gives us a report that says "Something seems not okay?"

Anyway, that's the state of the art today.

P.S. Because of the silent failures in preemptive mode, your code may not
be executing at all. Or some of it might not be. Orit might be causing
problems. There's just no way to know without looking very, very carefully.
It's early days for preemptive mode, so I'd suggest you consider any work
with it experimental.
**
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: Post Key command not working in converted 4Dv16 database

2017-10-10 Thread John DeSoi via 4D_Tech
Hey David,

Right, CALL FORM will fix a lot of work-arounds needed for previous 4D 
versions. But my goal here is to have a single stable code base in 15 until 
making the move to version 16. I don't want to maintain two versions if I can 
avoid it. That said, I already have some v16 features embedded in specially 
encoded comments where I can easily activate the changes after the conversion 
from 15.

John DeSoi, Ph.D.


> On Oct 10, 2017, at 8:13 AM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hey John, if you still need to fix what you described, CALL FORM ought to
> work. Just past what method you want to run and the target window's form
> will run it through EXECUTE for you.

**
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: San Fransisco Font

2017-10-10 Thread Ortwin Zillgen via 4D_Tech
> I see from
> http://doc.4d.com/4Dv16/4D/16.1/Automatic-style-sheets.300-3373396.en.html
> 
> "Automatic style sheets manage the font as well as its size and color"
> 
> However, when I apply the "Automatic" style sheet I get a System Font 13
> for fields and variables which is way too large for the form design I have.
> Does this mean I have to redesign all the forms?

any fontsize below 13 points, maybe labes and smallprint at 11 points, is to 
small for todays screen-resoultions (±130 dpi) and many users eyes.




Regards
O r t w i n  Z i l l g e n
-
   
 
member of developer-network 

**
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
**

NB: Pre-emptive mode hassle

2017-10-10 Thread David Adams via 4D_Tech
I've finally tracked down a weird problem. I have some code that I'm
(still) trying to run in a worker. I've got the system set up so that I can
launch in cooperative or preemptive mode based on a setting. This way, if
there's a problem with preemptive mode, we can tweak a config setting and
try again in cooperative mode.

This is all working in tests.

But my overall system was failing to deliver in preemptive mode. The
preemptive worker launches just fine...by my subsequent calls to the work
fail, but only in preemptive (multi-thread/multi-core) mode.

I've got an ON ERR CALL installed that's thread-safe...but it never fires.

I think this is part of a bug I reported months ago regarding passing
non-thread safe code to a thread-safe worker. The compiler tries to stop us
from *compiling* such code, but the compiled mode runtime interpreter does
not. You can pass anything into a worker, even unsafe code. The exact
results at that point areundefined. I think that Thomas Maul said on
the forums that getting ON ERR working reliably in this situation would be
done. (I'm in R3, maybe it has been done.)

Anyway, the warning is this: You have to take extra steps to vet your code
because *the compiler does not inspect the statements that you submit
through CALL WORKER.* I think it's recently started testing that ON ERR
CALL methods exist in one situation, but that's the first and only time I'm
aware of that 4D sees arguments to EXECUTE (under whatever name) as
anything bug raw strings.

So, lesson relearned.

Anyway, what you need to do is look through your code and see any that
might be Unclean. The compiler is said to be able to dump out this
attribute for all methods. The other way is to create a method that is
marked to run in preemptive mode and then put calls to your other methods
in there. In this case, the compiler will flag any that are unsafe for you.

Kind of a hassle, but there it is.
**
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: Post Key command not working in converted 4Dv16 database

2017-10-10 Thread David Adams via 4D_Tech
Hey John, if you still need to fix what you described, CALL FORM ought to
work. Just past what method you want to run and the target window's form
will run it through EXECUTE for you.

doesn't mean that POST KEY shouldn't be fixed if it's broken, of course.
**
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: Post Key command not working in converted 4Dv16 database

2017-10-10 Thread John DeSoi via 4D_Tech
Ken,

I just ran into a problem with POST KEY in 16.2 that works without problems in 
15.4. An outside call message is sent from another process and POST KEY is used 
in in the outside call event to activate a menu item. For some reason it does 
not seem to work right unless I add DELAY PROCESS(Current process;1) after the 
CALL PROCESS command.

John DeSoi, Ph.D.



> On Oct 9, 2017, at 8:41 AM, Ken Daniel via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Koen & Steve, thanks for the tip, but in this case I am using POST
> KEY(Character code(".");Command key mask) and had the shortcut of Ctrl .
> assigned to a button. It only fails to work in this one converted database.
> I've converted another database to v16 for a different application and it
> works fine. I've compared the two databases and can't discern any
> difference. In another test, if I execute POST KEY (Character Code("a")), I
> can see it populate a variable field with the letter "a", but it just won't
> execute the code assigned to the button with that shortcut. Ken


**
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: Query By Attribute vs Map NULL values to blank values

2017-10-10 Thread David Adams via 4D_Tech
> I still do not get why the R4 documentation for Query by attribute
discusses how a # query will function if the "Map null
> to blank” checkbox is or is not checked it the checkbox does not exist
for an object field.

John, random thought: Object fields aren't supported in 4D's SQL. So any
SQL-specific features and such are completely meaningless for ojject
fields. And by "not supported" I don't mean ignored. If you do

SELECT * FROM MyTableWithAnObjectField;

4D freaks out because there's an object field. At least as late as R3.

This has come up a few times here and other people have looked at this in
detail. (I think that Jeff Kain, at thel least, has the details.) In my
case, I had to rewrite my ugly little SQL browser to scan the field list
for object fields and remove them from statements. That's okay for my
needs, but I'm not using 4D's SQL for anything real any longer.
**
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: Query By Attribute vs Map NULL values to blank values

2017-10-10 Thread Keisuke Miyako via 4D_Tech
it's probably an omission in the structure editor.

by default the property is on,
but you can change the field type to text or whatever, disable it, and switch 
back to object.

it sounds crazy but it should work.

> 2017/10/10 14:52、John Baughman via 4D_Tech <4d_tech@lists.4D.com> のメール:
>
> I still do not get why the R4 documentation for Query by attribute discusses 
> how a # query will function if the "Map null to blank” checkbox is or is not 
> checked it the checkbox does not exist for an object field.




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