Re: 4D Write Pro CSS

2017-04-22 Thread Keisuke Miyako via 4D_Tech
http://doc.4d.com/4Dv15/4D/15.4/Supported-tags.300-3274727.en.html

explains proprietary CSS attributes such as

 

and

Click here

> 2017/04/23 1:12、Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> のメール:
> its own subset of HTML/CSS attributes and tags, specified in this manual."




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

"Placeholder" in property list

2017-04-22 Thread Keith Goebel via 4D_Tech

> On 23/04/2017, at 5:03 am, Jeffrey Kain wrote:
> Has anyone noticed that in 15.4 (HF2... maybe others) there's a new property 
> for fields and variables called 'Placeholder' that automatically fills an 
> empty field with descriptive text in a light gray font color,…

They’re a great addition to the UI tools. 
I use them in 4D v15.2 and the users like them a lot!
(still using that version as Print Preview causes 4D to freeze in v15.4 - but 
it seems I am the only developer it happens to)
Cheers, Keith
**
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: Dynamic Method Creation & Content Changing

2017-04-22 Thread Nigel Greenlee via 4D_Tech
John

You should not really have much trouble with 4D SET METHOD..I Use it all the 
time(in development not in a live enviroment)

METHOD SET CODE($_t_methodName;$_t_MethodText)

just need to make sure method is not open in the design enviroment or you will 
get an error


Nigel
> On 22 Apr 2017, at 17:01, truegold via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hi Nigel,
> 
> I’m not sure if it would be easier to use foot runner. I do know that the 
> strategy I worked through works pretty well. Here’s the almost final result 
> (needs to be tested further)...
> 
> The send user has a UI and supplies two pieces of data: a study name 
> (actually an abbreviation or acronym) and a position in a string (1-80 
> positions) where the position will have a single character code. These become 
> part of the names of the list, list items, and methods.
> 
> With those two pieces of data I am able to auto-generate several new 4D 
> lists, insert into existing 4D list, create two new methods with code 
> formatted correctly, and…
> 
> I couldn’t figure out how to get the Method Set Code command working so I 
> used Rob’s API Create Method to create the new 4D methods. Works great!!!
> 
> I could not get API Set Method to work. In fact it always crashes in 4D v15r2 
> (Mac). So, at this time, I’ll have to 
> 
> I opted for just auto-generating the code fragments (new case dispatches with 
> a couple lines of code) and displaying them in three text variables. Each 
> text variable corresponds to the method that needs to be updated. I also auto 
> open the three methods so they don’t have to search for them. BTW, the user 
> currently has access to design and makes minor tweaks from time to time. This 
> won’t work in compiled but they’ve never run in compiled in over 25 years.
> 
> Then, for each text var, they can select all and copy the code fragment and 
> place it into the proper routine. All they need to do is go to the bottom of 
> the case dispatch and add these lines there. About as simple as it gets - and 
> yes they could still mess up.
> 
> If I could get Rob’s API Set Method to not crash (or understand how 4D’s 
> Method commands work) I might be able to fully automate it. But until...
> 
> Anyway what used to be a nightmare of steps and rereading of the cryptic docs 
> (and fraught with error) has been reduced to a minute or two exercise.
> 
> Exactly what I was after.
> 
> Finally, creating an new study is an infrequent exercise. So they might not 
> revisit this for another year or more. But when they do it’s now a simple 
> thing.
> 
> Appreciate,
> John...
> 
>> Its always an issue when you probably wish it was a different way but it has 
>> been written and now you have to deal with it..no budget for a proper 
>> redo..no will for it either!.
>> 
>> I would certainly consider though using Footrunner for code you you write(I 
>> don’t use footrunner as i have my own solution internal to my code)..i 
>> assume you can automatically create the footrunner document and that 
>> probably easier to ‘patch’ sections of code and sub-calls into than putting 
>> into 4D itself..and you could be running a compiled solution then.
> 
> **
> 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: Object visualize / browse

2017-04-22 Thread David Adams via 4D_Tech
On Sun, Apr 23, 2017 at 3:03 AM, JPR via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> [JPR]
>
> Hi David,
>

Thanks very much for your gracious answer. Enjoy the World (Northern
Hemisphere Edition) Tour!
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: components - questions about variable scope

2017-04-22 Thread Chip Scheide via 4D_Tech
so I started, on Friday... why I do not know  :)
I have a method that I am trying to move into a component it saves the user 
group to either a field in the (host) database, a disk file, or both.

Maybe im going about this with the wrong mindset, but, what I wanted to do was 
this:
"Save_User_group" is the component method

if (Save_User_group("Both";->File_Path;->[host]saved_user_group))
  // do something
else
  Access an error text populated by the component method
  display error message
end if

In the component method I test a variety of different file points
such as:
does the file path point to a non-text var or field
does the the save field point to a blob
is the current user authorized (admin or designer)

and if the method fails - give back to the host the error -- separately -
from the function value returned.


> 
>> Le 21 avr. 2017 à 23:41, Chip Scheide via 4D_Tech 
>> <4d_tech@lists.4d.com> a écrit :
>> 
>> I am working on my first component -
>> all the chat about them  :)
>> 
>> process and inter process variables
>> what can be seen by the component of/from the host, and vis-verse
>> 
>> At the moment - I am looking at an inter process var in my nascent 
>> component,
>> can the host database see this?
>> if I change an IP variable value in a component does it change the host 
>> value?
> 
> Hi Chip, 
> in addition to Wayne's post, see "Shared and unshared objects" in this page:
> 
> 
> For example, in a component:
> • 'Get pointer' and 'RESOLVE POINTER' will read component's variables
> • all "system variables" are distinct from host
> 
> etc.
> 
> Personal thought about UI: I avoid it in components, except "little 
> pieces of puzzle" like dialogs, progress, some widgets… In a 
> development I'm on, an important part of the UI relies on a component 
> - some kind of table navigator / advanced user mode, if you want - 
> and it's really a nightmare to maintain. 

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

