Re: Picture gallery in web area?

2016-11-09 Thread Keith Goebel

> On 10/11/2016, at 12:37 pm, Scott Staley wrote:
> I assume you've seen the imagebrowser tech note but incase not...
> http://kb.4d.com/assetid=76606

Scott,
No I haven’t seen that. I will check it out - thanks.
I did a KnowledgeBase search for "picture gallery" (and some other similar 
searches) and the only item found was "Using SVG to create List Box cells with 
images and text”.
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: Tokens for Methods?

2016-11-09 Thread David Adams
Yeah, not much sleep. If you did want to go with the brute-force method,
you would also need to (at the least):

* Excise all comments first.

* Figure out what to do about Begin/End SQL blocks.

* Figure out what to do with things that are named the same, like
fields/vars/methods.
**
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: web serving from 4D client

2016-11-09 Thread cswirth
Bill,

"Since the system is a built c/s project and we do auto updates quite often"

It's my experience in v15 that you need to reset the Default HTML root after
an update.

Scott



--
View this message in context: 
http://4d.1045681.n5.nabble.com/web-serving-from-4D-client-tp5748533p5748574.html
Sent from the 4D Tech mailing list archive at Nabble.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: Tokens for Methods?

2016-11-09 Thread Keisuke Miyako
would you be willing to share what is it you want accomplish?
normally I would select a method in the Explorer and "search for dependencies" 
from the context menu.
the result contains the method it self, which is a bit weird, but you can drag 
and drop the list to any text editor.

> 2016/11/10 7:18、Richard Wright  のメール:
> Does anyone know how 4D tokenizes method names? I can get the method resource 
> into a blob using API Pack and would very much like to be able to extract all 
> methods that are called.



宮古 啓介
セールス・エンジニア

株式会社フォーディー・ジャパン
〒150-0043
東京都渋谷区道玄坂1-10-2 渋谷THビル6F
Tel: 03-6427-8441
Fax: 03-6427-8449

keisuke.miy...@4d.com
www.4D.com/JP

**
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: Subform Object Name

2016-11-09 Thread David Adams
On Thu, Nov 10, 2016 at 10:04 AM, Keisuke Miyako 
wrote:

> subform widgets kind of follow Demeter's law,
> there are supposed to work with as little context information as possible.
>
> if it must "know",
> you need to "tell" that information from the container object.
>

For those that don't know this term, I just ran into it a few days ago in a
couple of good pieces by Martin Fowler:

http://martinfowler.com/articles/mocksArentStubs.html

http://martinfowler.com/bliki/TellDontAsk.html

For those that don't know who Martin Fowler is, well, he's awesome. He's
one of the handful of people in the world that comments on OO analysis,
design, and programming in a way that's easy-to-understand, theoretically
coherent, and pragmatic. He's been at it for decades and is the guy that
made "refactoring" the word it is in programming today. (The book is
excellent, and not long, by the way.)

For those of us not working in an OO language:

* A lot of the underlying concepts of data hiding, grouping data & behavior
aren't exclusively OO. They're just good programming design that OO
absorbed and (in profound ways) simplified. So, the same ideas have merit
in a 4D context.

* Even if you don't follow a pattern like 'tell, don't ask', it's kind of a
great pattern to have in your mind as a concept. Sometimes it's really a
nicer design on a practical level in 4D, sometimes it means writing a ton
of little hook routines and is too much of a pain to justify itself. It
depends.

* Either way, it's always good to isolate program control data and access
it from a small, well-regulated, clearly named set of routines.
**
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: Subform Object Name

2016-11-09 Thread Kirk Brooks
Cannon,
Yeah, subforms as c-objects is pretty powerful. Looking forward to using
that in deployment.

On Wed, Nov 9, 2016 at 4:10 PM, Cannon Smith <
can...@synergyfarmsolutions.com> wrote:

> Hi Kirk,
>
> That’s actually just what I do, except that I make the subform a c_object
> instead of text so I can access it directly. I’m in v15r5 which makes this
> possible. A very nice technique
>

-- 
Kirk Brooks
San Francisco, CA
===
**
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: Subform Object Name

2016-11-09 Thread Kirk Brooks
Cannon,
One technique I use on subforms is to make them text objects. Then I like
to set their value to a json string of interesting information about them.
So I might create a c-obj and put some data into it including the name of
the subform, then stringify that to the subform object. Then I can execute
the subform controller method in the subform and have it configure itself.

You can also make a method utilizing FORM GET OBJECTS and Object get
pointer(Object subform container). If you get the array of object pointers
on the form you can search for the pointer to the subform and then get the
name.


On Wed, Nov 9, 2016 at 10:36 AM, Cannon Smith <
can...@synergyfarmsolutions.com> wrote:

> Does anyone know how to get the object name of a subform in code when
> executing within the context of the subform itself? I’m stumped.
>
> For example, say I have a form that has two identical subforms on it named
> Sub1 and Sub2. When some code is executing within the context of Sub1, I
> want to be able to know I’m in the context of “Sub1”.
>

-- 
Kirk Brooks
San Francisco, CA
===
**
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: Automatic Variable Assignment and Web Get Variables - Bad usage of pointer or pointer to an unknown variable

2016-11-09 Thread Mike McCall
Thank you so very much Lee,

I'm still a little foggy on the whole C_Object concept but regardless of that 
limitation on my part your example was exactly what I needed to get me started.

It is AMAZING!

I did some exaggerated stress testing and it seemed to be 100 to as much as 
1,000 times as fast as using find in array!  That performance was more than 
quick enough to allow me to use this implementation. The worst case is that it 
adds a millisecond or so to each interaction.

Because of that, in brief, I simply copied my variables from compiler_variables 
and pasted them into a new method and then did a global replace of all 
"C_Text("with APPEND TO ARRAY(<>arr_Defined_Text_Variables;".  I run the new 
method at startup and then execute the code below to build the object per your 
example.

Thank you again!

C_OBJECT(<>Obj_Defined_Text_Variables)
For ($i;1;Size of array(<>arr_Defined_Text_Variables))
$VariableName:=<>arr_Defined_Text_Variables{$i}
OB SET(<>Obj_Defined_Text_Variables;$VariableName;"")
End for
ARRAY TEXT(<>arr_Defined_Text_Variables;0)

-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Lee Hinde
Sent: Wednesday, November 9, 2016 1:26 PM
To: 4D iNug Tech <4d_tech@lists.4d.com>
Subject: Re: Automatic Variable Assignment and Web Get Variables - Bad usage of 
pointer or pointer to an unknown variable

C_OBJECT($temp)

For ($index;1;2)

$key:="Variable_"+String($index)+"_name"

OB SET($temp;$key;"")
End for 

C_BOOLEAN($test)
C_LONGINT($start)
$start:=Milliseconds
$test:=OB Is defined($temp;"Variable_1_name")
ALERT(String(Milliseconds-$start))  // I get 0

  //versus

ARRAY TEXT($temp_array;0)
C_LONGINT($fnd)

For ($index;1;2)

$key:="Variable_"+String($index)+"_name"
APPEND TO ARRAY($temp_array;$key)
End for 

$start:=Milliseconds
$fnd:=Find in array($temp_array;"Variable_1_name")
ALERT(String(Milliseconds-$start)) // I get 1

If I change the search parameter to Variable_2_name, the array takes twice 
as long (2) and the c_object search is still 0.

This may or may not have been Justin’s point. :-)


