Re: Pointer to field using field name

2018-05-18 Thread Keisuke Miyako via 4D_Tech
oops you are right!

1 would overflow the max number of tables and fields but won’t have 
problems with long int.



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

Re: Pointer to field using field name

2018-05-18 Thread Arnaud de Montard via 4D_Tech

> Le 18 mai 2018 à 22:41, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> won't 10K could overflow 32-bit integer?
> I would use 32768 as multiplier...

Why?
2^(32-1) > 2,000,000,000

I use more:
$tableAndField:=(100,000*tableNum)+fieldNum

-- 
Arnaud 




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

Re: Pointer to field using field name

2018-05-18 Thread Keisuke Miyako via 4D_Tech
won't 10K could overflow 32-bit integer?
I would use 32768 as multiplier...

> 2018/05/19 2:03、Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> のメール:
> I can't take credit for making it up and I don't recall where I got the
> idea from. If you are really worried about a table with more than 1000
> fields use 10k as the multiplier.




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

PDFjs component - display PDFs without a plug-in

2018-05-18 Thread Jeffrey Kain via 4D_Tech
Hey everyone,

I've created a component and small demo database that lets you use the open 
source Mozilla PDFjs framework to display PDFs in a web area without using a 
plug-in. The PDFs are rendered entirely in JavaScript code and does not require 
anything extra -- no plug-ins in 4D or your browser. It's compatible with 4D 
32-bit as well as High Sierra. It's pretty cool.

It's supposed to work with Windows on systems with IE versions > 9 installed, 
but so far I haven't been able to make it work, but I have a very limited test 
bed of Windows machines to work with. The component and demo are written in 4D 
v15, and I've included the uncompiled component. The only platform-specific 
code is in the demo -- the button "Open PDF in Default App" uses AppleScript -- 
again, there's not much Windows availability here, so I cheated just to get 
this posted.

The PDFjs framework itself is slightly modified - it removes a few buttons from 
the viewer toolbar that crashed 4D (it's located in the Resources folder inside 
the component package). But that functionality can be replaced in your 4D form 
as in the demo. You can print a draft-quality PDF by right-clicking in the web 
area. A high quality print can be obtained by using the button to save a copy 
of the PDF or to open it in the default app. You could also script Preview to 
print it, as well as write scripts to send the PDF to Mail as an attachment.

I'll put this on GitHub eventually. In the meantime I'll take any improvements 
you folks can contribute (just email me).

Hope you like it!

Download from my OneDrive:

https://1drv.ms/u/s!Akpn2ti2N9ePuQFPa0jiG91YjE2z



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




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

RE: v13+ - Picture library going forward

2018-05-18 Thread Chip Scheide via 4D_Tech
Thanks

On Fri, 18 May 2018 17:08:11 +, Timothy Penner via 4D_Tech wrote:
> I forgot to mention, you may want to preserve your transparency 
> during the conversion with this:
> 
>  TRANSFORM PICTURE($Pict_G;Transparency;0x00FF) //0x00FF is white
> 
> This is discussed in the later tech tip:
> Tech Tip: Convert PICT images from Picture Library to PNG while 
> preserving the Transparent background
> http://kb.4d.com/assetid=77963
> Published On: March 17, 2018
> 
> -Tim
> 
> 
> 
> 
> 
> 
> -Original Message-
> From: Timothy Penner
> Sent: Friday, May 18, 2018 10:08 AM
> To: '4D iNug Technical' <4d_tech@lists.4d.com>
> Subject: RE: v13+ - Picture library going forward
> 
> Chip,
> 
>> what can I do in v13 to not have to convert the pictures when moving
>> to v16+
> 
> You are at the perfect version to handle this - The tech tip 
> describing what to do was actually published for v13!
> 
> Tech Tip: A utility to convert PICT images to PNG images
> http://kb.4d.com/assetid=76775
> Published On: March 13, 2013
> 
> 
> -Tim
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: v13+ - Picture library going forward

2018-05-18 Thread Timothy Penner via 4D_Tech
I forgot to mention, you may want to preserve your transparency during the 
conversion with this:

 TRANSFORM PICTURE($Pict_G;Transparency;0x00FF) //0x00FF is white

This is discussed in the later tech tip:
Tech Tip: Convert PICT images from Picture Library to PNG while preserving the 
Transparent background
http://kb.4d.com/assetid=77963
Published On: March 17, 2018

-Tim






-Original Message-
From: Timothy Penner
Sent: Friday, May 18, 2018 10:08 AM
To: '4D iNug Technical' <4d_tech@lists.4d.com>
Subject: RE: v13+ - Picture library going forward

Chip,