Re: Components: How do you reuse utility code?

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

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




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

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

Re: components - questions about variable scope

2017-04-22 Thread Chip Scheide via 4D_Tech
to clarify for myself

In host database:
Wnd_CloseBox(True)
//do a bunch of stuff

(in same process - later)
 if(Wnd_CloseBox)
   // this will happen as it was set before

(in different process)
 if(Wnd_CloseBox)
   // this will Not happen as it was not set before


is that correct?


> Chip,
> Totally separate variable name space.
> You can access variables via pointer and that's it.
> 
> Otherwise I use access methods quite a lot.  Consider this method (from a
> component) to set a variable associated with a boolean:
> 
>   // Project Method: Wnd_CloseBox ({Include a close box?})  -->  Boolean
> 
> C_BOOLEAN(Wnd_CloseBox_b)
> C_BOOLEAN($1;$0)
> 
> If (Count parameters=1)
>   Wnd_CloseBox_b:=$1
> End if
> $0:=Wnd_CloseBox_b
> 
> I have lots of methods named almost identically to the variable like this
> (it's easier to set up in a macro!).
> 
> I find this much easier to work with than using pointers and the coding of
> it feels very similar to using a variable.
> 
> If (Wnd_CloseBox)
> //  Do something
> end if
> 
> or
> 
> Wnd_CloseBox(True)//  To set the variable
> 
> Note that 4D does not complain if there is a $0 value returned and not used
> at all.
> 
> 
> 
> 
> 
> 
> 
> 
> Regards,
> 
> Wayne
> 
> 
> [image: --]
> Wayne Stewart
> [image: http://]about.me/waynestewart
> 
> 
> 
> On 22 April 2017 at 07:41, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> 
>> I am working on my first component -
>> all the chat about them  :)
>> 
>> process and inter process variables
>> what can be seen by the component of/from the host, and vis-verse
>> 
>> At the moment - I am looking at an inter process var in my nascent
>> component,
>> can the host database see this?
>> if I change an IP variable value in a component does it change the host
>> value?
>> 
>> 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 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
> **

Hell is other people 
 Jean-Paul Sartre
**
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: Object visualize / browse

2017-04-22 Thread JPR via 4D_Tech
[JPR]

Hi David,

> Also, I tend to make a strong argument, but don't take it the wrong way!
David, I know you for a long time now, and I know how much you have been 
involved in 4D since, and still are. I know (for I read the NUG) that you spend 
a lot of time helping others on the NUG by providing hints and solutions. And 
if I didn't think that you have a strong sense of humour, I will not even try 
to put some humour in my comments ;-)

> 3: Use another tool. That might be 4D+NTK, it might be something else
> entirely that deals with JSON natively.
Yes, you're right, NTK is a very good product. But in the specific case I'm 
explaining during the Tour, using it will be using a sledgehammer to kill a 
fly. 

And just to be a bit more precise:

- I didn't say that a 'User-flexible' field should be added everywhere, I just 
provide developers with an example they might find useful. 
- "with hard-to-write queries." The example comes with it's own Query Subform.
- "Full JSON support is a *fundamental requirement* for a programming language 
today. 4D does itself no favors by 1) not having it " You're right again, but 
4D cannot change easily the programming language while maintaining 
compatibility, which is a primal requirement for the 4D Community.
- "and 2) trying to pretend that it's not a problem." I don't think 4D ever 
pretended it's not a problem... IMHO, what 4D said is "We know you ask for it, 
we know it's important, but until we finally do it, you can do almost all your 
programming without it."

Hope we can discuss the stuff together one of these days, in front of a good 
drink ;-)

My very best,

JPR


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

Re: Components: How do you reuse utility code?

2017-04-22 Thread James Crate via 4D_Tech
>> IMO that is one of the biggest reasons there is no significant code-sharing 
>> or component community in 4D, as compared to almost any other language. 
>> There would need to be a “standard library” component that other components 
>> could depend on, or they all have to reinvent every wheel.
> 
> The “standard library’ you allude to already exists. It’s called the 4D 
> language. The bulk of the world's 3GL “standard libraries” are trying to be 
> the 4D language and they never get anywhere near the level of consistency, 
> version continuity or platform support that 4D does. (Otherwise I’d be using 
> them !). 

Luckily, the bulk of the designers of the world’s 3GL standard libraries have 
never heard of 4D, so they can’t try to be 4D.

As far as consistency, maybe we’re talking about different things. To beat the 
dead horse of splitting a string to an array: 

STR_Parse_to_Array(->$array;$string;$delimiter) // mine
STR_Split($string;->$array;$delimiter)  // mine if I 
were creating it today
STR_Split_to_Array(??)  // 
someone else’s version?
manual string parsing   // 
Cannon’s OBJ module, any STR_?? method would likely collide

So for example, the code I wrote some years ago to do HTTP GET with digest 
authentication uses utility routines for basic things that I had to write 
myself. That code can’t be easily shared because then someone would need to 
also need to either edit the code to use their utility routines, or run the 
risk of duplicate method names with different parameter lists. 

By contrast, anyone developing a component in Objective-C will use:

