Re: POINTER TO ARRAY

2017-05-11 Thread Arnaud de Montard via 4D_Tech

> Le 11 mai 2017 à 02:49, Chuck Miller via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> Pointers to locals do work. I pass locals via pointer from method to method 
> all of the time

Yes, but here the thing pointed is one of those variables created "on the fly" 
with Get pointer("aStringUnknownFromCompiler"). IMHO such a variable is 
something close to anything. I seem to remember that Get pointer("$what") is 
displayed as <>what in the debugger, BTW. 

-- 
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: POINTER TO ARRAY

2017-05-11 Thread stardata.info via 4D_Tech

Hi,

Solved using a NON local array.

This " $vPoint-> " is a my transcrition error > c_pointer($vPoint->)

Thanks
/Ferdinando/


Il 11/05/2017 02:01, 4d_tech-requ...@lists.4d.com ha scritto:

Message: 5
Date: Wed, 10 May 2017 16:53:26 -0500
From: Keith Culotta<k...@compdim.com>
To: 4D iNug Technical<4d_tech@lists.4d.com>
Subject: Re: POINTER TO ARRAY
Message-ID:<2aa79c30-b059-45d2-bedd-50dba5fbe...@compdim.com>
Content-Type: text/plain;   charset=us-ascii

Try changing the line "c_pointer($vPoint->)" to "c_pointer($vPoint)", and make sure $X is set to 
"1" or "2".

Keith - CDI


On May 10, 2017, at 4:39 PM, stardata.info via 4D_Tech<4d_tech@lists.4d.com>  
wrote:

Hi All,

I use 4D V13 on windows.
This code in interpreted work, but in compiled application give an error:

c_pointer($vPoint->)

ARRAY STRING(12;$aCodMat_1;0)
ARRAY STRING(12;$aCodMat_2;0)
DISTINCT VALUES([TABLE]Cod;$aCodMat_1)
DISTINCT VALUES([TABLE]Cod_1;$aCodMat_2)


$vPoint:=Get pointer("$aCodMat_"+String($X))
>   error on this command$R:=Size of array($vPoint->)

Someone know because?

Thanks
Ferdinando


**
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: POINTER TO ARRAY

2017-05-10 Thread Keisuke Miyako via 4D_Tech
because local variable do not have a name in compile mode,
Get pointer (which works on names) does not work for local variables.

2017/05/11 6:39、stardata.info via 4D_Tech 
<4d_tech@lists.4d.com> のメール:
Someone know because?


**
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: POINTER TO ARRAY

2017-05-10 Thread Keith Culotta via 4D_Tech
Try changing the line "c_pointer($vPoint->)" to "c_pointer($vPoint)", and make 
sure $X is set to "1" or "2".

Keith - CDI

> On May 10, 2017, at 4:39 PM, stardata.info via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi All,
> 
> I use 4D V13 on windows.
> This code in interpreted work, but in compiled application give an error:
> 
> c_pointer($vPoint->)
> 
> ARRAY STRING(12;$aCodMat_1;0)
> ARRAY STRING(12;$aCodMat_2;0)
> DISTINCT VALUES([TABLE]Cod;$aCodMat_1)
> DISTINCT VALUES([TABLE]Cod_1;$aCodMat_2)
> 
> 
> $vPoint:=Get pointer("$aCodMat_"+String($X))
> >   error on this command$R:=Size of array($vPoint->)
> 
> Someone know because?
> 
> Thanks
> Ferdinando
> **
> 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
**

POINTER TO ARRAY

2017-05-10 Thread stardata.info via 4D_Tech

Hi All,

I use 4D V13 on windows.
This code in interpreted work, but in compiled application give an error:

c_pointer($vPoint->)

ARRAY STRING(12;$aCodMat_1;0)
ARRAY STRING(12;$aCodMat_2;0)
DISTINCT VALUES([TABLE]Cod;$aCodMat_1)
DISTINCT VALUES([TABLE]Cod_1;$aCodMat_2)


