Has anyone been using the V16 menu editor?

2017-02-23 Thread David Adams via 4D_Tech
I just tried it today in a structure built from the ground up in V16. On
Mac. The menu editor is buggy to the point of nearly unusable.

Has anyone been using the V16 version of this tool without trouble? Or,
contrarily, are there already reports in about the problems?

Quick rundown:

* Very hard to attach a menu to a menu bar. Took a couple of minutes to
make it work. I can only get it to work by:

-- Selecting menubar
-- Right-clicking
-- Saying to associate a menu
-- Picking one

That seems to work, if you follow those exact steps each time. After I've
done it once, I can't attach anything else until I go through the whole
sequence again. In earlier versions, you could drag-drop menus into menu
bars if you were very fast.

* Very odd behavior when trying to link a name to a menu item. The first
character that I type seems to disappear, and then the more I type the
weirder it gets. Drag-and-drop from the Explorer no longer seems to work.
The only thing that I've found that does work is to use the pop-up of all
method names (!) to select the method I want.
**
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: Better variable names

2017-02-23 Thread Chip Scheide via 4D_Tech

it is all in the stars David  :)


> 
> Does anyone know, is there an actual 'vote' mechanism, or are you just
> supposed to put down a +1 post?

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

Test code is good

2017-02-23 Thread David Adams via 4D_Tech
I've been making a more concerted effort to write test code as part of new
modules and was doing pretty well. Then I started working on something and
The Fever took hold - I just kept grinding out code. After a couple of
weeks, I realized I could do a really, really big improvement with a
rewrite. (Consolidating a bunch of similar things into one thing.) It's
going to be so much better! Just wait and see, it really will be. But then
I wasn't sure if it was really working right...and I didn't have test
cases. Ouch.

So, I went back to basics. In this case, I've got a multi-process V16 bit
of code that's all about message passing. So it's hard to test. I figured
I'd start with 1) the most basic tests (simple permissions-like tests), 2)
the easy, function-like tests (validating parameter counts, inputs, and
outputs), and then 3) the hard stuff.

#1 went fine, no problems.

#2 the simple functions...my brain said "that stuff is fine, there's
nothing to worry about there." I figured I'd do the right thing and bang
out the test cases anyway. I ran them and got a bunch of bugs. I figured it
was something I'd screwed up in the test cases/code itself. It took me some
time to realize that, no, I'd left an enormous gaping hole in my code that
wasn't visible at first sight. That lead to finding a subtle behavior in
one of my validation routines that could make a bunch of other code behave
unexpectedly. (I had a couple of hundred other tests cases I could run on
that and did find one change I had to make. It was just a change in the
error name you get for a specific sort of bad input, but still...it was a
change.)