> On Nov 9, 2016, at 1:03 PM, Mike McCall  wrote:
> 
> Thanks Lee,
> 
> Unfortunately, I'm not familiar with c_objects and how they might work in my 
> case. Would it be possible to give me a brief example that I could then adapt 
> and test.
> 
> Thanks again,
> 
> Mike
> 
> -Original Message-
> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Lee 
> Hinde
> Sent: Wednesday, November 9, 2016 12:59 PM
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: Automatic Variable Assignment and Web Get Variables - Bad 
> usage of pointer or pointer to an unknown variable
> 
> Justin Leavens did a summit presentation that showed c_objects were much 
> faster than arrays for searching. Might be worth a test.
> 
> On Wed, Nov 9, 2016 at 12:47 PM, Mike McCall 
> 
> wrote:
> 
>> Thanks so much Chip for the suggestion,
>> 
>> That thought also crossed my mind but unfortunately with the silly 
>> number of variables we currently have, over 20,000 in total, my 
>> initial tests suggested that it could seriously affect performance to 
>> go with that approach.
>> 
>> I'd really prefer not to have to do a complete rewrite of how we 
>> handle form fields since that would be very time consuming.
>> 
>> Thanks again and definitely let me know if you or anyone else has any 
>> other idea.
>> 
>> Mike
>> 
>> -Original Message-
>> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Chip 
>> Scheide
>> Sent: Wednesday, November 9, 2016 12:38 PM
>> To: 4D iNug Technical <4d_tech@lists.4d.com>
>> Subject: Re: Automatic Variable Assignment and Web Get Variables - 
>> Bad usage of pointer or pointer to an unknown variable
>> 
>> I do NO web work so take this idea with that in mind
>> 
>> Instead of :
>> On Wed, 9 Nov 2016 19:58:16 +, Mike McCall wrote:
>>>  Else
>>>  $p:=Get pointer(arr_Web_Field_Name{$i})
>>>  $p->:=arr_Web_Field_Value{$i}
>>>  End case
>> 
>> if (find in array($arr_Legal_Variable_Names;arr_Web_Field_Name{$i})>0)
>>   $p:=Get pointer(arr_Web_Field_Name{$i})
>>   $p->:=arr_Web_Field_Value{$i}
>> else
>>   `do nasty things since someone tried to hack your server end if
>> 
>> Where arr_Legal_Variable_Names
>> is an array of valid variable names and any value NOT in this array 
>> is an error Chip
>> 
>> 
> 

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

Re: Automatic Variable Assignment and Web Get Variables - Bad usage of pointer or pointer to an unknown variable

2016-11-09 Thread Keisuke Miyako
perhaps you could test Not(Nil( $p))) and Type($p->) following Get pointer.

remember, a 4D pointer is a structure, not an address,
just some information about what to look for (the name in case of a variable),
it can be not Nil but point to something that does not exist.

but I also favour a flat object containing all the web form variables,
it makes sense (a valid form variable name is a valid property name),
it is fast (property names are hashed),
it is easy (no need to Find in array and test for #-1).
I would even go a step further and wish WEB GET VARIABLES would return an 
object.



> 2016/11/10 4:58、Mike McCall  のメール:
> Is there any way we could avoid this from happening?



宮古 啓介
セールス・エンジニア

株式会社フォーディー・ジャパン
〒150-0043
東京都渋谷区道玄坂1-10-2 渋谷THビル6F
Tel: 03-6427-8441
Fax: 03-6427-8449

keisuke.miy...@4d.com
www.4D.com/JP

**
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: Picture gallery in web area?

2016-11-09 Thread Scott Staley
I assume you've seen the imagebrowser tech note but incase not...

http://kb.4d.com/assetid=76606



--
View this message in context: 
http://4d.1045681.n5.nabble.com/Picture-gallery-in-web-area-tp5748558p5748562.html
Sent from the 4D Tech mailing list archive at Nabble.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: Subform Object Name

2016-11-09 Thread Keisuke Miyako
subform widgets kind of follow Demeter's law,
there are supposed to work with as little context information as possible.

if it must "know",
you need to "tell" that information from the container object.

> For example, say I have a form that has two identical subforms on it named 
> Sub1 and Sub2. When some code is executing within the context of Sub1, I want 
> to be able to know I’m in the context of “Sub1”.



宮古 啓介
セールス・エンジニア

株式会社フォーディー・ジャパン
〒150-0043
東京都渋谷区道玄坂1-10-2 渋谷THビル6F
Tel: 03-6427-8441
Fax: 03-6427-8449

keisuke.miy...@4d.com
www.4D.com/JP

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

sql server to 4D connection

2016-11-09 Thread Chuck Miller
Hi All,

Has anyone connected from sql server into a 4D server retrieved records into 
local tables. If so what tools did you use. 

Thanks and regards

Chuck

 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064   
mailto:cjmillerinformed-solutions.com 
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D and Sybase connectivity
  http://www.informed-solutions.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
**

Tokens for Methods?

2016-11-09 Thread Richard Wright
Does anyone know how 4D tokenizes method names? I can get the method resource 
into a blob using API Pack and would very much like to be able to extract all 
methods that are called.


Richard Wright
DataDomain
rwri...@datadomainsoftware.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
**

Picture gallery in web area?

2016-11-09 Thread Keith Goebel
Hi all.
I have seen, on the web, a type of picture gallery I would like to put on an 
input form in our 4D v15.2 Win app (in a web area).
I have been Googling for pic gallery libraries and am overwhelmed trying to 
make sense of the results, most of which seem to require php code manipulation.
I have medium knowledge of html, beginner at js, and zero knowledge of php.

Has anyone deployed a gallery similar to our ideal gallery (described below)?
If so, can you share how you did it?

The ideal is:
- available pictures will be in a preset folder
- upper central "larger" image shows first pic on open web area
- on either side will be arrows (previous/next)
- click on the larger pic and it expands to cover the entire web area until 
a click anywhere to revert back to what was
- below will be a narrow horizontal bar with thumbnails of available images, 
able to be scrolled sideways
- on the bar, the "current" pic will be highlighted in some way
- as the cursor is hovered over a thumbnail, the pic will show as the 
larger pic above, but that won't stay "big" until the thumbnail is clicked.
- a click on a thumbnail moves it to the centre pic in the bar
- a black background all round might look nice

Not asking for much am I... :-)

If there is no info forthcoming, I guess I can always do it using native 4D - 
might not look as good.
I haven't tried it but, if I use 4D, perhaps I could use a 1 row array listbox 
as the thumbnail bar (each column would contain a picture array with 1 
element)...
TIA, 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: Subform Object Name

2016-11-09 Thread Bertrand SOUBEYRAND

> Le 9 nov. 2016 à 19:36, Cannon Smith  a 
> écrit :
> 
> Does anyone know how to get the object name of a subform in code when 
> executing within the context of the subform itself? I’m stumped.


Maybe CONVERT COORDINATES could help:

http://livedoc.4d.com/4D-Language-Reference-16/Windows/CONVERT-COORDINATES.301-3036395.en.html


Bertrand SOUBEYRAND
---
La Soub Compagnie
33 bd de la Liberté - 13001 Marseille
Bureau : +33 4 84 25 21 99
http://www.soubeyrand-4d-developer.eu 

Belgique : +32 87 84 00 88




**
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: Automatic Variable Assignment and Web Get Variables - Bad usage of pointer or pointer to an unknown variable

2016-11-09 Thread Lee Hinde
C_OBJECT($temp)

For ($index;1;2)

$key:="Variable_"+String($index)+"_name"

OB SET($temp;$key;"")
End for 

C_BOOLEAN($test)
C_LONGINT($start)
$start:=Milliseconds
$test:=OB Is defined($temp;"Variable_1_name")
ALERT(String(Milliseconds-$start))  // I get 0

  //versus

ARRAY TEXT($temp_array;0)
C_LONGINT($fnd)

For ($index;1;2)

$key:="Variable_"+String($index)+"_name"
APPEND TO ARRAY($temp_array;$key)
End for 

$start:=Milliseconds
$fnd:=Find in array($temp_array;"Variable_1_name")
ALERT(String(Milliseconds-$start)) // I get 1

If I change the search parameter to Variable_2_name, the array takes twice 
as long (2) and the c_object search is still 0.

This may or may not have been Justin’s point. :-)


> On Nov 9, 2016, at 1:03 PM, Mike McCall  wrote:
> 
> Thanks Lee,
> 
> Unfortunately, I'm not familiar with c_objects and how they might work in my 
> case. Would it be possible to give me a brief example that I could then adapt 
> and test.
> 
> Thanks again,
> 
> Mike
> 
> -Original Message-
> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Lee Hinde
> Sent: Wednesday, November 9, 2016 12:59 PM
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: Automatic Variable Assignment and Web Get Variables - Bad usage 
> of pointer or pointer to an unknown variable
> 
> Justin Leavens did a summit presentation that showed c_objects were much 
> faster than arrays for searching. Might be worth a test.
> 
> On Wed, Nov 9, 2016 at 12:47 PM, Mike McCall 
> wrote:
> 
>> Thanks so much Chip for the suggestion,
>> 
>> That thought also crossed my mind but unfortunately with the silly 
>> number of variables we currently have, over 20,000 in total, my 
>> initial tests suggested that it could seriously affect performance to 
>> go with that approach.
>> 
>> I'd really prefer not to have to do a complete rewrite of how we 
>> handle form fields since that would be very time consuming.
>> 
>> Thanks again and definitely let me know if you or anyone else has any 
>> other idea.
>> 
>> Mike
>> 
>> -Original Message-
>> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Chip 
>> Scheide
>> Sent: Wednesday, November 9, 2016 12:38 PM
>> To: 4D iNug Technical <4d_tech@lists.4d.com>
>> Subject: Re: Automatic Variable Assignment and Web Get Variables - Bad 
>> usage of pointer or pointer to an unknown variable
>> 
>> I do NO web work so take this idea with that in mind
>> 
>> Instead of :
>> On Wed, 9 Nov 2016 19:58:16 +, Mike McCall wrote:
>>>  Else
>>>  $p:=Get pointer(arr_Web_Field_Name{$i})
>>>  $p->:=arr_Web_Field_Value{$i}
>>>  End case
>> 
>> if (find in array($arr_Legal_Variable_Names;arr_Web_Field_Name{$i})>0)
>>   $p:=Get pointer(arr_Web_Field_Name{$i})
>>   $p->:=arr_Web_Field_Value{$i}
>> else
>>   `do nasty things since someone tried to hack your server end if
>> 
>> Where arr_Legal_Variable_Names
>> is an array of valid variable names and any value NOT in this array is 
>> an error Chip
>> 
>> 
> 

