Re: Write Hex Bytes

2019-02-21 Thread Keisuke Miyako via 4D_Tech
> 2019/02/22 9:45、Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com>のメール:
> the task was to process a single value 78,487,500 or 0xCC9FAD04;


correction:

decimal 78,487,500 is 0x04AD9FCC

> If I have a number 78487500, this translates to CC 9F AD 04.


but PC byte ordering will give you CC 9F AD 04 (as Justin correctly pointed out)




**
4D Internet Users Group (4D iNUG)
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: Write Hex Bytes

2019-02-21 Thread Keisuke Miyako via 4D_Tech
you're right,
I re-read the OP,
the task was to process a single value 78,487,500 or 0xCC9FAD04;
not 4 separate decimal values 78, 48, 75 and 00

> 2019/02/22 9:43、Justin Carr via 4D_Tech <4d_tech@lists.4d.com>のメール:
>
> C_BLOB($vX_Data)
> C_LONGINT($vL_Offset)
>
> $vL_Offset:=0
> LONGINT TO BLOB(78487500;$vX_Data;PC byte ordering;$vL_Offset)




**
4D Internet Users Group (4D iNUG)
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: Write Hex Bytes

2019-02-21 Thread Justin Carr via 4D_Tech
On 22 Feb 2019, at 10:30 am, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> it sounds like you are over-thinking :)
> 
> you could just do
> 
> SET BLOB SIZE($bytes;4)
> 
> $bytes{0}:=78
> $bytes{1}:=48
> $bytes{2}:=75
> $bytes{3}:=00
> 
> then BLOB TO DOCUMENT.
> 
> not need to go through hex.

Or even easier:

C_BLOB($vX_Data)
C_LONGINT($vL_Offset)

$vL_Offset:=0
LONGINT TO BLOB(78487500;$vX_Data;PC byte ordering;$vL_Offset)

**
4D Internet Users Group (4D iNUG)
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: Write Hex Bytes

2019-02-21 Thread Keisuke Miyako via 4D_Tech
it sounds like you are over-thinking :)

you could just do

SET BLOB SIZE($bytes;4)

$bytes{0}:=78
$bytes{1}:=48
$bytes{2}:=75
$bytes{3}:=00

then BLOB TO DOCUMENT.

not need to go through hex.

2019/02/22 9:27、Peter Mew via 4D_Tech 
<4d_tech@lists.4d.com>のメール:
If I have a number 78487500, this translates to CC 9F AD 04.



**
4D Internet Users Group (4D iNUG)
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: Write Hex Bytes

2019-02-21 Thread Peter Mew via 4D_Tech
Hi
Actually, I dont think this quite what I want, Unless Im Misunderstanding
whats going on.
If I have a number 78487500, this traslates to CC 9F AD 04.
If I carry out your method, I get 8 bytes added to the initial string.
However,If I read the hex number from a file on disc, it only takes up 4
bytes
So CC is 1 byte, 9F is one byte, and so on
This what I want
To be able to add the Hex string to an existing string, so when I look at
it on disc it only takes up 4 bytes
To see this in action, look at the first 12 Bytes of any wav header
Bytes 1-4 hold the Hex version of the Letters RIFF
the next 4 Bytes hold the Hex version of the total length of the file-8
bytes
Bytes 9-12 hold the Hex Version of the Letters WAVE and so on.
What I want is, knowing the Total Length of the File in Hex, How do I
arrange the string I;m going to write to file, so the Length is comtained
in 4 bytes, Including padding bytes if necessary
Sorry, long winded explanation
thanks
-pm

On Thu, Feb 21, 2019 at 11:22 PM Peter Mew  wrote:

> Hi
> Yes, Thats it almost exactly, I just need to convert to little endian, I
> think I can manage that!
> Thanks
> -pm
>
> On Thu, Feb 21, 2019 at 10:45 PM Arnaud de Montard via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
>
>>
>> > Le 21 févr. 2019 à 22:09, Peter Mew via 4D_Tech <4d_tech@lists.4d.com>
>> a écrit :
>> >
>> > Hi
>> > This is driving me mad, so I hope someone will point me in the right
>> > direction.
>> > I have a string of text.
>> > I can find its length in Hex. now I want to write this length as 4 hex
>> > bytes, into the string, with the aim of doing a text to blob, later on.
>> > If I just add the Hex Number to the string it takes 8 bytes
>> > (String+HexByte0+HexByte1+HexByte2+HexByte3)
>> > If I convert the Hex Numbers to decimal and Do
>> > String+char(DecByte0)+char(DecByte1) etc.
>> > It takes up 4 Bytes but the Numbers written to the string are wrong.
>>
>> Something like that?
>>
>> $hello:="hello world!"
>> $len:=Length($hello)
>> $hex:=String($len;"&x")
>> $hex:=Substring($hex;3)
>> $string:=$hex+$hello+"x"
>> C_BLOB($blb)
>> $charset:="utf-8"
>> CONVERT FROM TEXT($string;$charset;$blb)
>> $string2:=Convert to text($blb;$charset)
>> $offset:=4
>> $hex2:=Substring($string2;1;$offset)
>> $len2:=hexaToDecimal ($hex2)
>> $hello2:=Substring($string2;$offset+1;$len2)
>> ASSERT($len2=$len)
>> ASSERT($hex2=$hex)
>> ASSERT($hello2=$hello)
>>
>> --
>> Arnaud de Montard
>>
>>
>>
>> **
>> 4D Internet Users Group (4D iNUG)
>> 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)
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: Write Hex Bytes

2019-02-21 Thread Peter Mew via 4D_Tech
Hi
Yes, Thats it almost exactly, I just need to convert to little endian, I
think I can manage that!
Thanks
-pm

On Thu, Feb 21, 2019 at 10:45 PM Arnaud de Montard via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> > Le 21 févr. 2019 à 22:09, Peter Mew via 4D_Tech <4d_tech@lists.4d.com>
> a écrit :
> >
> > Hi
> > This is driving me mad, so I hope someone will point me in the right
> > direction.
> > I have a string of text.
> > I can find its length in Hex. now I want to write this length as 4 hex
> > bytes, into the string, with the aim of doing a text to blob, later on.
> > If I just add the Hex Number to the string it takes 8 bytes
> > (String+HexByte0+HexByte1+HexByte2+HexByte3)
> > If I convert the Hex Numbers to decimal and Do
> > String+char(DecByte0)+char(DecByte1) etc.
> > It takes up 4 Bytes but the Numbers written to the string are wrong.
>
> Something like that?
>
> $hello:="hello world!"
> $len:=Length($hello)
> $hex:=String($len;"&x")
> $hex:=Substring($hex;3)
> $string:=$hex+$hello+"x"
> C_BLOB($blb)
> $charset:="utf-8"
> CONVERT FROM TEXT($string;$charset;$blb)
> $string2:=Convert to text($blb;$charset)
> $offset:=4
> $hex2:=Substring($string2;1;$offset)
> $len2:=hexaToDecimal ($hex2)
> $hello2:=Substring($string2;$offset+1;$len2)
> ASSERT($len2=$len)
> ASSERT($hex2=$hex)
> ASSERT($hello2=$hello)
>
> --
> Arnaud de Montard
>
>
>
> **
> 4D Internet Users Group (4D iNUG)
> 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)
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: Write Hex Bytes

2019-02-21 Thread Arnaud de Montard via 4D_Tech

> Le 21 févr. 2019 à 22:09, Peter Mew via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> Hi
> This is driving me mad, so I hope someone will point me in the right
> direction.
> I have a string of text.
> I can find its length in Hex. now I want to write this length as 4 hex
> bytes, into the string, with the aim of doing a text to blob, later on.
> If I just add the Hex Number to the string it takes 8 bytes
> (String+HexByte0+HexByte1+HexByte2+HexByte3)
> If I convert the Hex Numbers to decimal and Do
> String+char(DecByte0)+char(DecByte1) etc.
> It takes up 4 Bytes but the Numbers written to the string are wrong.

Something like that? 

$hello:="hello world!"
$len:=Length($hello)
$hex:=String($len;"&x")
$hex:=Substring($hex;3)
$string:=$hex+$hello+"x"
C_BLOB($blb)
$charset:="utf-8"
CONVERT FROM TEXT($string;$charset;$blb)
$string2:=Convert to text($blb;$charset)
$offset:=4
$hex2:=Substring($string2;1;$offset)
$len2:=hexaToDecimal ($hex2)
$hello2:=Substring($string2;$offset+1;$len2)
ASSERT($len2=$len)
ASSERT($hex2=$hex)
ASSERT($hello2=$hello)