NSArray *listItems = [list componentsSeparatedByString:@", “];

The same goes for almost every ARR_*, BLOB_*, and STR_* method, in almost every 
4D project ever written. If you look at code in one of those languages, you 
don’t have to look at each developer’s implementation of splitting a string, or 
removing duplicates from an array, etc. If you integrate code written by 
someone else into a project you don’t have to resolve all those conflicts, 
because they’re using the same standard functions you do.


> In that regard, the primary role of 4D components (in my experience) apart 
> from re-useability is quality control.
> 
> A single developer needs to reproduce the same code over again for many 
> applications. A component-based approach requires them to distill out and 
> de-couple business logic so that it is explicitly addressed in areas that it 
> is only implicitly addressed in a host-only project.

However, each single developer needs to implement many of the same things.  For 
example, in this (snipped) list, if you were writing apps in Xcode, you 
wouldn’t need to spend any time writing almost any of these yourself.

> UTILITIES
> • path functions (level navigation, multi-platform, joining, splitting)
NSString, NSURL, NSFileManager

> • version control
Integrated into Xcode and many IDEs. Version control is completely separate 
from any other language I have worked with, probably because every other 
environment starts with being accessible to whichever version control system 
you prefer.

> • property bags (text, blob, object)
> • object management
Full object-oriented support in Objective-C and Swift

> • string functions  (this is where your string ‘trim/splt’ would go)
NSString has most of the common stuff.

> • binary libraries (byte arithmetic, object opacity, colour addition, 
> saturation, brightness etc)
CIImage, CGImage, etc.

> • Window handling
> • user interface (forms, drawers, flaps, swaps, visibility
NSWindow, NSWindowController, an extensive set of built-in controls, data 
binding, etc.

> • inter process communications
NSNotification, NSNotificationCenter

> • BLOB routines
NSData, conversions to/from NSString, etc.

> • error handling
NSError, try/catch, full call stack all built in.


So not only does each developer *not* have to implement major parts of the 
language, when you look at somebody else’s code, most often they will be using 
the same framework you do. You don’t have to figure out how someone implemented 
window handling, they used included NSWindow methods for almost everything. If 
they want to get a file extension, they used filePath.pathExtension whether 
filePath is an NSString or an NSURL.  And those are just the simple examples. 
If in some part of your code you’re manipulating an array of objects, first you 
have to understand how that particular 4D developer implemented that particular 
property bag, and what the methods that implement the behaviors of that 
property bag might be called. In Objective-C, it’s probably an array of 
MyClass, and MyClass.h contains the public interface for that class so you can 
see at a glance pretty much everything you need to know about what data those 
objects contain and how they behave. 

To get back to components, if you have a 

4D Write Pro CSS

2017-04-22 Thread Pat Bensky via 4D_Tech
In the online docs for v16r2 it says:

"*Note:* The 4D Write Pro internal document format is a proprietary HTML
extension, compatible with HTML5/XHTML5, but which supports its own subset
of HTML/CSS attributes and tags, specified in this manual."

http://doc.4d.com/4Dv16R2/4D/16-R2.1620/Using-a-4D-Write-Pro-area.200-3124232.en.html

I can't find any more info about CSS and what tags are supported. Anybody
know where to find it?

This topic isn't even mentioned in the v16R3 docs. Surely that doesn't mean
that CSS isn't supported at all? That would be ridiculous :)

-- 
*
CatBase -
​Top Dog in Data Publishing

tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Components and custom constants files

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

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

--
Cannon Smith

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

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

Re: "Placeholder" in property list

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

--
Cannon Smith

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

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

Re: "Placeholder" in property list

2017-04-22 Thread Keith Culotta via 4D_Tech
That new feature has been a help with clutter.  I was unable to use it a 
numeric field until the field's format was set to something where the zero 
value was hidden, like ";-;".  When the field does not have the focus, 
the placeholder appears.

Keith - CDI

> On Apr 22, 2017, at 8:37 AM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Has anyone noticed that in 15.4 (HF2... maybe others) there's a new property 
> for fields and variables called 'Placeholder' that automatically fills an 
> empty field with descriptive text in a light gray font color, which 
> disappears when you type or the variable receives a value?
> 
> It's been awhile since I read the v15 documentation but I was surprised to 
> see it there!
> **
> 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: Components: How do you reuse utility code? (long)

2017-04-22 Thread Arnaud de Montard via 4D_Tech

> Le 22 avr. 2017 à 13:16, Bruno LEGAY via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> I haven't measured if EXECUTE METHOD has a significant overhead to be 
> honest...

it depends  ;-)

+++
ARRAY LONGINT($ms_al;2)
C_LONGINT($count_l;$duration_l;$tk_l)
$duration_l:=60*3

  //**loop 1**
$tk_l:=Tickcount+$duration_l
$count_l:=0
Repeat  
$count_l:=$count_l+1
$result:=TestMethod (...)
Until (Tickcount>=$tk_l)
$ms_al{1}:=$count_l

  //**loop 2**
$tk_l:=Tickcount+$duration_l
$count_l:=0
Repeat  
$count_l:=$count_l+1
EXECUTE METHOD("TestMethod";$result;...)
Until (Tickcount>=$tk_l)
$ms_al{2}:=$count_l

C_REAL($ratio_r)
$ratio_r:=$ms_al{1}/$ms_al{2}
ALERT(String($ms_al{1})+"\r"+String($ms_al{2})+"\r"+String($ratio_r))
+++

I tried with 3 different 'TestMethod'
  a - a simple wrapper of 'Random' function
  b - a home made random based on generate UUID + hexadecimal convert
  c - explode a delimited text in a text array 
Just to mention that from a to c, the called TestMethod is more and more time 
consuming (in other words, regarding $count_l, a > b > c). 

• interpreted 
no difference, loop 1 & 2 are executed the same number of times. 

• compiled 
  a - loop 1 executed 88 times more than loop 2
  b - loop 1 executed 3 times more than loop 2
  c - loop 1 ~ loop 2

In conclusion, the more time consuming the called method, the most negligible 
EXECUTE METHOD. 

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

"Placeholder" in property list

2017-04-22 Thread Jeffrey Kain via 4D_Tech
Has anyone noticed that in 15.4 (HF2... maybe others) there's a new property 
for fields and variables called 'Placeholder' that automatically fills an empty 
field with descriptive text in a light gray font color, which disappears when 
you type or the variable receives a value?

It's been awhile since I read the v15 documentation but I was surprised to see 
it there!
**
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: Object visualize / browse

2017-04-22 Thread Jody Bevan via 4D_Tech
David:

We started our new shell with v15. Now on v16.3 as we continue creating it. The 
very first thing we built (Ok Adam built all our object code), was our object 
tools. He built in dot notation into all the tools. We were used to the power 
of ObjectTools. Then he built our Object Viewer. There are all the commands to 
parse, and go up and down the object tree to get everything, and their types 
right within 4D's commands. Viewing as JSON is nice to see a lot of information 
at once, but being able to navigate to view a specific object is very nice. 

The tool works in compiled mode too which really helps when trouble shooting at 
the client's computer. The other advantage is being able to edit the contents 
of the object in all situations too.

It is just one of our tools built into the shell for developers. I would hate 
working with objects without a tool that lets me easily and quickly browse any 
object to see what is going on. As is often the case: what is in my head is 
different than what the computer has in its memory space ;-)