So, just a good reminder of how important it is to have test code. I mean,
I just found some meaningful bugs and I haven't even gotten to the hard
part yet (#3.) It's so much easier to test the hard parts/integration when
you've got the basics nailed down. Otherwise, you can end up chasing a bug
all day only to find it was all or in part coming from something silly.

Test code can be hard to write and can have it's own problems. It's also
easy to not develop the tests that break your own code. Still, beats *not*
having test code.
**
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: Better variable names

2017-02-23 Thread David Adams via 4D_Tech
> Having worked in the javascript environment for quite some time now, I
tend to leave out the “_” wherever > I possibly can and use CamelCase
instead.

> so for me

> $subscriber_recipient

> becomes

> $subscriberRecipient.

> Somehow I find the latter easier to read.

You and most people, I believe. I've got it in the back of my mind that
there's been some cog-sci research proving this very point. I tend to go
with the idiom of what I'm in, so my JS names don't look entirely like my
4D names. Also in JS, there seems to be a widespread allergy to parameter
lists while in 4D they're pretty normal.

> ...components

I've heard of those. I'll try again in V16.

And while we're on the subject of names, the 31 character limit is a daily
source of pain for me in 4D. And I end up with crappier names than I would
like all the same. Please vote for this (latest version of a long-standing)
feature request:

http://forums.4d.fr/Post/EN/18946884/1/18946885

Does anyone know, is there an actual 'vote' mechanism, or are you just
supposed to put down a +1 post?
**
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: Better variable names

2017-02-23 Thread Chris Curnow via 4D_Tech
Hi David,

Interesting to see how our variable naming has changed over the years.

Thanks for your excellent post.

I’ll just add one little bit if I may.

Having worked in the javascript environment for quite some time now, I tend to 
leave out the “_” wherever I possibly can and use CamelCase instead.

so for me

$subscriber_recipient

becomes

$subscriberRecipient.

Somehow I find the latter easier to read.

Also I tend to have all my modules in components these days so I have been 
leaving off the module name. But I’ve recently found a flaw in this approach. 
Often I want to bring my component code back into the host database to make it 
easier for testing and development. So bingo when I do, I have naming conflicts 
all over the place. As a result, I’m going back to what I should have done all 
along – add the module name to the variable!!

Best regards
Chris Curnow
4cast.com.au



On 24 Feb. 2017, at 2:29 pm, David Adams via 4D_Tech 
<4d_tech@lists.4d.com> wrote:


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

Better variable names

2017-02-23 Thread David Adams via 4D_Tech
Here's one of those thoughts that I think to repost every few years.

Many of us use variable naming conventions to carry various bits of
information about what's in the variable/array. Like this format:

vtCity
vlWindow

Of course, no one uses that particular format as it's use will later
condemn you to the pits of perdition. Instead, people are probably using:

Module + Descriptor + Type

Like

Customer_City_t

"Module" being a basic language concept missing from the 4D language. It's
helpful to group resources into pseudo-modules to prevent pathological use
of global data. But I digress. What I wanted to say again was something
about type names: It can really improve the meaningfulness of a name if you
expand your concept of 'type'. Instead of limiting ourselves to 4D's
primitives, think of larger types. This can help in a few ways, the first
being readability:

$form_name_t
$tFormName
$form_name

It's a name, of course it's text, what else would it be? Why tack _t on
there? What does it add? It spends a couple of characters without adding
any information. "Name" carries both the base type and it's type in the
larger context of your code. The compiler can sort out types no matter what
their name. 4D's automatic variable being a case in point:

vRecNum

It's text. Of course it is. And it almost squeezes maximum value out of the
8 character name limit ;-)

Similar to form name, method name is an even better example:

$error_method_name_t

Okay, it's an error method. Well, we can validate method names - I'd prefer
to think of it as

$error_MethodName

To the 4D Compiler, it's a string. That's it. But it isn't. Not any string
will do, it has to be a string found in the list of project methods. Your
code makes more sense when you see it that way.

So, when the primitive type is obvious from context, why not use a 'type'
abbreviation that tells you more? Here are three different longints:

log_l
log_l
log_l

Oh. What about

log_docref
log_hlist
log_winref

That's a lot more information for no real cost.

I tend to use abbreviations like these as well as

_name

for internal names of stuff. Names are text in my universe, if you use
longints or something - you're on your own.

Oh, it's helpful to have a currency abbreviation if you apply standard
rounding to reals-that-are-currency.

I was reminded of all of this today as I'm doing some work with objects
where know that the variable is an object tells me close to nothing. I've
got an object that describes a 'recipient' of a callback from CALL WORKER
or CALL FORM. So, it's type is "recipient"

$subscriber_recipient
$callback_recipient

This is an object with a specific collection of attributes with rules.
There's a method to create a recipient, to validate a recipient (make sure
the window/method exists, etc.) Recipients can be passed around for various
purposes.

Right, back to your regular discussions
**
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
**

Windows Authentication on SQL server

2017-02-23 Thread Ronnie Teo via 4D_Tech
Hi All,

I have a client who’s still deploying 4Dv11 for their application.
The application also used a plugin SimpleSQL to facilitate access to an SQL 
server to retrieve some info.

The user’s IT have decided unilaterally to replace the SQL authentication with  
Windows authentication to grant access to their SQL server.
I’m quite a novice when it comes to Windows servers…hence the shout-out for 
some advice.

Does anyone have any idea if we can achieve this whilst on v11?
I know that we can verify a user’s account name and password against the active 
directory using a LDAP plugin.
Is there any way I could combine this with the current SQL script I have to 
handle the change in authentication approach?

Regards,
Ronnie
Tarawerkz

**
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: Structure and Data File do not match

2017-02-23 Thread Keisuke Miyako via 4D_Tech
for investigative purposes, and brute-force correction,
you could peek the structure/data UUID using this tool

