Re: Subrecords with subrecords

2017-10-14 Thread Chip Scheide via 4D_Tech
glad to help!
Chip


> Chip, your example worked great and kept me from having to wrap everything
> with Execute (which would have been more annoying.)
> 
> It turns out, after all this, that there is no data in the sub-subtable.
> Client, of course, had no idea... This is great because I can quit working
> in 2004 and get back to v16.
> 
> And, if you want to renew your enthusiasm for the progress 4D have made in
> the product over the years, go work in 2004 for a while...
> 
> 
> On Fri, Oct 13, 2017 at 11:13 AM, Chip Scheide via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Kirk :
>> yes.
>> if I remember the subtable syntax correctly
>> 
>> Execute formula("x_text:=[table]subtable1.subtable2.fieldname")
>> 
>> Lee
>> I am not sure that this will work, but if it does it might make your
>> life easier...
>> have 1 method (which will likely have to be hard coded) to get pointers
>> to all the sub-subtable fields
>> populate the pointers into an inter process pointer array.
>> Then you can loop over them to extract data
>> 
>> Get pointers to sub_subtable_fields
>> array pointer(<>Sub_sub_Field_Pointers;number_of_Sub_sub_Table_Fields)
>> 
>> execute
>> formula("<>Sub_sub_Field_Pointers{1}:=->[table]
>> subtable1.subtable2.field_1_name")
>> execute
>> formula("<>Sub_sub_Field_Pointers{1}:=->[table]
>> subtable1.subtable2.field_2_name")
>> execute
>> formula("<>Sub_sub_Field_Pointers{1}:=->[table]
>> subtable1.subtable2.field_3_name")
>> 
>> 
>> then for data extraction:
>> 
>> For($i;1;number of records in sub-subtable)
>>   For($ii;1;size of array(<> Sub_sub_Field_Pointers))
>> Text_variable :=Text_variable + utility_convert_to_Text(<>
>> Sub_sub_Field_Pointers{$ii})
>>   end for
>> end for
>> 
>> send packet(Text_variable)
>> 
>> On Fri, 13 Oct 2017 10:48:16 -0700, Kirk Brooks via 4D_Tech wrote:
>>> Tim,
>>> On Fri, Oct 13, 2017 at 8:50 AM, Tim Nevels via 4D_Tech <
>>> 4d_tech@lists.4d.com> wrote:
>>> 
 If I remember correctly, the 2004 method editor will show sub-subtable
 field references, but as soon as you edit a line with the reference (or
 maybe even retokenize the whole method) it drops the sub-subtable
 references. So you have to replace all these lines of code with EXECUTE
 commands. And you’ll have to write all the sub-subtable conversion code
>> as
 a series of EXECUTE commands for every line with a sub-subtable
>> reference.
>>> 
>>> 
>>> ​Really interesting hack. ​I'm trying to visualize this - "So you have to
>>> replace all these lines of code with EXECUTE commands."  Do you mean
>>> opening the structure in 2004 will show the names of the sub-subtable
>>> fields so you can then write the code using that name and run it with
>>> EXECUTE and not choke?
>>> 
>>> --
>>> 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
>>> **
>> ---
>> 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: right click in text variable gets menu with cut copy paste

2017-10-14 Thread Chip Scheide via 4D_Tech
the only thing I can think of, right now, is:
On Event call for the form.
watch for the right click
check cursor position -
  inside a field/variable give popup
  else ignore

> Hi all, 
> problem / request:
> A user of one of my database solutions on PC W7 4D v13.6 is 
> complaining that, in many of the alphanumeric fields, there is NO 
> right click with subsequent cut copy paste menu. 
> they absolutely refuse to use any keyboard short-cut, all must be 
> done with the mouse (they are absolutely adamant) . 
> 
> I can create the menu and I am able to show this menu, however they 
> must click a button on the side of the alphanumeric field, clumsy 
> patch they say. 
> It should be that right clicking a text field or variable, this menu 
> pops up. 
> 
> I can't get a text field / variable (or string variable for that 
> matter in 4D v13) to register a click in that field.  It becomes 
> active but then a second click is not registered. 
> 
> Is it possible to create such a functionality in v13 or v15 for that 
> matter ? 
> 
> Hope to hear from anyone.  
> 
> greetings 
> 
> ernie hilgers (aruba)
> 
> **
> 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: How can a component get a pointer to a host form (dynamic) variable?

2017-10-14 Thread Jeremy Roussak via 4D_Tech
I think I may be being dim, but I don’t understand. Could you give some better 
idea of how the various component methods are called?

Jeremy


Jeremy Roussak
j...@mac.com



> On 11 Oct 2017, at 17:14, Jim Dorrance via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> No, the pointer is nil. I finally execute a host process that executes a
> component process that returns the picture to the host to be copied to a
> host form var. There must be a simpler way:(
> 
> 
> On Wed, Oct 11, 2017 at 5:49 PM, Jeremy Roussak via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Can’t the pointer be passed from the host as a parameter to the method in
>> the host which draws the picture? Just a thought.
>> 
>> 
>> Jeremy Roussak
>> j...@mac.com
>> 
>> 
>> 
>>> On 11 Oct 2017, at 14:06, Jim Dorrance via 4D_Tech <4d_tech@lists.4d.com>
>> wrote:
>>> 
>>> Thanks.
>>> 
>>> I just want to copy a SVG picture created in a component ( using lots of
>>> data only available in the subform) to the host form.
>>> 
>>> On Wed, Oct 11, 2017 at 2:21 PM, Jeremy Roussak via 4D_Tech <
>>> 4d_tech@lists.4d.com> wrote:
>>> 
 Jim,
 
 I do it via a callback routine in the host. To make things easy, the
 component creates several methods in the host the first time it’s used.
 
 Jeremy
 
 Jeremy Roussak
 j...@mac.com
 
 
 
> On 11 Oct 2017, at 13:02, Jim Dorrance via 4D_Tech <
>> 4d_tech@lists.4d.com>
 wrote:
> 
> How can a component method get a pointer to a host form (dynamic)
 variable?
> 
> --
> Jim Dorrance
 **
 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
 **
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Jim Dorrance
>>> jim.dorra...@gmail.com
>>> 4...@dorrance.eu
>>> www.4d.dorrance.eu
>>> 
>>> PS: If you know of anyone that needs an experienced 4D programmer to add
>>> energy and experience to their team, please let me know. I have
>>> experience in many areas. Reasonable rates. Remote or Paris only.
>>> **
>>> 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
>> **
>> 
> 
> 
> 
> -- 
> Jim Dorrance
> jim.dorra...@gmail.com
> 4...@dorrance.eu
> www.4d.dorrance.eu
> 
> PS: If you know of anyone that needs an experienced 4D programmer to add
> energy and experience to their team, please let me know. I have
> experience in many areas. Reasonable rates. Remote or Paris only.
> **
> 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: iPhone Panties

2017-10-14 Thread Tim Nevels via 4D_Tech
On Oct 14, 2017, at 12:13 PM, Tom Dillon wrote:

> :-7  People still make millions off of totally silly stuff.
> 
> Between this and the discussion about the tech list getting fainter, it has 
> me wonder if the 4D Pub is still around. It was pretty well traffice, 
> especially right before and after a Devcon/Summit.

I think it is time to bring back so lightness and fun to the iNug. So serious 
around here. We need more smiles.

You can help out in the smile department Tom. I miss your humor and strange 
perspective on thing. Hope to see more posts for Tom Dillon here in the future.

iPhone Panties has got to be the ultimate gag gift for that special someone. 

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: right click in text variable gets menu with cut copy paste

2017-10-14 Thread Tim Nevels via 4D_Tech
> On Oct 14, 2017, at 12:13 PM,ernie hilgers  wrote:
> 
> Message: 6
> Date: Fri, 13 Oct 2017 22:29:20 -0400
> From: ernie hilgers 
> To: 4d_tech@lists.4d.com
> Subject: right click in text variable gets menu with cut copy paste
> Message-ID: 
> Content-Type: text/plain; charset=us-ascii
> 
> Hi all, 
> problem / request:
> A user of one of my database solutions on PC W7 4D v13.6 is complaining that, 
> in many of the alphanumeric fields, there is NO right click with subsequent 
> cut copy paste menu. 
> they absolutely refuse to use any keyboard short-cut, all must be done with 
> the mouse (they are absolutely adamant) . 

Upgrade to v14. It has a checkbox in the Property List for text fields and 
variables called “Context Menu” that does what you want. But it only works on 
text fields. So for date, time and numeric fields you still have to do all the 
work yourself. 

With need v14 because  you can turn on the “On Clicked” form event for fields 
now and then you can trap when a user clicks or right-clicks in a field. Here’s 
some code to make this work for date, time and numeric fields:. 

  // ===
  // PROJECT METHOD: HandleContextualMenu

  // PARAMETERS: $1 = menu ref (optional)
  // $2 = method name (optional)

  // DESCRIPTION: Put this method in a form object and it will
  // respond to a right-click in the current object. 

  // Pass no paramters and it will do the default which is to support
  // Cut, Copy and Paste in the current object.

  // CREATED BY: Tim Nevels, Innovative Solutions ©2016
  // DATE: 4/1/16
  // LAST MODIFIED: 
  // 

C_TEXT($1;$menuRef_t)
C_TEXT($2;$methodName_t)
If (Count parameters>=1)
   $menuRef_t:=$1
Else 
   $menuRef_t:=<>defaultRightClickMenuRef_t
End if 
If (Count parameters>=2)
   $methodName_t:=$2
End if 

C_TEXT($menuItem_t)
C_LONGINT($mouseX;$mouseY;$mouseButton;$start;$end)

If (Form event=On Clicked)
   GET MOUSE($mouseX;$mouseY;$mouseButton)
   If (Macintosh control down | ($mouseButton=2))  // right-click
// determine enabled/disabled for Cut and Copy items
  GET HIGHLIGHT(Self->;$start;$end)
  If (($end-$start)>0)
 ENABLE MENU ITEM($menuRef_t;1)  // Cut
 ENABLE MENU ITEM($menuRef_t;2)  // Copy
  Else 
 DISABLE MENU ITEM($menuRef_t;1)  // Cut
 DISABLE MENU ITEM($menuRef_t;2)  // Copy
  End if 

// determine enabled/disabled for Paste item
  If (Get text from pasteboard="")
 DISABLE MENU ITEM($menuRef_t;3)  // Paste
  Else 
 ENABLE MENU ITEM($menuRef_t;3)  // Paste
  End if 

// display the menu
  $menuItem_t:=Dynamic pop up menu($menuRef_t)

// handle the selected item
  Case of 
 : ($menuItem_t="")
  // nothing selected

 : ($methodName_t#"")  // use custom method handler
EXECUTE METHOD($methodName_t;*;$menuItem_t)

 : ($menuItem_t="Cut")  // handle default Cut operation
POST KEY(Character code("x");Command key mask)

 : ($menuItem_t="Copy")  // handle default Copy operation
POST KEY(Character code("c");Command key mask)

 : ($menuItem_t="Paste")  // handle default Paste operation
POST KEY(Character code("v");Command key mask)

  End case 
   End if 
End if 


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