Sincerely
Jody Bevan
ARGUS Productions Inc.

On Apr 21, 2017, at 18:48, David Adams via 4D_Tech <4d_tech@lists.4d.com> wrote:

>> Can anyone suggest a straightforward approach to displaying a 4D object
> as a
>> browsable item - something like what you see in the debugger window, only
> in
>> a dialog form?
> 
> It's awkward to do with native 4D commands alone because:
> 
> * There's no way to parse or navigate JSON as a tree.
> 
> * There's no way to get 4D to tell you the type of an embedded array. No
> way. You can guess at embedded arrays, but it's problematic.
> 
> Alternatively, if you've got NTK available in your project, you can use the
> complete JSON processing suite and do whatever you like.
> 
> Several of us have made UIs or tools for doing as you ask, so someone might
> gift you some code. JPR had an example with big honking bits of code
> circulating last year. He had to guess at array types, like anyone else.
> But at least he did a bunch of the hard grunt of converting the
> object-JSONish text-hlist, etc.
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
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: Object visualize / browse

2017-04-22 Thread David Adams via 4D_Tech
> On Sat, Apr 22, 2017 at 8:33 PM, JPR via 4D_Tech <4d_tech@lists.4d.com>
wrote:
> Hi David,
>
> What I mean is just that I feel nothing obvious when manipulating Objects.
> Every single operation you can do on objects becomes not trivial at all,
if
> you compare with variables 4D Developers are accustomed to use.

Very good point! That's all quite true, and training would certainly be
helpful for people that haven't had the time to dig into the details yet.

> And you can continue as far as you want. It's the same for just using an
> object. In the case I use in CustomObjectField, I'm just giving end user
an
> access to an object field in order for him to add whatever he wants to the
> Products table (for instance). In fact, I just don't care about theory on
> climbing a tree up and down, I just want my user to add it's own stuff to
the
> records. And the component does the job. User adds data, and is able to
query
> on it, and i takes 5 minutes to install.

Yes, I've come to see that you guys in France are enamored of object fields
and a great many of the decisions about JSON and C_OBJECT flow from that. I
watched some excellent Summit presentations and have a clearer idea about
the mindset. I will note however that it took me roughly two minutes to
optimize the 4D Summit database that show relations as 'slow' so that the
relations too 40% of the original time to complete. I also noted that the
presentation made no comment on how hard it would be to use the data to
answer any question that you hadn't designed the object structure to
address *in advance*. Since the object fields are an interface onto
underlying has tables, that makes sense. There's no such thing as a reverse
hash table. So the love of object fields in France is something that I can
understand a bit, but it doesn't help me at all. I have occasional
situations where object fields could prove very useful...but not many. In a
complex system with hundreds of tables, I might have a couple that had a
special requirement where I think that object fields are either a) an
acceptable shortcut or b) offer special features that I need for specific
searches.

I have zero antipathy to the relational model and am not in love with
stuffing things into blobs/objects/whatever. Subtables were a terrible
feature (I used them once) and object fields face many of the same hazards.
Object fields, like subfields before them, offer some interesting
properties as novel index/search structures. But for general use? Not so
much. For dynamic databases? I can imagine a few big 4D OEMs that need that
but for anyone else? It's a bit of a trap. For people outside of the 4D
world? Not an attraction - they just use standard SQL commands to build
their tables and never look back. No need for any sort of embedded system
with hard-to-write queries. But this is all a very long discussion.

I mention a tree-oriented approach to JSON because that's the fundamental
nature of JSON in the rest of the universe. I don't know JSON from 4D, I
know JSON from elsewhere. As you and others in France may have observed,
many of us are befuddled as to why 4D doesn't have complete support for
*arbitrary* JSON. It makes it pointlessly difficult to interact with other
environments and services. That's a shame because 4D is a *fantastic*
environment (for those of us that know it) to serve as a hub. It's great
for pulling and pushing data in all sorts of formats and in all sorts of
ways. It's one of it's greatest strengths. But you need to support any sort
of JSON for that in this modern world.

> >  It's a pity, because JSON is really easy. Normally.
> Sorry, but I don't think JSON is easy for everybody on this planet. My
mother,
> at least, has some problems entering data without mistakes ;-)

Who enters data in JSON? If your mother programs in anything other than 4D
(which I expect you would fight about!), then she would have none of the
problems I (and others) despair of.