https://github.com/miyako/4d-utility-uuid-manager

UUID replaces the old WEDD resource.

> 2017/02/24 0:53、bob.miller--- via 4D_Tech <4d_tech@lists.4d.com> のメール:
> This is in v15r4, and I swear this brings back memories of the old WEDD
> resource, now long gone.  For the life of me I can't figure out what's
> going on.




**
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: Old doesn't work with object fields

2017-02-23 Thread Arnaud de Montard via 4D_Tech

> Le 23 févr. 2017 à 18:17, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> Hi Arnaud,
> 
> You are right, the code does not handle case sensitivity for property names 
> correctly. [...]

now it's perfect to be stolen  ;-)

Many thanks!

-- 
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: v13 - SQL - how to mdofiy existing field?

2017-02-23 Thread Timothy Penner via 4D_Tech
If the field is set as an Alpha field then you could activate the "Auto UUID" 
option with this code:
Begin SQL
ALTER TABLE Table_1 MODIFY uidField ENABLE AUTO_GENERATE;
 End SQL

You could also set that field to the primary key using this code:
Begin SQL
   ALTER TABLE Table_1 ADD PRIMARY KEY( uidField);
End SQL

However I don't think you can change the field type from TEXT to ALPHA via SQL.

Since it sounds like the data was never populated, why not just drop the 
existing field like this:
Begin SQL
   ALTER TABLE Table_1 DROP journal_key;
End SQL

...then re-add it back as described here:
http://kb.4d.com/assetid=76991





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

v13 - SQL - how to mdofiy existing field?

2017-02-23 Thread Chip Scheide via 4D_Tech
I created, in v12 a number a field in a number of tables ' journal_key' 
which was/is to be the UUID field for journaling. It was/has never been 
populated.

When I created the field in v12 I did not want to fight with the UUID 
issues present.
Now, in v13 I am looking to implement this functionality.

I want to change the Field from text to string and make it a primary 
key and UUID and auto assigned.

I found and have used code to add this field for tables where I never 
installed this field, but I do not know enough SQL to be able to modify 
an existing field.

Can anyone help?

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

Re: v13 - SQL alter table to turn on Field Invisible?

2017-02-23 Thread Jeremy French via 4D_Tech
Have you looked at the SET FIELD TITLES command?

You can make visible fields become invisible.

http://doc.4d.com/4Dv13/4D/13.6/SET-FIELD-TITLES.301-2502294.en.html


> On Feb 23, 2017, at 1:27 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> turn on the invisible property of an existing field

**
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: v13 - Does 4D SQL support 'Rename'?

2017-02-23 Thread Chip Scheide via 4D_Tech
Thanks for both answers

On Thu, 23 Feb 2017 19:59:51 +, Timothy Penner via 4D_Tech wrote:
> You can use RENAME with ALTER SCHEMA:
> http://doc.4d.com/4Dv15/4D/15/ALTER-SCHEMA.300-2288134.de.html
> 
> But there is no RENAME keyword in the docs for ALTER TABLE:
> http://doc.4d.com/4Dv15/4D/15/ALTER-TABLE.300-2288140.en.html
> 
> -Tim
> 
> 
> 
> **
> 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
**

RE: v13 - Does 4D SQL support 'Rename'?

2017-02-23 Thread Timothy Penner via 4D_Tech
You can use RENAME with ALTER SCHEMA:
http://doc.4d.com/4Dv15/4D/15/ALTER-SCHEMA.300-2288134.de.html

But there is no RENAME keyword in the docs for ALTER TABLE:
http://doc.4d.com/4Dv15/4D/15/ALTER-TABLE.300-2288140.en.html

-Tim



**
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: v13 - SQL alter table to turn on Field Invisible?

2017-02-23 Thread Timothy Penner via 4D_Tech
I don’t think visibility can be set at all via SQL, for new or existing fields:
http://doc.4d.com/4Dv15/4D/15/CREATE-TABLE.300-2288142.en.html
http://doc.4d.com/4Dv15/4D/15/ALTER-TABLE.300-2288140.en.html
http://doc.4d.com/4Dv15/4D/15/System-Tables.300-2288116.en.html

-Tim



**
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: Install 4D v15 for Windows client mode usage