-- 
Arnaud de Montard 



**
4D Internet Users Group (4D iNUG)
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: Object notation bug?

2019-02-21 Thread Kirk Brooks via 4D_Tech
Drew,
On Thu, Feb 21, 2019 at 10:27 AM Drew Waddell via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I am unable to do $oChildObject:=null in my actual situation because I am
> passing that object into a Dialog


You run into this when passing the object to a new form using DIALOG. I use
two approaches when i need to do this:
1) put the form into a subform on the parent form. You can hide it until
needed. Make the subform object an object and you're all set. This way you
avoid needing DIALOG.

2) if you need DIALOG just wrap it in another object. I like to use 'data'.
So you can do this:

$obj:=New object("data";$oChildObject)

DIALOG("myForm";$obj)

It's simple to change the references on the form objects to
Form.data.whatever. I find it more robust not the least of which because it
allows you to have a null object without crashing your form.


-- 
Kirk Brooks
San Francisco, CA
===

What can be said, can be said clearly,
and what you can’t say, you should shut up about

*Wittgenstein and the Computer *
**
4D Internet Users Group (4D iNUG)
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: Write Hex Bytes

2019-02-21 Thread Chip Scheide via 4D_Tech
**IF** I understand what you are trying to do
you are halfway there in both cases, and is fairly easy.

I think what you want is:
String+Hex[[1]]+Hex[[2]]+...+Hex[[n]]

Example:
"This is my string of which I want the length"
(decimal) 44 characters
44 (dec) = 2C (hex)

final value:
"This is my string of which I want the length2C

so...
$Text:=
$Hex_Length_txt:=myutl_Convert_to_Hex(LENGTH($Text))
$Text:=$Text+$Hex_Length_txt

code for converting to hex:
PHP Execute("";"dechex";$Hex_Value;$Decimal_Value)
NOTES:
- this has a max decimal conversion value of +/- MAXLONGINT
- the hex value is returned in $Hex_Value
- "dechex" is the PHP library command
- first empty string is library path ("" = main/basic PHP library)


On Thu, 21 Feb 2019 21:09:51 +, Peter Mew via 4D_Tech wrote:
> Hi
> This is driving me mad, so I hope someone will point me in the right
> direction.
> I have a string of text.
> I can find its length in Hex. now I want to write this length as 4 hex
> bytes, into the string, with the aim of doing a text to blob, later on.
> If I just add the Hex Number to the string it takes 8 bytes
> (String+HexByte0+HexByte1+HexByte2+HexByte3)
> If I convert the Hex Numbers to decimal and Do
> String+char(DecByte0)+char(DecByte1) etc.
> It takes up 4 Bytes but the Numbers written to the string are wrong.
> Please help
> thanks
> -pm
> **
> 4D Internet Users Group (4D iNUG)
> 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)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Write Hex Bytes

2019-02-21 Thread Peter Mew via 4D_Tech
Hi
This is driving me mad, so I hope someone will point me in the right
direction.
I have a string of text.
I can find its length in Hex. now I want to write this length as 4 hex
bytes, into the string, with the aim of doing a text to blob, later on.
If I just add the Hex Number to the string it takes 8 bytes
(String+HexByte0+HexByte1+HexByte2+HexByte3)
If I convert the Hex Numbers to decimal and Do
String+char(DecByte0)+char(DecByte1) etc.
It takes up 4 Bytes but the Numbers written to the string are wrong.
Please help
thanks
-pm
**
4D Internet Users Group (4D iNUG)
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: Object notation bug?

2019-02-21 Thread Drew Waddell via 4D_Tech
Just FYI for those following along,

I tried the following in my test method even though I wouldn't be able to in my 
Form object scenario:

$oChildObject:=Null   // $oParentObject.ChildInformation = 
{FirstName:John,LastName:Smith}

Drew

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Drew Waddell via 
4D_Tech
Sent: Thursday, February 21, 2019 1:28 PM
To: Olivier Deschanels ; 4D iNug Technical 
<4d_tech@lists.4d.com>
Cc: Drew Waddell 
Subject: RE: Object notation bug?

I am unable to do $oChildObject:=null in my actual situation because I am 
passing that object into a Dialog so in my situation $oParentObject is actually 
the Form object, I don't have the local variable for $oChildObject on the form. 
 So is there another command to clear both references without having loop over 
