Re: Method caller

2017-01-21 Thread David Adams
On Sun, Jan 22, 2017 at 2:15 AM, stardata.info 
wrote:

> hi all
>
> I use on error call for trap the errors, and i have a question.
> Is possible to know the method that have called the method of error
> management?
> Into the method, i write the error in one log file, and i have need to
> know the method that have called the error method management.
>

Have you noticed the "Error method" and "Error line" system variables?
They're documented here:

http://doc.4d.com/4Dv13/4D/13.6/ON-ERR-CALL.301-2502645.en.html

We've had the Error system variable forever in 4D. I'm not sure which
version added Error method and Error line, but not everyone is aware of
them. They indicate the method that provoked the error and on what line.
Very helpful.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Updated OBJ Module

2017-01-21 Thread David Adams
Thanks Cannon!

I'd assume pretty much everyone is already using Cannon's tool. If not, go
snag a copy. Apart from the excellent functionality the tool provides out
of the box, Cannon also includes the source code. This makes it very easy
to learn from the code, tweak it, compile it as a component (or
not)...whatever you need.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Method caller

2017-01-21 Thread stardata.info


I know that thare are V13.6 that is better, but i have some 
installations and i need to test the conversion in one appropriated moment.

However i think to convert at V 14 or V15 directly

Thanks
/Ferdinando

/

Il 21/01/2017 21:00, 4d_tech-requ...@lists.4d.com ha scritto:

Message: 5
Date: Sat, 21 Jan 2017 10:22:31 -0500
From: Jeffrey Kain
To: 4D iNug Technical<4d_tech@lists.4d.com>
Subject: Re: Method caller
Message-ID:<6bdc6e1d-25d6-43f1-b8bf-c69167f1b...@gmail.com>
Content-Type: text/plain;   charset=us-ascii

http://doc.4d.com/4Dv13/4D/13.6/Method-called-on-error.301-2502649.en.html  


Why 13.2? Sooo many bugs.  It's a free upgrade to 13.6 which is very stable.



On Jan 21, 2017, at 10:15 AM, stardata.info  wrote:

I work with 4D V13.2 on windows.
I use on error call for trap the errors, and i have a question.
Is possible to know the method that have called the method of error management?
Into the method, i write the error in one log file, and i have need to know the 
method that have called the error method management.




**
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: Put File

2017-01-21 Thread Foucauld Perotin
Cannon Smith write: 
>Select document with the new File name entry parameter?

Yes, yes, yes! 
> "Allows user to enter a file name in a 'Save as' dialog box. "

How did I missed that? I a already using the command for a lot of other things.
(old habits are terrific...)

Thanks a lot! :)

FP 



**
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: Put File

2017-01-21 Thread Cannon Smith
How about Select document with the new File name entry parameter?



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




> On Jan 21, 2017, at 2:33 PM, Foucauld Perotin  wrote:
> 
> Do you know how I could get a dialog to create a file, with a prompt and a 
> default name?

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

Put File

2017-01-21 Thread Foucauld Perotin
Hi,

Do you know how I could get a dialog to create a file, with a prompt and a 
default name?

Till recent times, I used the tp_Put File command of the ToolBox pack from 
Thibaud, but I have to replace it now to be compliant with 4D 64-bit (and I 
shall also need it for Windows). A File Toolkit did exist too. But I do not 
find how to replace these tools, and the syntax of the 4D command Create 
document is really poor. 

Any idea of the good tool I missed? 

Thanks!

FP 

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

Updated OBJ Module

2017-01-21 Thread Cannon Smith
Hi Everyone,

I've updated the OBJ module. The biggest addition is that it now supports 
direct array element access using a [x] notation. Examples:

OBJ_Get_Long ($oObject;"contact[3].phone[2].number) //Traversing through two 
object arrays in the keypath
OBJ_Set_Text ($oObject;"person.notes[12];”A note”) //Setting a specific element 
in a text array

If you set a value, it will automatically create array elements if the array is 
too small. For example, with just these two lines of code:

$oObject:=OBJ_Create
OBJ_Set_Text ($oObject;"contact[2].phone[2].callNote[3]";"This is a note")

this object will be created:

{
"contact": [
null,
{
"phone": [
null,
{
"callNote": [
"",
"",
"This is a note"
]
}
]
}
]
}

Notice that both the "contact" and the "phone" objects have two array elements, 
the first of each being null right now, and the callNote array has three 
elements. These were all created automatically in order to satisfy the keypath 
in the second line of code.

In addition to support for [x] syntax, the following methods have been added:

- OBJ_Get and OBJ_Set which can be used with a pointer to a table, a field, or 
any type of variable. It automatically figures out what kind of variable, etc. 
it is.

- OBJ_Set_Selection and OBJ_Get_Selection for working with selections of records

- OBJ_ToRecord and OBJ_FromRecord to aid in converting selections to records.

Please see the Readme method in the module for documentation. If you would like 
the updated module, it is available here:



It is a v16 structure. There isn't anything special about v16 for it (that’s 
just where I happen to be coding these days), so feel free to back-port it to 
previous versions if you like.

P.S. A great deal of the code was re-written to support [x] syntax. All unit 
tests are passing and I’ve used the code in my own products without issue, so 
I’m confident that if you replace previous versions of the module it should 
work without issue. However, the [x] notation hasn’t been tested extensively in 
real-world, production applications yet. It is passing unit tests and random 
tests I’ve created, but please let me know if you find a bug when using this 
syntax. Thank you!

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




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

Re: Method caller

2017-01-21 Thread Arnaud de Montard

> Le 21 janv. 2017 à 16:15, stardata.info  a écrit :
> 
> [...]
> Is possible to know the method that have called the method of error 
> management?
> Into the method, i write the error in one log file, and i have need to know 
> the method that have called the error method management.

Hi Ferdinando, 
no, you must "run your own" (quite heavy IMHO). 
It's been asked many times. 

-- 
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: Method caller

2017-01-21 Thread Jeffrey Kain
http://doc.4d.com/4Dv13/4D/13.6/Method-called-on-error.301-2502649.en.html 


Why 13.2? Sooo many bugs.  It's a free upgrade to 13.6 which is very stable.


> On Jan 21, 2017, at 10:15 AM, stardata.info  wrote:
> 
> I work with 4D V13.2 on windows.
> I use on error call for trap the errors, and i have a question.
> Is possible to know the method that have called the method of error 
> management?
> Into the method, i write the error in one log file, and i have need to know 
> the method that have called the error method management.

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

Method caller

2017-01-21 Thread stardata.info

hi all

I work with 4D V13.2 on windows.
I use on error call for trap the errors, and i have a question.
Is possible to know the method that have called the method of error 
management?
Into the method, i write the error in one log file, and i have need to 
know the method that have called the error method management.


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