2017-02-23 Thread Charles Miller via 4D_Tech
How about on windows zip the entire folder and on mac zip the application.
The write a script to unzip and put in the correct place

Regards
Chuck

On Wed, Feb 22, 2017 at 4:16 PM, Justin Leavens via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have a customer site with a mix of Windows machines and I need to get the
> 4D v15.4 app for use in client mode on to each machine. This is not a
> merged
> server/client. What's the best way to get the 4D app installed on each
> machine?
>
> The 32-bit installer seems to want to install all of 4D (Server, Runtime,
> etc) which isn't needed. I just need the 4D app itself. I've tried in the
> past to just copy the app to the machine, but run into weird problems like
> I
> think I couldn't use 4DLink documents.
>
> Thanks for any tips on this.
>
>
>
> --
> View this message in context: http://4d.1045681.n5.nabble.
> com/Install-4D-v15-for-Windows-client-mode-usage-tp5750433.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
> **




-- 
-
 Chuck Miller Voice: (617) 739-0306 Fax: (617) 232-1064
 Informed Solutions, Inc.
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D, Sybase & SQL Sever connectivity
  http://www.informed-solutions.com
-
This message and any attached documents contain information which may be
confidential, subject to privilege or exempt from disclosure under
applicable law.  These materials are intended only for the use of the
intended recipient. If you are not the intended recipient of this
transmission, you are hereby notified that any distribution, disclosure,
printing, copying, storage, modification or the taking of any action in
reliance upon this transmission is strictly prohibited.  Delivery of this
message to any person other than the intended recipient shall not
compromise or waive such confidentiality, privilege or exemption
from disclosure as to this communication.
**
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
**

v13 - SQL alter table to turn on Field Invisible?

2017-02-23 Thread Chip Scheide via 4D_Tech
Can I use Alter Table to to turn on the invisible property of an 
existing field?
hHanks

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

v13 - Does 4D SQL support 'Rename'?

2017-02-23 Thread Chip Scheide via 4D_Tech
something like this :
$sql:="Alter table ["+x_table_name+"] RENAME "+x_Field_Name+" to 
"+x_New_Field
Begin SQL
EXECUTE IMMEDIATE : $SQL
End SQL
---
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
**

Re: Old doesn't work with object fields

2017-02-23 Thread Cannon Smith via 4D_Tech
Hi Arnaud,

> On Feb 22, 2017, at 2:25 PM, Arnaud de Montard via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
>> : ($atFirstProperty{$x}#$atSecondProperty{$x})  //Check property name
> 
> About the comparison above, json properties are case sensitive. 
> Things like:
>  :(Position(atFirstProperty{$x};$atSecondProperty{$x};*)=1)

Thanks! You are right, the code does not handle case sensitivity for property 
names correctly. Below is the corrected code for anyone that wants to replace 
the OBJ_IsEqual code directly. (I’ll post updated versions of the OBJ module a 
little later today.)

Nice catch!

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




  //Compares two objects. If they are the same (ie. they have exactly the same 
elements and values),
  //the method returns true. Thanks to Vincent de Lachaux for the original code 
which has been changed
  //slightly to more closely match my style.

C_OBJECT($1;$oFirst)
C_OBJECT($2;$oSecond)
C_BOOLEAN($0;$fIsEqual)

$oFirst:=$1
$oSecond:=$2
$fIsEqual:=False  //Defaul to false

C_LONGINT($x;$y;$lFirstItemCount;$lSecondItemCount;$lFirstPropertyCount;$lSecondPropertyCount)
ARRAY LONGINT($alFirstType;0)
ARRAY TEXT($atFirstProperty;0)
ARRAY LONGINT($alSecondType;0)
ARRAY TEXT($atSecondProperty;0)

OB GET PROPERTY NAMES($oFirst;$atFirstProperty;$alFirstType)
OB GET PROPERTY NAMES($oSecond;$atSecondProperty;$alSecondType)
$lFirstPropertyCount:=Size of array($atFirstProperty)
$lSecondPropertyCount:=Size of array($atSecondProperty)

If ($lFirstPropertyCount=$lSecondPropertyCount)  //They won't be equal if they 
have different property counts
If ($lFirstPropertyCount>0)
  //Sort arrays because the properties could be in a different 