all properties in the child and remove them individually?  

Drew

-Original Message-
From: Olivier Deschanels  
Sent: Thursday, February 21, 2019 1:21 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Drew Waddell 
Subject: Re: Object notation bug?

Hi,

That’s not a bug. That’s normal.

$oChildObject:=New object create a reference to a object store in $oChildObject

 OB SET($oParentObject;"ChildInformation";New object) push another reference 
into the $oParentObject but the old reference still exist because $oChildObject 
isn’t cleared.

you try :  $oParentObject.ChildInformation:=Null
try this  $oChildObject:=null

and read $oParentObject

Regards,

Olivier



Olivier Deschanels
Consultant Expert

4D SAS
66 route de Sartrouville
Parc Les Erables - Batiment 4
78230 Le Pecq
France

Téléphone : +33 1 30 53 92 75
Standard :  +33 1 30 53 92 00
Fax :   +33 1 30 53 92 01
Email : olivier.deschan...@4d.com
Web :   www.4D.com






> Le 21 févr. 2019 à 18:59, Drew Waddell via 4D_Tech <4d_tech@lists.4D.com> a 
> écrit :
>
> I am trying to figure out if this is a bug or not.  This is a watered down 
> version of something I am trying to do:
>
>C_OBJECT($oParentObject;$oChildObject)
>
>$oChildObject:=New object
>$oParentObject:=New object
>$oParentObject.ChildInformation:=$oChildObject
>$oParentObject.ChildInformation.FirstName:="John"
>$oParentObject.ChildInformation.LastName:="Smith"
>
> I want $oChildObject and $oParentObject.ChildInformation to remain the same 
> and should because of how the references work, so at this moment each are 
> {FirstName:John,LastName:Smith}.  Let say something happens like maybe there 
> is a Clear button, how would one clear the child object?
>
> First, I wanted to do this:
>
>$oParentObject.ChildInformation:=Null // $oChildObject = 
> {FirstName:John,LastName:Smith}
>
> Okay, I thought that was the correct way to clear both objects but maybe 
> there is a different way so maybe this?
>
>OB SET($oParentObject;"ChildInformation";New object) // 
> $oChildObject = {FirstName:John,LastName:Smith}
>
> Nope, again the child object with $oParentObject is cleared but $oChildObject 
> remains {FirstName:John,LastName:Smith}.  So do I really have to loop over 
> all properties and remove them individually?
>
>OB REMOVE($oParentObject.ChildInformation;"FirstName")
>OB REMOVE($oParentObject.ChildInformation;"LastName")  // 
> $oChildObject = {}
>
> Finally when I make a change in the $oParentObject.ChildInformation the 
> referenced object $oChildObject is also updated.
>
> Is this a bug?  Shouldn't the :=Null work and also change the $oChildObject 
> variable?
>
> Thanks,
> Drew
>
> **
> 4D Internet Users Group (4D iNUG)
> 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)
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)
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: Object notation bug?

2019-02-21 Thread Drew Waddell via 4D_Tech
I am unable to do $oChildObject:=null in my actual situation because I am 
passing that object into a Dialog so in my situation $oParentObject is actually 
the Form object, I don't have the local variable for $oChildObject on the form. 
 So is there another command to clear both references without having loop over 
all properties in the child and remove them individually?  

Drew

-Original Message-
From: Olivier Deschanels  
Sent: Thursday, February 21, 2019 1:21 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Drew Waddell 
Subject: Re: Object notation bug?

Hi,

That’s not a bug. That’s normal.

$oChildObject:=New object create a reference to a object store in $oChildObject

 OB SET($oParentObject;"ChildInformation";New object) push another reference 
into the $oParentObject but the old reference still exist because $oChildObject 
isn’t cleared.

you try :  $oParentObject.ChildInformation:=Null
try this  $oChildObject:=null

and read $oParentObject

Regards,

Olivier



Olivier Deschanels
Consultant Expert

4D SAS
66 route de Sartrouville
Parc Les Erables - Batiment 4
78230 Le Pecq
France

Téléphone : +33 1 30 53 92 75
Standard :  +33 1 30 53 92 00
Fax :   +33 1 30 53 92 01
Email : olivier.deschan...@4d.com
Web :   www.4D.com