I have to say this is a pretty weird point to defend 4D on. JSON is an
interchange format. 4D doesn't support it as an interchange format.
Instead, it uses JSON notation for some internal purposes. Those of us that
interact with the outside world want a complete implementation. The easy
and correct answer is "yeah, 4D needs this. We know that and will do it."
There are plenty of cases where 4D features are a matter of taste and
preference. I'll admit that you could fairly say that some of my
preferences are a minority opinion and that it's pretty reasonable to
ignore them. I'm fine with that. In this case, 4D  dropped the ball. Not
that there's a huge amount wrong with the internal use of JSON (although
the typing problem is a real pain). But as a JSON module? It's not really
something that can sensibly defended. Why not just hire Rob to add the
feature? Why not just compile in one of the available libraries, much as
Rob does.

> > The basic problem is that 4D is lacking basic features:
> Sorry again, David, but you forgot 

Re: Dynamic Method Creation & Content Changing

2017-04-22 Thread Nigel Greenlee via 4D_Tech
John

Its always an issue when you probably wish it was a different way but it has 
been written and now you have to deal with it..no budget for a proper redo..no 
will for it either!.

 I would certainly consider though using Footrunner for code you you write(I 
don’t use footrunner as i have my own solution internal to my code)..i assume 
you can automatically create the footrunner document and that probably easier 
to ‘patch’ sections of code and sub-calls into than putting into 4D itself..and 
you could be running a compiled solution then.


Nigel

> On 21 Apr 2017, at 16:24, truegold via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Hi Nigel,
> 
> First I know the issue of using 4D List as a short cut for using a real 
> lookup of records in a table, aka choice list, for example. I have a client 
> who has an app (I have inherited this one as well) where there are hundreds 
> of these and they are having the kinds of problems you mentioned.  I am 
> slowly replacing them with table based choice list lookups.
> 
> But after reading your thoughts I realize that in this case I am not really 
> doing anything dynamically EXCEPT when things need to be setup for a new 
> study. And in this case without rewriting the application it must be handled 
> the way I have described. So keep in mind that I have not been tasked to 
> rewrite the App but only help them make this aspect of it easier.
> 
> SO the dynamic is really a one time thing. What I am really trying do is 
> automate it and reduce the chances for error and not have to go through 
> obscure notes to figure it out.
> 
> There are several NEW 4D lists that must be created each time they create a 
> new study. Then these list need to referenced and part of the mechanism is by 
> adding the names of these list to another meta list. That’s where the insert 
> list items comes in.
> 
> Then there are two new methods created each time that use these NEW list. An 
> the list names and number are the only thing that changes inside of this 
> wrapper method that calls another method with these list names as parameters.
> 
> Outside of header and some variable declarations there is a single line of 
> code which is the method and parameter list. Not much to validate here.
> 
> As to writing code inside another method that’s trickier. I might just open 
> the methods and present the code lines for them to copy them in.
> 
> It’s not as bad as you think (or else I am a bit delusional! Sometimes it’s 
> hard to tell. ) and on the surface it seems quite easy.
> 
> I’ll be explaining it to the client today and see what they think. If they 
> say go for it then I’ll give it a try and see if I can get most of it 
> automated.
> 
> I hope that explains it better. Always hard to explain when you’re trying not 
> to be verbose.
> 
> Appreciate,
> John...
> 
>> 4D lists can suck if they are being edited..I remember having trouble with a 
>> system a while back where users complained that some drop downs did not have 
>> something in that should have been there..testing showed that we had code 
>> nicely adding to the 4D list that was being used in the drop down..lots of 
>> head scratching..probably a blame fest..then we worked out what was going 
>> to..the list we being written to by other clients overwriting the list. and 
>> the user had a list different to what they expected.
>> 
>> In General I avoid using a 4D list for anything dynamic…a table with  
>> something like…
>> OWNER(User)<-create one ‘system’ owned list for each list name and where no 
>> user specific version use the system version…(Duplicate records or combine 
>> system owned with private owned)
>> LIST_NAME
>> LIST_ITEM_NAME
>> NAME_ABBREV
>> STUDY_REF 
>> ..(and a record ID)
>> Would be probably be a better way to handle a dynamic list and easier to 
>> then relate something like study steps ..step items…step item options..etc
>> 
>> In my humble you should never need to have code edit itself for this kind of 
>> purpose. The code should support and be supported by the data and switches 
>> in the data should define the route through the code…that will always be 
>> more robust and easier to write than code that writes code. 
>> 
>> Code that writes code is hard to validate:)..i know this ..lets say in your 
>> code you have a line $_t_InsertStatement:=“IF(<>MyBadlyNamedVariable)” 1stly 
>> you have to be sure that variable exists. and then if someone decides 
>> somewhere to change the name of the variable it wont automatically change in 
>> your hardcoded insert line and somewhere you will be getting calls about an 
>> error..even worse is when 4D changes the name of the a function call or the 
>> parameters.
>> 
>> Just my tuppence worth.
> 
> **
> 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: 

Re : Components: How do you reuse utility code? (long)

2017-04-22 Thread Bruno LEGAY via 4D_Tech
Hi,

To be honest i am glad there a feeling of curiosity and interest about 
components.
I have seen the light my friends and I am a believer :-)
And there is hope for a "born again 4D component lovers" community.

I find it sad when I hear 4D developers saying that they tried components and 
that they gave up.

Maybe I can share my experience with components.

I have been using components since day 1 (early adopter) and I am *very* happy 
with them.
It really changed the way we write code.

I did a summit presentation in back 2012 Paris about "4D development 
industrialization with components".

