Original post below - this follow up is mostly for the archives.

This references a list box defined in the design environment, with one 
column (defined) as picture, and 3 other columns as text. After an idea 
from Arnaud de Montard regarding defining the typing of the listbox 
columns, I started looking at typing definitions, and what 4D thought 
the picture column was defined as.

I examined the listbox, and indeed the column *IS* defined in the 
design environment as picture.
After inserting an alert to determine what 4D thinks the column is 
(type Text Array), I started trying to figure out how this was 
occurring - how/why does 4D think the listbox column is text, when it 
is defined in the listbox by the properties, as picture?!?

Solution/Problem:
the 4D generated (compiler - generate typing) Compiler_Arrays method.


In this method, 4D had/does defines the list box column as text!
I change the definition from array text -> array picture, compiled and 
everything worked as it should.
I then deleted the Compiler_Arrays method, and re-ran the Compiler 
option 'Generate Typing'. This, again, defined the listbox column as 
text - EVEN THOUGH the column is defined on the form, in design, as 
Picture.

I have done a 'Find in Design' for "array text". There is NO other 
place in the database that the listbox column(s) are defined other then 
on the project form, and in the compiler_arrays method.

So.... I have no idea why 4D thinks the picture column is text, hence 
the Resolved - sort of title.

Hope this helps someone else.
Chip

On Mon, 11 Dec 2017 17:32:27 -0500, Chip Scheide via 4D_Tech wrote:
> I have a component which has a form with an array listbox,
> the listbox is defined in the design environment and has 4 columns.
> 1 column (the first) is a picture, the other 3 are text.
> 
> When I execute the form from the component, interpretedly everything is 
> fine.
> When I execute the form from a host, interpretedly, everything is fine.
> When I execute the form from a host (or from the component), compiled, 
> I get runtime error:
>    Argument types are incompatible
> 
> 
> The line of code that is failing is : 
> APPEND TO ARRAY(aptr_Column_Vars{l_Pic_Column}->;$Pic_Pointer->)
> 
> -  aptr_Column_Vars - array of pointers to the listbox columns -- 
> populated by 'get listbox arrays'
> -  l_Pic_Column - is a (component) process variable which holds the 
> longint value of the column which is a picture column; in this specific 
> instance = 1
> -  $Pic_Pointer - is a pointer to a picture variable, loaded from the 
> picture library, the picture is about 700 bytes.
> 
> In the excution of the code, the current state is:
> - Form with listbox is open.
> - listbox is displayed, but has NO rows.
> - The action occurring when I get the error is a Drag-n-Drop of a file 
> onto the list box. In an attempt to populate the listbox with the 
> file(s)/folder(s) being dropped.
> - The picture column is supposed to hold a small picture to indicate 
> either a file or folder
> 
> 
> So...In the component source I added the following to try to figure out 
> What is going on.
> ALL of the below pass when interpreted.
> 
> Compiled... all pass except the last one
> ASSERT(l_Pic_Column>0;"Invalid Pic index")   //pass - true
> ASSERT(Type($Pic_Pointer)=Is Pointer;"pic pointer not a pointer")  
> //pass - true
> ASSERT(Type($Pic_Pointer->)=Is Picture;"not a pic")  //pass - true
> ASSERT(Picture size($Pic_Pointer->)>0;"size")  //pass - true
> ASSERT(Size of array(aptr_Column_Vars)>0;"pointer Array")  //pass - true
> ASSERT(Type(aptr_Column_Vars{l_Pic_Column})=Is Pointer;"Pic pointer")  
> //pass - true
> 
> This one fails.....but does NOT fail interpretedly.
> ASSERT(Type(aptr_Column_Vars{l_Pic_Column}->)=Picture array;"array el 
> pic")
> 
> 
> If I remove the code for the picture array (commented out) the other 
> columns/arrays are fine and throw no error!
> 
> SO I tried one more thing.
> I inserted the following just before the append to array command.
> ARRAY PICTURE(aptr_Column_Vars{l_Pic_Column}->;0)
> ASSERT(Type(aptr_Column_Vars{l_Pic_Column}->)=Picture array;"array el 
> pic")
> 
> compiled this throws an error on compiler declaration Array Picture....
> again, the same error, incompatible argument types.
> Interpretedly, in the debugger, 
> Type(aptr_Column_Vars{l_Pic_Column}->) =  19
> Picture array (konstant) = 19
> 
> I have no idea what is join on.... any one else have a clue??
> 
> Thanks
> Chip
> 
> 
> ---------------
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
---------------
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:[email protected]
**********************************************************************

Reply via email to