order
SORT ARRAY($atFirstProperty;$alFirstType)
SORT ARRAY($atSecondProperty;$alSecondType)

  //Now compare each property
For ($x;1;$lFirstPropertyCount)

Case of 
: 
(Length($atFirstProperty{$x})#Length($atSecondProperty{$x}))  //If the property 
names aren't the same length
$fIsEqual:=False

: 
(Position($atFirstProperty{$x};$atSecondProperty{$x};*)#1)  //Check property 
name (case sensitive)
$fIsEqual:=False

: ($alFirstType{$x}#$alSecondType{$x})  //Check 
property type
$fIsEqual:=False

: ($alFirstType{$x}=Is object)
  //compare the two objects
$fIsEqual:=OBJ_IsEqual (\
OB Get($oFirst;$atFirstProperty{$x};Is 
object);\
OB Get($oSecond;$atFirstProperty{$x};Is 
object))

: ($alFirstType{$x}=Object array)
  //In an object array we can massage 
all the array types back into text except object themselves.
  //So we get two sets of arrays, one 
text and the other objects. Then we can deal with either kind
  //as we walk through each element.

ARRAY OBJECT($aoFirst;0)  //Reset arrays
ARRAY TEXT($atFirst;0)
ARRAY OBJECT($aoSecond;0)
ARRAY TEXT($atSecond;0)
OB GET 
ARRAY($oFirst;$atFirstProperty{$x};$aoFirst)  //Get text and object types
OB GET 
ARRAY($oFirst;$atFirstProperty{$x};$atFirst)
OB GET 
ARRAY($oSecond;$atFirstProperty{$x};$aoSecond)
OB GET 
ARRAY($oSecond;$atFirstProperty{$x};$atSecond)

$lFirstItemCount:=Size of 
array($aoFirst)
$lSecondItemCount:=Size of 
array($aoSecond)
If ($lFirstItemCount=$lSecondItemCount)
For ($y;1;$lFirstItemCount;1)
If ((OB Is 
defined($aoFirst{$y})) & (OB Is defined($aoSecond{$y})))  //If they are both 
objects

$fIsEqual:=OBJ_IsEqual ($aoFirst{$y};$aoSecond{$y})
Else   //Compare text
   

Re: Structure and Data File do not match

2017-02-23 Thread Peter Bozek via 4D_Tech
On Thu, Feb 23, 2017 at 4:53 PM, bob.miller--- via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I'm not aware of what ties a structure file to a data file and I've never
> seen this before.
>

Id happened to me about a month ago - searching 4D nug found responses that
helped. I believe it was necessary to run structure repair in MSC and this
fixed the problem.

-- 

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

Structure and Data File do not match

2017-02-23 Thread bob.miller--- via 4D_Tech
Hi Everyone,

During a recent upgrade where I created a compiled/merged app with 4D 
Server, when I deploy the new compiled/merged app I get this message:

The structure and data fiels to not correspond to each other.  The data 
file cannot be opened with the structure.

This is in v15r4, and I swear this brings back memories of the old WEDD 
resource, now long gone.  For the life of me I can't figure out what's 
going on.

> The 4D Developer I'm using is the same exact version and release as the 
4D Server I'm merging with
> I've done this hundreds of times to deploy to "Server A" and a few times 
already to a new "Server B" - this is happening on "Server B"
> The data file was created using the compiled/merged app when it was 
first deployed on "Server B"
> If I copy the data file from "Server B" to my developer machine, I get 
the same error.

I'm not aware of what ties a structure file to a data file and I've never 
seen this before.

Any ideas?

many thanks!!


Bob Miller
Chomerics, a division of Parker Hannifin Corporation




**
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: Old doesn't work with object fields....or rather Objects in General

2017-02-23 Thread Nigel Greenlee via 4D_Tech
David

This slightly changes the topic of the OLD on Object fields to a more detailed 
discussion of the ‘shortcomings' of objects….

(On the topic of the former in my case if I am creating an object in code its 
likely to be created with the same key order each time so if the ’stringified' 
version old is not =current then its changed-and even if it was not in the same 
order it has changed so it is modified). 

Dealing with the Form Meta data..I would really like it if 4D implemented the 
object and form meta data concept because you could extract easily the entire 
representation of a form which is what I currently do with some really 
interesting code-and i know  a number of others have done similar-maybe those 
of us who are interested in such could pool our code and end up with a common 
concept of the structure of the Meta object (Object keys named in a common way, 
common thinking of how to represent form elements etc)-waiting for 4D could be 
a while-probably there is stuff other people are doing that is better than mine.

I will throw some stuff here..if you or others  want to work this up feel free 
to come back to me:

There are a couple of Form Propeties and Object properties you cant(I think) 
get. This was a note i made in my code

 //the following form settings cannot be obtained in code(V14)
  //Markers
  //access
  //menu bar
  //print settings
  //appearance
  //form type
  //inherited form table
  //inherited form name
  //save geometry

and there is an interesting problem that occurs if you have an inherited 
form(took me a while to work out what the hell was going on)…if an inherited 
form has an object named ‘variable1’ and the form itself also has ‘variable1’ 
When you parse the form you get the objects of the form and the objects of the 
inherited form. When you get the variable associated with ‘variable1’ you might 
get the one from the form or the one from the inherited form..and it seems 
random which order you get the objects in-i had to make sure my object names on 
inherited forms where unique.


For your delectation I have put a copy of my version of a  form export (this is 
for a very basic auto made 4D form-i have some really complex forms-and the 
code building this may not be perfect) on my dropbox-

https://www.dropbox.com/s/sr3xfqrxfqton1p/FORM_PO_Purchase_Order_Item_Input.txt?dl=0
 

 

(Its easier as a human to read this if you replace the , with cr)

I build an object with the data put the object in a blob and create a document 
for safe keeping. In Previous attempts at this I used XML and boy did that get 
ugly!  I have code that reads this format back in and is able to compare the 
current version of a form with a saved version of the form-I do not have fancy 
code that reads this and creates or fixes a form or anything, it just tells me 
what has physically changed.

I would propose:
1) A common way for creating a form(and its objects) in an object.
2) A common way for comparing two complex objects where the ‘structure’ of the 
objects is known producing a either a human readable(string) of changes or an 
object representing the changes. e.g a way of comparing two representations of 
a form.

Let know if you or others are interested.

Nigel Greenlee


> On 23 Feb 2017, at 00:12, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
>> Seems really inefficient, but it work
> 
> 4D has taken pains to say that object fields *are not JSON*. They can be
> represented as JSON, but they aren't stored or accessed as JSON internally.
> So, it does seem like a good bug report/feature request to make Old work
> correctly on object fields. In fact, it's probably one of the more
> important field types that it could work on it. Having to serialize it and
> run an expensive comparison ourselves feels a bit over the top.
> 
> If you put in a feature request/bug report, shoot a note over here so that
> any of us that care can go and vote for your idea.
> 
> Speaking of objects and feature requests, Cannon "Object Module" Smith made
> a fantastic feature request the other day:
> 
> http://forums.4d.fr/Post/EN/19051683/1/19051684
> 
> The idea is to have an automatic, internal C_OBJECT-type structure (a
> dictionary) maintained by 4D for each widget on a form. If they did this,
> you wouldn't see anything different on the form, but if you wanted to
> associated custom attributes or data with the widget (rules, bindings,
> hints, extra lookup data, filters, formats, privileges, etc.), you would
> know right where to get/set the data. It may sound like a small thing, but
> it would be a *huge* win. Just massive. You can do something on this order
> now with a custom C_OBJECT in a form or process, but the init/cleanup cycle
> is kind of 'heavy'. Also, that makes the price of admission high enough
> that most people won't do it. Many will never even have the chance to
> understand why this is s

RE: Why doesn't 4D generate a crash log or report?

2017-02-23 Thread Epperlein, Lutz (agendo) via 4D_Tech
Two remarks to the Windows crash dump:

- If the app is running in a by Windows write protected folder the crash dump 
is saved in the so called virtual store, e.g. if the 4D.exe of 4D V15.3 is 
crashed you will find the dump under 
"C:\Users\\AppData\Local\VirtualStore\Program Files (x86)\4D\4D 
v15.3\4D\4D.exe.dmp"
There was just one from yesterday :-(

- Usually the crash dump by Windows doesn't contain sufficient information.

Regards
Lutz Epperlein
**
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
**