And I attended Peter's very good presentation on components last year in 
european summit. Peter is also a fan of components.
Interestingly enough we use it in a difference ways (i'll come back to that), 
but we have encountered the same problems/pitfalls and found some 
solutions/workround. 

A bit of context first...

We are a bespoke developer company, mainly 4D, a bit of Oracle and php/web, 
etc.. (several dev, many projets, across several 4D versions).
We work in remotely (not coding together on the same 4D Server).

Before components we would have a common source library (a shell if you want).
We would move code with insider. But Insider is gone and maybe it was a good 
thing.

Early on, the methods of our library were grouped in modules (which helped us a 
lot to move stuff into components).

I looked into components as an alternative to 4D Insider.

I an idea of what I did not like :
- bloated components
- rely on too many human operations (boring, errors)

And what I wanted :
- reduce duplicated code across projets
- re-use technical code
- improve code quality
- fixe code once and share fixes across projects
- versionning
- avoid naming collision (a sort of namespace)
- performance (using compiled components in interpreted host is great 
compromise)
- logs to diagnose stuff
- documentation
- unit tested code (in an ideal world)
- move more than just code/methods, sometimes resources, etc...
- share code between versions (I don't enjoy moving code and fixes 
across libraries in several 4D versions)
- wanted to simplify updating code when changing 4D version
- modular approach : have access to a collection of component where we 
could choose and pick according to the needs of a given project.

I came to the conclusion, early on, that our code was made into two parts :
- business code
- technical code

The business code is rarely re-used. Also, working on tables, etc... is not 
simple with components (working with SQL or pointers) make things more 
complicated and brittle in my opinion. 
And I have never used component "local" data.
So I don't do business code in components. I know Peter has a different 
approach on this. It is fine, there is no right or wrong. Juste different 
taste, experience, needs and methods.


The technical code is in fact a collection of modules which can be, for the 
most part, independant of each other.
So for instance we have written about 40 to 50 components.

Some projects are using 2 or 3 components. Some are using 30+.

Some are published with source code for free (aws_component for S3 for 
instance).

Some are commercial (ociLib to help coding with 4D for OCI and provide 
retro-comptibilty to the legacy "4D for Oracle" plugin).

The vast majority is private and used internally. 
This is for instance, a part of our collection :
- BLB : blob stuff
- CRC : checksum (md5, sha1, sha2, sha384, sha512, crypto)
- CPDF : pdf handling stuff (using "Coherent pdf" binaries)
- DBG : log writing
- ENV : information about system (os, disks, etc...)
- FS : filesystem stuff
- HEX : hexadecimal stuff
- HTTP : http stuff
- HTML : html stuff
- IC : internet commands stuff
- IO : input / output (import and export, cdv, etc...)
- PDF : pdf printing stuff
- PRM : handling "environment" parameters
- PTR : pointer stuff
- MSG : alerts, messages and progress stuff
- OBJ : object stuff (well this one is Cannon's object module converted 
into a component)
- SEM : semaphore stuff
- SMTP : smtp stuff
- TAB : array stuff
- TXT : text
- XDOC : auto documentation
- XML : xml stuff
- ZIP : 7zip stuff (compression and AES encryption)
- etc.

You get the idea...

Most of theses components are independent to each other.
Few higher level components have "strong coupling" because they explicitly call 
another component. When you use a compiled application, 4D will detect the 
missing component an complain when you open you structure.
Most have a "soft coupling" : most components spit out logs. For this, they 
call the "DBG_component". But this is done with a call to EXECUTE 

Re: components - questions about variable scope

2017-04-22 Thread Arnaud de Montard via 4D_Tech

> Le 21 avr. 2017 à 23:41, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> I am working on my first component -
> all the chat about them  :)
> 
> process and inter process variables
> what can be seen by the component of/from the host, and vis-verse
> 
> At the moment - I am looking at an inter process var in my nascent 
> component,
> can the host database see this?
> if I change an IP variable value in a component does it change the host 
> value?

Hi Chip, 
in addition to Wayne's post, see "Shared and unshared objects" in this page:


For example, in a component:
• 'Get pointer' and 'RESOLVE POINTER' will read component's variables
• all "system variables" are distinct from host

etc.

Personal thought about UI: I avoid it in components, except "little pieces of 
puzzle" like dialogs, progress, some widgets… In a development I'm on, an 
important part of the UI relies on a component - some kind of table navigator / 
advanced user mode, if you want - and it's really a nightmare to maintain. 

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

Re: Object visualize / browse

2017-04-22 Thread JPR via 4D_Tech
[JPR]

Hi David,

What I mean is just that I feel nothing obvious when manipulating Objects. 
Every single operation you can do on objects becomes not trivial at all, if you 
compare with variables 4D Developers are accustomed to use. Some examples :

- Comparing objects: Will you compare structures? Contents? Both? 
Case-sensitive or not?

- Adding objects:  $ob1.name="Aleph", $ob2.name="Beth", what should be $ob1 + 
$ob2? A string like "AlephBeth", or an array like ["Aleph","Beth"]?

And you can continue as far as you want. It's the same for just using an 
object. In the case I use in CustomObjectField, I'm just giving end user an 
access to an object field in order for him to add whatever he wants to the 
Products table (for instance). In fact, I just don't care about theory on 
climbing a tree up and down, I just want my user to add it's own stuff to the 
records. And the component does the job. User adds data, and is able to query 
on it, and i takes 5 minutes to install.

Then come more explanations, because if the Developer would like to modify it, 
he has to understand some of the choices I made in this component, and that's 
why he needs explanations.

>  It's a pity, because JSON is really easy. Normally.
Sorry, but I don't think JSON is easy for everybody on this planet. My mother, 
at least, has some problems entering data without mistakes ;-)

> The basic problem is that 4D is lacking basic features:
Sorry again, David, but you forgot one word:
"4D is lacking basic features YET"