$vPoint:=Get pointer("$aCodMat_"+String($X))
>   error on this command$R:=Size of array($vPoint->)

Someone know because?

Thanks
Ferdinando
**
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: pointer and array element issue

2017-01-06 Thread Tim Nevels
On Jan 6, 2017, at 7:18 PM, Chip Scheide wrote:

> However, it might be useful to know how to go about setting to be able 
> to pass a pointer in this manner.
> Any more Ideas?

I would try using a local pointer variable. Maybe something like this:

 If ($New_Size=0)  //clear {0} value
   $temp_p:=$Current_Array->{0}
   utl_text_Convert_From_Text ($temp_p;"")  
 End if

Since it is all pointers it should, in theory, resolve to produce the desired 
result. 

You appear to be pushing the limits of what the compiler’s tokenizer can deal 
with. Or possibly you have uncovered the fact that pointers to individual array 
elements are not yet fully implemented by the compiler. At least it knows it 
can’t handle it and gives you an error message. 

Tim


Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com


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

RE: pointer and array element issue

2017-01-06 Thread Chip Scheide
Thanks
I saw that solution... but since the method
utl_text_Convert_From_Text
does the same/similar thing I was trying not to duplicate functionality.

I know I have used smiler syntax to 
->($Current_Array->{0})
in other places but probably not with an array element


On Fri, 6 Jan 2017 21:01:23 +, Dennis, Neil wrote:
>> However, it might be useful to know how to go about setting to
>> be able to pass a pointer in this manner.
>> ANy more IDeas?
> 
> The only alternative that I'm aware of is to use a case on the type 
> of the pointer to find the array type then copy to a local and pass a 
> pointer to the local array element. It is not practical for your 
> specific needs but will work in the general case... so for academic 
> sake here is one way...
> 
> Case of 
> : (Type($Current_Array->)=Text array)
> ARRAY TEXT($atTemp;0)
> COPY ARRAY($Current_Array->;$atTemp)
> $pParam:=->$atTemp{0}
> // ... other array types here
> End case 
> utl_text_Convert_From_Text (pParam;"")
> 
> What you were thinking earlier (->($Current_Array->{0});"") logically 
> should work, but neither the compiler nor 4D likes this syntax.
> 
> 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
> **
**
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: pointer and array element issue

2017-01-06 Thread Dennis, Neil
>   If ($New_Size=0)  //clear {0} value
>utl_text_Convert_From_Text (->($Current_Array->{0});"")  
>//**Fails here
>   End if

In this particular case you could just  use clear variable, it would be faster 
than a roll your own method to set the correct type.

If($New_Size=0)
  CLEAR VARIABLE($Current_Array->)
End if

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

pointer and array element issue

2017-01-06 Thread Chip Scheide
I have a method which resizes any number of arrays, regardless of type. 
In this method I want to clear the {0} elements of these arrays if the 
new size of the array is Zero [utl_array_Resize_Array]. In this method 
I am calling another method which converts text to an appropriate data 
type [utl_text_Convert_from_Text], for a pointer the method sets the 
pointer to NIL.

utl_array_Resize_Array(NewSize; pointer to array1{;pointer to 
array2...;pointer to arrayN})
utl_text_Convert_from_Text(pointer to Destination;Text)


I am having some trouble trying to get syntax correct in passing a 
pointer to an element of an array which is itself being referenced by a 
pointer.
ex:
$Array_pointer := -> My_Pointer_Array

From utl_array_Resize_Array

for ($i;1;count parameters)
   $Current_Array:=${$i}
   $Type:=Type($Current_Array->)
   
   
   If ($New_Size=0)  //clear {0} value
  utl_text_Convert_From_Text (->($Current_Array->{0});"")  
//**Fails here
   End if
end for
 
** fails with Error 56, Field, var, or table expected at ($Current


Any help in configuring this expression?
so I can pass a pointer to element {0} of an array referenced through a 
pointer?

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