> what can I do in v13 to not have to convert the pictures when moving
> to v16+

You are at the perfect version to handle this - The tech tip describing what to 
do was actually published for v13!

Tech Tip: A utility to convert PICT images to PNG images
http://kb.4d.com/assetid=76775
Published On: March 13, 2013


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

RE: v13+ - Picture library going forward

2018-05-18 Thread Timothy Penner via 4D_Tech
Chip,

> what can I do in v13 to not have to convert the pictures when moving to v16+

You are at the perfect version to handle this -
The tech tip describing what to do was actually published for v13!

Tech Tip: A utility to convert PICT images to PNG images
http://kb.4d.com/assetid=76775
Published On: March 13, 2013


-Tim



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

v13+ - Picture library going forward

2018-05-18 Thread Chip Scheide via 4D_Tech
I have pictures in the picture library
I have not converted to v16 or v17 but expect that the pictures are in 
PICT format

what can I do in v13 to not have to convert the pictures when moving to 
v16+

Thanks
Chip
---
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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Pointer to field using field name

2018-05-18 Thread Kirk Brooks via 4D_Tech
Alan,
I'm a little late to this thread and I don't want to muddy the waters but I
find working with numeric pointers to fields helpful in these instances.
What's a 'numeric pointer'? I do it very simply: (table number *
1000)+field number. This yields a unique value for each field and can be
managed with 3 or 4 simple methods. I refer to the value as a 'fieldCode'.
  fieldCode = (table number * 1000)+field number
  table number = fieldCode\1000  //  longint division
  field number = fieldCode%1000
  fieldPointer = Field(fieldCode\1000; fieldCode%1000)

I can't take credit for making it up and I don't recall where I got the
idea from. If you are really worried about a table with more than 1000
fields use 10k as the multiplier.

This eliminates the worry about breaking code because a name changes while
retaining an easy way to identify them. There's no tremendous downside to
storing them as text, btw. It also means you can represent an entire
structure in a single longint array.

On Fri, May 18, 2018 at 7:05 AM Alan Tilson via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>  Hello everyone and thank you for your thoughts on this,
>
> First I don't ever expect to compile our system since working on it live is
> a fundamental requirement of our approach, unless that changes of course...
>
> Secondly I'm actually using dynamic field names since I am using the field
> names from the sister table which are by design exactly the same as their
> sister field in the primary table. So I am taking the field name from the
> sister table and creating a pointer to it's sister (or twin?) field in the
> primary table. As long as I keep both field names the same it should work.
>
> Hard coding the link between the various pairs would certainly work and
> should be the fastest. However, in this case I'm rather attached to my
> generic code where the only thing I have to do to add a field to the
> mirroring is to add it to the sister table.
>
-- 
Kirk Brooks
San Francisco, CA
===

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

Re: v13+ Constants (xlif) and Components, followup

2018-05-18 Thread Chip Scheide via 4D_Tech
if so..
if the host defines that same constant name (also in an xlif file) BUT 
the constant has a value which is different in the host vs the 
component which value is used?

ex: 
Component constant 'My_Constant' ="My_Text"
Host constant 'My_Constant' = "Some other text"

when the host uses 'My_Constant'  which value is retrieved? 
Thanks

On Fri, 18 May 2018 12:03:15 -0400, Chip Scheide via 4D_Tech wrote:
> If I have a constants defined in an xlif file in a component (in the 
> resource folder), can the host 'see' and/or access those constants?
> 
> 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: https://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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

v13+ Constants (xlif) and Components

2018-05-18 Thread Chip Scheide via 4D_Tech
If I have a constants defined in an xlif file in a component (in the 
resource folder), can the host 'see' and/or access those constants?

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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Pointer to field using field name

2018-05-18 Thread Alan Tilson via 4D_Tech
 Hello everyone and thank you for your thoughts on this,

First I don't ever expect to compile our system since working on it live is
a fundamental requirement of our approach, unless that changes of course...

Secondly I'm actually using dynamic field names since I am using the field
names from the sister table which are by design exactly the same as their
sister field in the primary table. So I am taking the field name from the
sister table and creating a pointer to it's sister (or twin?) field in the
primary table. As long as I keep both field names the same it should work.

Hard coding the link between the various pairs would certainly work and
should be the fastest. However, in this case I'm rather attached to my
generic code where the only thing I have to do to add a field to the
mirroring is to add it to the sister table.

If I can find time today I'll play with the various ideas a bit to see if
there is a speed difference and I may also use a process variable.
Currently I'm actually using $0: "EXECUTE
FORMULA("$0:=->"+$tablefieldname)". But tomorrow I'm heading out of town
for a couple of weeks so the crunch is on!

Cheers,
Alan