**
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: Automatic Variable Assignment and Web Get Variables - Bad usage of pointer or pointer to an unknown variable

2016-11-09 Thread John DeSoi

> On Nov 9, 2016, at 1:58 PM, Mike McCall  wrote:
> 
> In a compiled application it works fine as well unless someone were to 
> maliciously or somehow inadvertently submit a web page with a field name 
> which was not defined in our application. In brief if they modified an html 
> form to submit to our application and added a non-existent field, then a 
> -20010 error - Bad usage of pointer or pointer to an unknown variable message 
> would be generated and the connection would hang until we clicked OK on the 
> message on the server.
> 
> Is there any way we could avoid this from happening? We were hopeful that 
> using "undefined" would help but that doesn't work in a compiled database. 

Why not use an error handler to catch the error and abort processing of the 
form?

John DeSoi, Ph.D.

**
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: Subform Object Name

2016-11-09 Thread Cannon Smith
Unfortunately, it is the same method every time. :-(

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




> On Nov 9, 2016, at 1:57 PM, Arnaud de Montard  wrote:
> 
> second chance…
> 'current method 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
**

RE: Automatic Variable Assignment and Web Get Variables - Bad usage of pointer or pointer to an unknown variable

2016-11-09 Thread Mike McCall
Thanks Lee,

Unfortunately, I'm not familiar with c_objects and how they might work in my 
case. Would it be possible to give me a brief example that I could then adapt 
and test.

Thanks again,

Mike

-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Lee Hinde
Sent: Wednesday, November 9, 2016 12:59 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: Automatic Variable Assignment and Web Get Variables - Bad usage of 
pointer or pointer to an unknown variable

Justin Leavens did a summit presentation that showed c_objects were much faster 
than arrays for searching. Might be worth a test.

On Wed, Nov 9, 2016 at 12:47 PM, Mike McCall 
wrote:

> Thanks so much Chip for the suggestion,
>
> That thought also crossed my mind but unfortunately with the silly 
> number of variables we currently have, over 20,000 in total, my 
> initial tests suggested that it could seriously affect performance to 
> go with that approach.
>
> I'd really prefer not to have to do a complete rewrite of how we 
> handle form fields since that would be very time consuming.
>
> Thanks again and definitely let me know if you or anyone else has any 
> other idea.
>
> Mike
>
> -Original Message-
> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Chip 
> Scheide
> Sent: Wednesday, November 9, 2016 12:38 PM
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: Automatic Variable Assignment and Web Get Variables - Bad 
> usage of pointer or pointer to an unknown variable
>
> I do NO web work so take this idea with that in mind
>
> Instead of :
> On Wed, 9 Nov 2016 19:58:16 +, Mike McCall wrote:
> >   Else
> >   $p:=Get pointer(arr_Web_Field_Name{$i})
> >   $p->:=arr_Web_Field_Value{$i}
> >   End case
>
> if (find in array($arr_Legal_Variable_Names;arr_Web_Field_Name{$i})>0)
>$p:=Get pointer(arr_Web_Field_Name{$i})
>$p->:=arr_Web_Field_Value{$i}
> else
>`do nasty things since someone tried to hack your server end if
>
> Where arr_Legal_Variable_Names
> is an array of valid variable names and any value NOT in this array is 
> an error Chip
>
>
**
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: Subform Object Name

2016-11-09 Thread Cannon Smith
Hi Ortwin,

That is closer. If I use that and then RESOLVE POINTER, I can get access to the 
name of the variable associated with the object. But not the object name itself.

Thanks.

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




> On Nov 9, 2016, at 1:42 PM, Ortwin Zillgen  wrote:
> 
> just wondering
> $P_boundObj:=OBJECT Get pointer(Object subform container)
> 
> V15 and better supports variables of type object directly
> 

**
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: Automatic Variable Assignment and Web Get Variables - Bad usage of pointer or pointer to an unknown variable

2016-11-09 Thread Lee Hinde
Justin Leavens did a summit presentation that showed c_objects were much
faster than arrays for searching. Might be worth a test.

On Wed, Nov 9, 2016 at 12:47 PM, Mike McCall 
wrote:

> Thanks so much Chip for the suggestion,
>
> That thought also crossed my mind but unfortunately with the silly number
> of variables we currently have, over 20,000 in total, my initial tests
> suggested that it could seriously affect performance to go with that
> approach.
>
> I'd really prefer not to have to do a complete rewrite of how we handle
> form fields since that would be very time consuming.
>
> Thanks again and definitely let me know if you or anyone else has any
> other idea.
>
> Mike
>
> -Original Message-
> From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Chip
> Scheide
> Sent: Wednesday, November 9, 2016 12:38 PM
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Subject: Re: Automatic Variable Assignment and Web Get Variables - Bad
> usage of pointer or pointer to an unknown variable
>
> I do NO web work so take this idea with that in mind
>
> Instead of :
> On Wed, 9 Nov 2016 19:58:16 +, Mike McCall wrote:
> >   Else
> >   $p:=Get pointer(arr_Web_Field_Name{$i})
> >   $p->:=arr_Web_Field_Value{$i}
> >   End case
>
> if (find in array($arr_Legal_Variable_Names;arr_Web_Field_Name{$i})>0)
>$p:=Get pointer(arr_Web_Field_Name{$i})
>$p->:=arr_Web_Field_Value{$i}
> else
>`do nasty things since someone tried to hack your server end if
>
> Where arr_Legal_Variable_Names
> is an array of valid variable names and any value NOT in this array is an
> error Chip
>
>
**
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: Automatic Variable Assignment and Web Get Variables - Bad usage of pointer or pointer to an unknown variable

2016-11-09 Thread Mike McCall
Thanks so much Chip for the suggestion,

That thought also crossed my mind but unfortunately with the silly number of 
variables we currently have, over 20,000 in total, my initial tests suggested 
that it could seriously affect performance to go with that approach.

I'd really prefer not to have to do a complete rewrite of how we handle form 
fields since that would be very time consuming.

Thanks again and definitely let me know if you or anyone else has any other 
idea.

Mike

-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Chip Scheide
Sent: Wednesday, November 9, 2016 12:38 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: Automatic Variable Assignment and Web Get Variables - Bad usage of 
pointer or pointer to an unknown variable

I do NO web work so take this idea with that in mind

Instead of :
On Wed, 9 Nov 2016 19:58:16 +, Mike McCall wrote:
>   Else 
>   $p:=Get pointer(arr_Web_Field_Name{$i})
>   $p->:=arr_Web_Field_Value{$i}
>   End case

if (find in array($arr_Legal_Variable_Names;arr_Web_Field_Name{$i})>0)
   $p:=Get pointer(arr_Web_Field_Name{$i})
   $p->:=arr_Web_Field_Value{$i}
else
   `do nasty things since someone tried to hack your server end if

Where arr_Legal_Variable_Names
is an array of valid variable names and any value NOT in this array is an error 
Chip
**
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: Subform Object Name

2016-11-09 Thread Arnaud de Montard

> Le 9 nov. 2016 à 21:54, Cannon Smith  a 
> écrit :
> 
> Hi Aurnaud,
> 
> That helps a bit as well, but if there are multiple subforms that all come 
> from the same form, they all share the same form name.

second chance…
'current method name'?

-- 
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: Subform Object Name

2016-11-09 Thread Arnaud de Montard

> Le 9 nov. 2016 à 19:36, Cannon Smith  a 
> écrit :
> 
> For example, say I have a form that has two identical subforms on it named 
> Sub1 and Sub2. When some code is executing within the context of Sub1, I want 
> to be able to know I’m in the context of “Sub1”.

'Current form name'?

-- 
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: Automatic Variable Assignment and Web Get Variables - Bad usage of pointer or pointer to an unknown variable

2016-11-09 Thread Lee Hinde
On Wed, Nov 9, 2016 at 12:37 PM, Chip Scheide <4d_o...@pghrepository.org>
wrote:

> I do NO web work so take this idea with that in mind
>
> Instead of :
> On Wed, 9 Nov 2016 19:58:16 +, Mike McCall wrote:
> >   Else
> >   $p:=Get pointer(arr_Web_Field_Name{$i})
> >   $p->:=arr_Web_Field_Value{$i}
> >   End case
>
> if (find in array($arr_Legal_Variable_Names;arr_Web_Field_Name{$i})>0)
>$p:=Get pointer(arr_Web_Field_Name{$i})
>$p->:=arr_Web_Field_Value{$i}
> else
>`do nasty things since someone tried to hack your server
> end if
>
> Where arr_Legal_Variable_Names
> is an array of valid variable names and any value NOT in this array is
> an error
> Chip
>
> I do a lot of web work and I think this is a good idea.
**
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: Subform Object Name

2016-11-09 Thread Ortwin Zillgen
> Does anyone know how to get the object name of a subform in code when 
> executing within the context of the subform itself? I’m stumped.
> 
> For example, say I have a form that has two identical subforms on it named 
> Sub1 and Sub2. When some code is executing within the context of Sub1, I want 
> to be able to know I’m in the context of “Sub1”.

just wondering
$P_boundObj:=OBJECT Get pointer(Object subform container)

V15 and better supports variables of type object directly


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

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

Re: Automatic Variable Assignment and Web Get Variables - Bad usage of pointer or pointer to an unknown variable

2016-11-09 Thread Chip Scheide
I do NO web work so take this idea with that in mind

Instead of :
On Wed, 9 Nov 2016 19:58:16 +, Mike McCall wrote:
>   Else 
>   $p:=Get pointer(arr_Web_Field_Name{$i})
>   $p->:=arr_Web_Field_Value{$i}
>   End case 

if (find in array($arr_Legal_Variable_Names;arr_Web_Field_Name{$i})>0)
   $p:=Get pointer(arr_Web_Field_Name{$i})
   $p->:=arr_Web_Field_Value{$i}
else
   `do nasty things since someone tried to hack your server
end if

Where arr_Legal_Variable_Names
is an array of valid variable names and any value NOT in this array is 
an error
Chip
**
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: Subform Object Name

2016-11-09 Thread Cannon Smith
Hi John,

Thanks for the idea. Unfortunately, it doesn’t work. The subform often doesn’t 
have the focus when the code is running.

Thanks anyway.

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




> On Nov 9, 2016, at 1:23 PM, truegold  wrote:
> 
> Might something like:
> 
> $obj_ptr:=OBJECT Get pointer(Object current)  // Points to the container 
> itself
> $obj_Name:=OBJECT Get name(obj_ptr)   // Name of the container
> 
> Is this what you mean?
> 

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

Automatic Variable Assignment and Web Get Variables - Bad usage of pointer or pointer to an unknown variable

2016-11-09 Thread Mike McCall
Thanks in advance for any assistance,

This is probably something I should know and clearly something I could do 
differently but for now I'm hoping for an easy solution.

I believe 4D is moving away from the Automatic Variable Assignment option when 
using a browser to access a 4D enabled Web server. As they do that I believe 
the replacement approach is to use Web Get Variables. Because we have a silly 
number of variables (i.e., 20,000) which could be called from any given web 
page we'd like use something similar to the code below to assign the values 
received using Web Get Variables to their corresponding and existing variables 
using pointers. That would allow us to move away from the Automatic variable 
assignment without a major rewrite to our code.

In an uncompiled application the code works fine. 

In a compiled application it works fine as well unless someone were to 
maliciously or somehow inadvertently submit a web page with a field name which 
was not defined in our application. In brief if they modified an html form to 
submit to our application and added a non-existent field, then a -20010 error - 
Bad usage of pointer or pointer to an unknown variable message would be 
generated and the connection would hang until we clicked OK on the message on 
the server.

Is there any way we could avoid this from happening? We were hopeful that using 
"undefined" would help but that doesn't work in a compiled database. 

Aside from a major rewrite of how we handle the fields from a form statement 
does anyone know how we could just ignore unknown field names o handle them 
without the error message being generated in a compiled database?

Code used during On Web Authentication

C_TEXT($1;$2;$3;$4;$5;$6)
C_TEXT(vtSystem_Password;vtSystem_User;vtSystem_Server_IP;vtSystem_Client_IP;vtSystem_Hdr;vtSystem_URL)
$0:=True
vtSystem_URL:=$1
vtSystem_Hdr:=$2
vtSystem_Client_IP:=$3
vtSystem_Server_IP:=$4
vtSystem_User:=$5
vtSystem_Password:=$6

$vt_GetOrPost:=""
$vt_GetOrPost:=Substring(vtSystem_Hdr;1;4)
If ($vt_GetOrPost="Post")
ARRAY TEXT(arr_Web_Field_Name;0)
ARRAY TEXT(arr_Web_Field_Value;0)
WEB GET VARIABLES(arr_Web_Field_Name;arr_Web_Field_Value)

For ($i;1;Size of array(arr_Web_Field_Name))
  //ALERT(string($i)+" - "+arr_Web_Field_Name{$i})
Case of 
: (arr_Web_Field_Name{$i}="vbFileName")

C_TEXT($vPartName;$vPartMimeType;$vPartFileName;$vDestinationFolder)
C_BLOB($vPartContentBlob)
C_BLOB(vbFileName)
C_LONGINT($i)
For ($j;1;WEB Get body part count)  //for each 
part
WEB GET BODY 
PART($i;$vPartContentBlob;$vPartName;$vPartMimeType;$vPartFileName)
If ($vPartFileName#"")
vbFileName:=$vPartContentBlob

vt_OrignalFileName:=$vPartFileName
vt_cttype:=$vPartMimeType
  //BLOB TO 
DOCUMENT($vDestinationFolder+$vPartFileName;$vPartContentBlob)
End if 
End for 
Else 
$p:=Get pointer(arr_Web_Field_Name{$i})
$p->:=arr_Web_Field_Value{$i}
End case 
End for 

End if


Mike McCall 
Facilitate.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: connecting to SQL server from a Mac

2016-11-09 Thread Guy Algot
Chuck, I’ve used their drivers and they have done the job for me.

> On Nov 9, 2016, at 10:47 AM, Chuck Miller  
> wrote:
> 
> Hi All,
> 
> it’s been a while since I had to do this. What drivers are people out there 
> using. I was using actual technology ODBC driver. Is this still recommended 
> approach?
> 
> Is there some other method. This will be in 4D v 15.2
> 
> Regards
> 
> Chuck




**
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: connecting to SQL server from a Mac

2016-11-09 Thread Dennis, Neil
> it’s been a while since I had to do this. What drivers are people out there 
> using. I was using actual technology ODBC driver. Is this still recommended 
> approach?

I have had good results from Actual Technologies:

http://www.actualtech.com/readme.php


Neil





--



Privacy Disclaimer: This message contains confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this email. Please delete this email 
from your system and notify the sender immediately by replying to this email.  
If you are not the intended recipient you are notified that disclosing, 
copying, distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range 
of services to hedge funds, funds of funds and private equity funds.  Any tax 
advice in this communication is not intended to be used, and cannot be used, by 
a client or any other person or entity for the purpose of (a) avoiding 
penalties that may be imposed on any taxpayer or (b) promoting, marketing, or 
recommending to another party any matter addressed herein.
**
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
**

web serving from 4D client

2016-11-09 Thread Bill Weale
Under the Web topic of the Database Setting ui, is this config area effective 
only if the web server is run from 4D Server?


Another way to ask:

Must all web server database settings be configured via code, if the web server 
runs from 4D Remote?

Thanks,

Bill



William W. Weale

Business Owners Support, LLC.

Operations Analysis
MIS Advising
Decision Support Systems

**
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: Questionary into the mail message

2016-11-09 Thread Dennis, Neil
>1 - With 4D i send an email with an HTML code included with some questions.
>2 - The user open the mail with the his mail manager application, compile this 
>questions and send the mail answer that contain the questionary
>3 - In 4D i need to receve this email and take the answers for save the 
>answers into the database.
>
>Is possibile to do this on 4D?

You can do anything in 4D :)

For your case I would suggest using the 4D Internet Commands to create, send, 
load and extract the email messages: 
http://doc.4d.com/4Dv15R5/4D-Internet-Commands/15-R5.1550/4D-Internet-Commands.100-3013094.en.html

You also might want to consider 4D write pro for creating html email messages 
it makes them easier. 
http://doc.4d.com/4Dv15R5/4D/15-R5/4D-Write-Pro-Reference.100-2936204.en.html

Neil





--

Privacy Disclaimer: This message contains confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this email. Please delete this email 
from your system and notify the sender immediately by replying to this email.  
If you are not the intended recipient you are notified that disclosing, 
copying, distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range 
of services to hedge funds, funds of funds and private equity funds.  Any tax 
advice in this communication is not intended to be used, and cannot be used, by 
a client or any other person or entity for the purpose of (a) avoiding 
penalties that may be imposed on any taxpayer or (b) promoting, marketing, or 
recommending to another party any matter addressed herein.
**
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
**

web connection process

2016-11-09 Thread Bill Weale
Do these processes share a cache of any type? Or must they, individually, build 
their own?

Thanks,

Bill




William W. Weale

Business Owners Support, LLC.

Operations Analysis
MIS Advising
Decision Support Systems

**
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: Correctly identify object clicked in a form method

2016-11-09 Thread Arnaud de Montard

> Le 9 nov. 2016 à 00:43, John DeSoi  a écrit :
> 
> [...]
> Well, it is also bad design to if you have hundreds of boolean fields and you 
> have to add a script to every single one just to determine if a user changed 
> the value. And if I forget to add the object method, now I have a bug. Every 
> object that has data to change should support On Data Change.

As Miyako said, 4D is (was) not designed to managed everything in the method 
form. So we have to deal with a bunch of object methods, even if we feel that 
it's not logical to scatter pieces of code coming from ONE source, the form. 
Since 4D v12 introduced object names as an alternate to variables, my form 
coding is organized with "form manager" methods: each form has its manager. 
Schematically, everything coming from the form (including the form method 
itself) calls the manager. In other words, you still have to use method object, 
but they all do the same thing: call manager with no parameter. 

//form method myForm
myFormManager (Current form name)


//object method booleanField1
//same in all other objets in the form: listbox, fields, buttons, etc.
myFormManager


//project method myFormManager
c_text($1;$entryPoint)
c_text($2;$event)

$entryPoint:=OBJECT Get name  //default=object name of the current method object
$event:=event form  //default=event form of the current method object or form
if(count parameters>0)
 $entryPoint:=$1
 if(count parameters>1)
  $event:=$2
 end if
end if

case of
 :($entryPoint="myForm")
  case of
   :($event=On load)
//...
   :($event=On etc.)
//...
  end case
 :($entryPoint="booleanField@")
  //...
 :($entryPoint="name")
  //...
 :($entryPoint="firstname")
  //...
end case

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