Now, let's suppose that the way Objects are used in 4D today is not perfect. I 
agree. But we may reasonably think that it may be improved in the futures, may 
not we? It let us with 2 solutions:

1/ Wait until 4D will be perfect

2/ Use it the way it works today, and be prepared to move to new features when 
time will come

Training explains how to handle the second case, and being Zen helps in the 
first one...

My very best,

JPR

> On 22 Apr 2017, at 12:06, 4d_tech-requ...@lists.4d.com wrote:
> 
>> - Anyway, the answer is not obvious, and this is why it's important to
> get the proper explanations during the trainings...
> ?
> 
> I'm not sure what you mean here. Do you mean that the programming solution
> is not obvious?  It's a pity, because JSON is really easy. Normally. The
> basic problem is that 4D is lacking basic features:

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

Re: Components: How do you reuse utility code? (long)

2017-04-22 Thread David Adams via 4D_Tech
On Sat, Apr 22, 2017 at 7:40 PM, Bruno LEGAY via 4D_Tech <
4d_tech@lists.4d.com> wrote:

Bruno,

I hope that everyone agrees with me that your post was just fantastic.
Thank you very much for sharing your point of view, specifics about what
you've done, and why. A very substantial and interesting post. I'll read
through it a few more times tomorrow (it is night here.)

Just so people know, I'm being a bit cranky about components, but I'm also
mostly ignorant. So, I'm entirely likely to change my opinion going
forward. Even if I think that I'm right all of the time, it's not that odd
to see me change my mind ;-) In any case, I've tried components since they
were first introduced and then every few versions since. I even had some
components published as tech notes years ago. This time, I decided to dig
in a bit more rather than giving up. So, thanks to everyone for all of the
support, encouragement and information.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Components: How do you reuse utility code? (short)

2017-04-22 Thread David Adams via 4D_Tech
> If you want to communicate with host and or other components => use
callbacks.

As it turns out, what I am validating is the method name being passed into
the component for a callback! This is a database exploiting CALL WORKER and
CALL FORM to implement a Publish/Subscribe messaging pattern.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Components: How do you reuse utility code? (short)

2017-04-22 Thread David Adams via 4D_Tech
Bruno,

Thanks a lot for the answer and background info. I think I expressed myself
unclearly regarding errors in my original post. I'm not trying to delegate
error handling to a component. I hadn't really thought about it yet.
Instead, what I'm talking about is a custom error stack that I use. It's
possible for an error handler to push an error onto this stack, but it's
normally done by code. I don't use ASSERT, I use my own precondition checks
and push errors onto my custom stack. ON ERR CALL doesn' really have much
to do with it. Apart from anything else, the ErrorStack code makes my unit
testing a lot easier because one of the outcomes I can test for is the
state of the ErrorStack. How many errors are in there? What names do they
have? (I don't use error codes, they're meaningless. I use error names.)
I'm pretty into testing for exceptions, so my unit tests tend to have lots
of checks on things like out of bounds inputs, bad parameter lists,
malformed parameters, etc. Since the errors are stacked on the ErrorStack,
it's pretty easy to sort out if my tests failed or not. As always, unit
testing is both humbling ("humiliating" might be another word) and
reassuring. I'm pretty happy when I run the tests and turn up a change in
the error name(s) returned. Surprising how many little things slip through
when you recode.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Components: How do you reuse utility code? (short)

2017-04-22 Thread Arnaud de Montard via 4D_Tech

> Le 22 avr. 2017 à 11:09, Bruno LEGAY via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> [...]
> This may look OTT but there are very few method where this is really 
> necessary[...]

Hi Bruno, 
in system document management I needed a bunch of 'on error call'… 

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

Re: Components: How do you reuse utility code? (long)

2017-04-22 Thread Bruno LEGAY via 4D_Tech
Hi,

To be honest i am glad there a feeling of curiosity and interest about 
components.
I have seen the light my friends and I am a believer :-)
And there is hope for a "born again 4D component lovers" community.

I find it sad when I hear 4D developers saying that they tried components and 
that they gave up.

Maybe I can share my experience with components.

I have been using components since day 1 (early adopter) and I am *very* happy 
with them.
It really changed the way we write code.

I did a summit presentation in back 2012 Paris about "4D development 
industrialization with components".