On Fri, May 18, 2018 at 7:32 AM, Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> > Le 17 mai 2018 à 19:24, Alan Tilson via 4D_Tech <4d_tech@lists.4d.com>
> a écrit :
> >
> > [...]
> > Is there something wrong with this?
> >
> > EXECUTE FORMULA("$pField:=->["+tablename+"]"+fieldname)
> > ​
> > It seems to work and it also seems like it would be fast!
>
> Not sure, it calls the interpreter while a loop does not. Mostly, as Neil
> said, it will fail in compiled mode as EXECUTE FORMULA does not work with
> $local variables:
> 
>
> In your situation, I'd use any mentioned trick (execute formula, loop
> through fields…) to generate hardcode to paste, something like this:
>   ++
>   $code:=""
>   for($i;1;$fieldCount)
> $source:=getFieldName(table1;$i)
> $target:=getFieldByName(table2;$source)
> $code:=$code+$target+":="+$source+"\r"
>   end for
>   set text to pasteboard($code)  //then paste in the method…
>   ++
> No hidden fields references, surely the fastest.
>
> --
> Arnaud de Montard
>
>
>
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

procedurally delete anchored image in 4D Write Pro

2018-05-18 Thread Piotr Chabot Stadhouders via 4D_Tech
Hi,

Sorry, but I don't see it:
How can I procedurally delete an anchored image in a 4D Write Pro document?

I know how to select the image with
WP SELECT(*;"WParea";$image_object)

But then what?
I hope somebody knows the answer.

Gr,

Piotr

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

Re: Pointer to field using field name

2018-05-18 Thread Arnaud de Montard via 4D_Tech

> Le 17 mai 2018 à 19:24, Alan Tilson via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> [...]
> Is there something wrong with this?
> 
> EXECUTE FORMULA("$pField:=->["+tablename+"]"+fieldname)
> ​
> It seems to work and it also seems like it would be fast!

Not sure, it calls the interpreter while a loop does not. Mostly, as Neil said, 
it will fail in compiled mode as EXECUTE FORMULA does not work with $local 
variables:


In your situation, I'd use any mentioned trick (execute formula, loop through 
fields…) to generate hardcode to paste, something like this:
  ++
  $code:=""
  for($i;1;$fieldCount)
$source:=getFieldName(table1;$i)
$target:=getFieldByName(table2;$source)
$code:=$code+$target+":="+$source+"\r"
  end for
  set text to pasteboard($code)  //then paste in the method… 
  ++
No hidden fields references, surely the fastest. 

-- 
Arnaud de Montard 




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

Re: SOAP Parameter Limit (Sujit Shah)

2018-05-18 Thread Sujit Shah via 4D_Tech
Agree XML or JSON would be best. At this stage only providing support to an
existing web service.

On Fri, May 18, 2018 at 7:51 PM, Wayne Stewart via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> If I needed to pass that many parameters I'd pass them as a JSON string.
>
> One text parameter containing as many as you want.
>
> Regards,
>
> Wayne
>
>
> Wayne Stewart
> about.me/waynestewart
>
>
>
>
> On 18 May 2018 at 19:10, Bruno LEGAY via 4D_Tech <4d_tech@lists.4d.com>
> wrote:
> > Hi,
> >
> > I don't think I have tried to send soap call with that many parameters.
> >
> > Anyway it is not that complicated to create your own soap calls (it is
> xml over http).
> >
> > Let me know if you want more infos on how to do this.
> >
> > HTH
> > Bruno
> >
> >
> > **
> > 4D Internet Users Group (4D iNUG)
> > FAQ:  http://lists.4d.com/faqnug.html
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://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: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>



-- 

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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SOAP Parameter Limit (Sujit Shah)

2018-05-18 Thread Wayne Stewart via 4D_Tech
If I needed to pass that many parameters I'd pass them as a JSON string.

One text parameter containing as many as you want.

Regards,

Wayne


Wayne Stewart
about.me/waynestewart




On 18 May 2018 at 19:10, Bruno LEGAY via 4D_Tech <4d_tech@lists.4d.com> wrote:
> Hi,
>
> I don't think I have tried to send soap call with that many parameters.
>
> Anyway it is not that complicated to create your own soap calls (it is xml 
> over http).
>
> Let me know if you want more infos on how to do this.
>
> HTH
> Bruno
>
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: SOAP Parameter Limit (Sujit Shah)

2018-05-18 Thread Bruno LEGAY via 4D_Tech
Hi,

I don't think I have tried to send soap call with that many parameters.

Anyway it is not that complicated to create your own soap calls (it is xml over 
http).

Let me know if you want more infos on how to do this.

HTH
Bruno


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