> Le 21 févr. 2019 à 18:59, Drew Waddell via 4D_Tech <4d_tech@lists.4D.com> a 
> écrit :
>
> I am trying to figure out if this is a bug or not.  This is a watered down 
> version of something I am trying to do:
>
>C_OBJECT($oParentObject;$oChildObject)
>
>$oChildObject:=New object
>$oParentObject:=New object
>$oParentObject.ChildInformation:=$oChildObject
>$oParentObject.ChildInformation.FirstName:="John"
>$oParentObject.ChildInformation.LastName:="Smith"
>
> I want $oChildObject and $oParentObject.ChildInformation to remain the same 
> and should because of how the references work, so at this moment each are 
> {FirstName:John,LastName:Smith}.  Let say something happens like maybe there 
> is a Clear button, how would one clear the child object?
>
> First, I wanted to do this:
>
>$oParentObject.ChildInformation:=Null // $oChildObject = 
> {FirstName:John,LastName:Smith}
>
> Okay, I thought that was the correct way to clear both objects but maybe 
> there is a different way so maybe this?
>
>OB SET($oParentObject;"ChildInformation";New object) // 
> $oChildObject = {FirstName:John,LastName:Smith}
>
> Nope, again the child object with $oParentObject is cleared but $oChildObject 
> remains {FirstName:John,LastName:Smith}.  So do I really have to loop over 
> all properties and remove them individually?
>
>OB REMOVE($oParentObject.ChildInformation;"FirstName")
>OB REMOVE($oParentObject.ChildInformation;"LastName")  // 
> $oChildObject = {}
>
> Finally when I make a change in the $oParentObject.ChildInformation the 
> referenced object $oChildObject is also updated.
>
> Is this a bug?  Shouldn't the :=Null work and also change the $oChildObject 
> variable?
>
> Thanks,
> Drew
>
> **
> 4D Internet Users Group (4D iNUG)
> 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)
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: Object notation bug?

2019-02-21 Thread Olivier Deschanels via 4D_Tech
Hi,

That’s not a bug. That’s normal.

$oChildObject:=New object create a reference to a object store in $oChildObject

 OB SET($oParentObject;"ChildInformation";New object) push another reference 
into the $oParentObject but the old reference still exist because $oChildObject 
isn’t cleared.

you try :  $oParentObject.ChildInformation:=Null
try this  $oChildObject:=null

and read $oParentObject

Regards,

Olivier





> Le 21 févr. 2019 à 18:59, Drew Waddell via 4D_Tech <4d_tech@lists.4D.com> a 
> écrit :
>
> I am trying to figure out if this is a bug or not.  This is a watered down 
> version of something I am trying to do:
>
>C_OBJECT($oParentObject;$oChildObject)
>
>$oChildObject:=New object
>$oParentObject:=New object
>$oParentObject.ChildInformation:=$oChildObject
>$oParentObject.ChildInformation.FirstName:="John"
>$oParentObject.ChildInformation.LastName:="Smith"
>
> I want $oChildObject and $oParentObject.ChildInformation to remain the same 
> and should because of how the references work, so at this moment each are 
> {FirstName:John,LastName:Smith}.  Let say something happens like maybe there 
> is a Clear button, how would one clear the child object?
>
> First, I wanted to do this:
>
>$oParentObject.ChildInformation:=Null // $oChildObject = 
> {FirstName:John,LastName:Smith}
>
> Okay, I thought that was the correct way to clear both objects but maybe 
> there is a different way so maybe this?
>
>OB SET($oParentObject;"ChildInformation";New object) // 
> $oChildObject = {FirstName:John,LastName:Smith}
>
> Nope, again the child object with $oParentObject is cleared but $oChildObject 
> remains {FirstName:John,LastName:Smith}.  So do I really have to loop over 
> all properties and remove them individually?
>
>OB REMOVE($oParentObject.ChildInformation;"FirstName")
>OB REMOVE($oParentObject.ChildInformation;"LastName")  // 
> $oChildObject = {}
>
> Finally when I make a change in the $oParentObject.ChildInformation the 
> referenced object $oChildObject is also updated.
>
> Is this a bug?  Shouldn't the :=Null work and also change the $oChildObject 
> variable?
>
> Thanks,
> Drew
>
> **
> 4D Internet Users Group (4D iNUG)
> 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)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Object notation bug?

2019-02-21 Thread Drew Waddell via 4D_Tech
I am trying to figure out if this is a bug or not.  This is a watered down 
version of something I am trying to do:

C_OBJECT($oParentObject;$oChildObject)

$oChildObject:=New object
$oParentObject:=New object
$oParentObject.ChildInformation:=$oChildObject
$oParentObject.ChildInformation.FirstName:="John"
$oParentObject.ChildInformation.LastName:="Smith"

I want $oChildObject and $oParentObject.ChildInformation to remain the same and 
should because of how the references work, so at this moment each are 
{FirstName:John,LastName:Smith}.  Let say something happens like maybe there is 
a Clear button, how would one clear the child object?

First, I wanted to do this:

$oParentObject.ChildInformation:=Null // $oChildObject = 
{FirstName:John,LastName:Smith}

Okay, I thought that was the correct way to clear both objects but maybe there 
is a different way so maybe this?

OB SET($oParentObject;"ChildInformation";New object) // 
$oChildObject = {FirstName:John,LastName:Smith}

Nope, again the child object with $oParentObject is cleared but $oChildObject 
remains {FirstName:John,LastName:Smith}.  So do I really have to loop over all 
properties and remove them individually?

OB REMOVE($oParentObject.ChildInformation;"FirstName")
OB REMOVE($oParentObject.ChildInformation;"LastName")  // 
$oChildObject = {}

Finally when I make a change in the $oParentObject.ChildInformation the 
referenced object $oChildObject is also updated.

Is this a bug?  Shouldn't the :=Null work and also change the $oChildObject 
variable?

Thanks,
Drew

**
4D Internet Users Group (4D iNUG)
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: interesting find

2019-02-21 Thread cjmiller--- via 4D_Tech
Tim the problem is the compiler did not choke on the code and it seemed to 
worked compiled but did not work in source while testing

Regards

Chuck 

Sent from my iPhone

> On Feb 21, 2019, at 10:45 AM, Randy Engle via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I seem to recall that in v1.x of 4D (or v2 when the compiler first showed 
> up), you could practically write in Swahili, and 4D would not complain.  😉
> 
> Every version since then, 4D has become less "forgiving"  (or as Tim Says:  
> "smarter")
> 
> Randy Engle
> 
> -Original Message-
> From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Timothy Penner via 
> 4D_Tech
> Sent: Wednesday, February 20, 2019 4:31 PM
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Cc: Timothy Penner 
> Subject: RE: interesting find
> 
> I have been telling people for years that the compiler gets smarter in each 
> new version. You may have a line of code that you thought was working, but in 
> fact, it shouldn’t have worked at all, and the compiler may not have caught 
> it before, but now it does. This is something I frequently tell people in TS 
> cases dating back multiple versions (I even told people this in v11).
> 
> -Tim
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> 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)
> 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)
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: interesting find

2019-02-21 Thread Randy Engle via 4D_Tech
I seem to recall that in v1.x of 4D (or v2 when the compiler first showed up), 
you could practically write in Swahili, and 4D would not complain.  😉

Every version since then, 4D has become less "forgiving"  (or as Tim Says:  
"smarter")

Randy Engle

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Timothy Penner via 
4D_Tech
Sent: Wednesday, February 20, 2019 4:31 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Timothy Penner 
Subject: RE: interesting find

I have been telling people for years that the compiler gets smarter in each new 
version. You may have a line of code that you thought was working, but in fact, 
it shouldn’t have worked at all, and the compiler may not have caught it 
before, but now it does. This is something I frequently tell people in TS cases 
dating back multiple versions (I even told people this in v11).

-Tim



**
4D Internet Users Group (4D iNUG)
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)
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: Menubar 1

2019-02-21 Thread Chip Scheide via 4D_Tech
do you do:
Set Menubar(1)

at the end of your startup?
Chip

On Wed, 20 Feb 2019 23:35:40 -0600, David Ringsmuth via 4D_Tech wrote:
> 4D v17R4 2323298 64bit Remote
> OSX 10.16+
> 
> At the end of my startup method Menubar 1 is displayed. 
> 
> On some client machines the menu items are not “active”. When 
> selected they do not run the assigned method.
> 
> On other client machines running the same application at the same 
> time, all items on Menubar 1 are active. When selected they run the 
> assigned method.
> 
> Suggestions?
> 
> Thanks!!
> 
> David Ringsmuth
> 
> **
> 4D Internet Users Group (4D iNUG)
> 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)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**