And I attended Peter's very good presentation on components last year in 
european summit. Peter is also a fan of components.
Interestingly enough we use it in a difference ways (i'll come back to that), 
but we have encountered the same problems/pitfalls and found some 
solutions/workround. 

A bit of context first...

We are a bespoke developer company, mainly 4D, a bit of Oracle and php/web, 
etc.. (several dev, many projets, across several 4D versions).
We work in remotely (not coding together on the same 4D Server).

Before components we would have a common source library (a shell if you want).
We would move code with insider. But Insider is gone and maybe it was a good 
thing.

Early on, the methods of our library were grouped in modules (which helped us a 
lot to move stuff into components).

I looked into components as an alternative to 4D Insider.

I an idea of what I did not like :
- bloated components
- rely on too many human operations (boring, errors)

And what I wanted :
- reduce duplicated code across projets
- re-use technical code
- improve code quality
- fixe code once and share fixes across projects
- versionning
- avoid naming collision (a sort of namespace)
- performance (using compiled components in interpreted host is great 
compromise)
- logs to diagnose stuff
- documentation
- unit tested code (in an ideal world)
- move more than just code/methods, sometimes resources, etc...
- share code between versions (I don't enjoy moving code and fixes 
across libraries in several 4D versions)
- wanted to simplify updating code when changing 4D version
- modular approach : have access to a collection of component where we 
could choose and pick according to the needs of a given project.

I came to the conclusion, early on, that our code was made into two parts :
- business code
- technical code

The business code is rarely re-used. Also, working on tables, etc... is not 
simple with components (working with SQL or pointers) make things more 
complicated and brittle in my opinion. 
And I have never used component "local" data.
So I don't do business code in components. I know Peter has a different 
approach on this. It is fine, there is no right or wrong. Juste different 
taste, experience, needs and methods.


The technical code is in fact a collection of modules which can be, for the 
most part, independant of each other.
So for instance we have written about 40 to 50 components.

Some projects are using 2 or 3 components. Some are using 30+.

Some are published with source code for free (aws_component for S3 for 
instance).

Some are commercial (ociLib to help coding with 4D for OCI and provide 
retro-comptibilty to the legacy "4D for Oracle" plugin).

The vast majority is private and used internally. 
This is for instance, a part of our collection :
- BLB : blob stuff
- CRC : checksum (md5, sha1, sha2, sha384, sha512, crypto)
- CPDF : pdf handling stuff (using "Coherent pdf" binaries)
- DBG : log writing
- ENV : information about system (os, disks, etc...)
- FS : filesystem stuff
- HEX : hexadecimal stuff
- HTTP : http stuff
- HTML : html stuff
- IC : internet commands stuff
- IO : input / output (import and export, cdv, etc...)
- PDF : pdf printing stuff
- PRM : handling "environment" parameters
- PTR : pointer stuff
- MSG : alerts, messages and progress stuff
- OBJ : object stuff (well this one is Cannon's object module converted 
into a component)
- SEM : semaphore stuff
- SMTP : smtp stuff
- TAB : array stuff
- TXT : text
- XDOC : auto documentation
- XML : xml stuff
- ZIP : 7zip stuff (compression and AES encryption)
- etc.

You get the idea...

Most of theses components are independent to each other.
Few higher level components have "strong coupling" because they explicitly call 
another component. When you use a compiled application, 4D will detect the 
missing component an complain when you open you structure.
Most have a "soft coupling" : most components spit out logs. For this, they 
call the "DBG_component". But this is done with a call to EXECUTE 

Re: Components: How do you reuse utility code? (short)

2017-04-22 Thread Bruno LEGAY via 4D_Tech
Hi David,

On your original message (sorry for the late response, been very busy this 
week).

First about, component are not russian dolls.

Then about error handling, you need to set up a simple test environment to 
understand how they work.
An error in the component, if not "trapped" will be propagated to the host if 
my memory serves me right.

This is why I tend to things like this in components :

C_TEXT($vt_errHdlr)
$vt_errHdlr:=Method called on error

ON ERR CALL("HTTP__errorHandler") // a private method of the component 

// I know this can generate an error for instance if not connected to internet
$vl_httpStatus:=HTTP Request(...)

// check stuff, log errors, status, timers, request size, response size, 
throughput

ON ERR CALL($vt_errHdlr)


This may look OTT but there are very few method where this is really necessary 
: not connected to internet, disk full, something you cannot predict basically.

On the other hand programming errors like missing parameters, wrong pointer 
type, nil pointers are coding errors and are ASSERTed (fail fast, fail early, 
fail loud).

If you want to communicate with host and or other components => use callbacks.

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

Quick question: Any words of wisdom on V16's GRAPH command?

2017-04-22 Thread David Adams via 4D_Tech
I've been wanting to get into V16's new version of the GRAPH command
(64-bit only) for some time after reading about it on the 4D Blog:

http://blog.4d.com/test-more-controls-on-graph-command-test/

For anyone that hasn't looked at the blog, or looked at it lately, check it
out. It's really good.

Anyway, I'm hoping to dive into GRAPH shortly and just want to ask if
anyone has done a deep dive already who has some tips or treasures to bring
back. If not, I'll just dig in and see what I find.

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

Re: Components and custom constants files

2017-04-22 Thread David Adams via 4D_Tech
>The argument list for the method named "MessageHub_Unsubscribe" in the
component "MesageHub"
> is incompatible with the database or component "MesageHubDemo.4DB".

I just ran into the same error today and spent a few hours smacking things
around until it stopped. Based on past threads and a LOT of help from this
list (thanks everyone!), I'm about 100% sure it has something to do with
duplicate constants. Or else something to do with constants being in the
wrong resources folder. Not entirely sure...but I did want to update this
thread for the archives.

For the record, I've now got

MessageHub_Demo
/Components
 DaKine.4dbase
 MessageHub.4dbase
 OBJ_Module.4dbase

MessageHub
   /Components
 DaKine.4dbase
 OBJ_Module.4dbase

Knock wood, it seems to work. I'm going to leave like this for now and see
how it goes. In the past couple of years, I've been trying to be more open
minded about my programming assumptions. That means trying new tools and
techniques, even if I'm skeptical. It's been fun! I've learned a lot,
adopted some new practices, kept some old habits, and much expanded my
breadth of knowledge. Highly recommended. Sadly, it makes me no less
fiercely opinionated, but it has changed my opinions. People that work with
me in the real world or who have met me can report I'm not so shouty in
person.
**
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: Object visualize / browse (more)

2017-04-22 Thread JPR via 4D_Tech
[JPR]

In my previous message, I forgot to indicate that this component can use 3 
different ways to represent an object:

- As a Styled Text
- As a Hierarchical List (with pictures or not)
- As a ListBox (with all the possibility to edit, modify, create hierarchies, 
enter data, etc.)

And yes, you can use it for free ;-)

My very best,

JPR

> On 22 Apr 2017, at 02:48, 4d_tech-requ...@lists.4d.com wrote:
> 
> Message: 9
> Date: Sat, 22 Apr 2017 10:48:19 +1000
> From: David Adams 
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: Object visualize / browse
> Message-ID:
>