Re: Where is this resource file

2019-07-28 Thread JOHN BAUGHMAN via 4D_Tech
Thanks Miyako, but I am still stymied. The picture in the picture button looks 
good (v17R3 32bit).  

So I did…

C_PICTURE($picture)
GET PICTURE RESOURCE(17836;$picture)

Also tried GET RESOURCE("PICT";17836;$picture)

And tried GET ICON RESOURCE(17836;$picture)

$picture comes back empty. So based on what you said there must be more than 
one .rsr file open. How do I find which .rsr files are open? I do not have any 
.rsr files in my Resources folder and I can’t find any .rsr files anywhere on 
my hard disk that looks like it belongs to this database.

BTW the Picture button looks fine in 64bit mode. So maybe I should just ignore 
this warning in the verify log.

John

> 
> On Jul 28, 2019, at 2:42 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> so if there is a PICT resource in both a.RSR and b.RSR,
> GET PICTURE RESOURCE returns a different image depending on which file you 
> opened last.
> 
> if already see the correct image in design mode,
> you can simply call GET P. RESOURCE passing the ID.
> 
> if not, you need to first Open R. file and then use the command.
> 
> once the image is loaded in a picture variable,
> you can use TRANSFORM P. and WRITE P. FILE or CONVERT P.
> to map the white pixel to alpha and convert the format to .PNG.
> 
> if the PICT has a MASK resource, you need to call GET RESOURCE,
> if the image is a cicn (colour icon), you need to call GET ICON RESOURCE.
> 
**
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: v15R5 bug?

2019-07-28 Thread Kirk Brooks via 4D_Tech
Hey Jeremy,
A couple of thoughts:

On Sun, Jul 28, 2019 at 9:20 AM Jeremy Roussak via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I have a collection objects, each of which has a pointer to a variable and
> an associated object:
>
You don't need to use a pointer in the collection. It sounds like what you
want is for that value, in the collection, to be dynamic and to be able to
query on it and find different results as other things have changed. So
what you need to do is design things so that whatever is now a pointer is
itself a reference.

"list" could be any number of things but I bet it could be represented as a
collection. At which point it becomes much easier for you to work with
directly rather than having to dereference what ever that is.


> I want to find the item in the collection from the pointer, which is in
> $ptr
> $boxes:=<>boxes.query(“lb = :1”;$ptr)
>
This might work if $ptr is pointing to a var and you dereference $ptr. But
it's not clear if $ptr is an actual pointer or not.


> Is searching for pointers not allowed?
>
Using ORDA I don't think so.
Using these new data structures, collections, objects, entities and such,
works most effectively when you work with them using references. Within
that context a reference is similar to a pointer but more powerful and
easier to use. Pointers are for working with variables, fields and tables.
It's a different structure from ORDA. You have to rethink how you go about
doing some things. Especially when working with forms and familiar objects
like listboxes. But it's what we have to do. I can tell you from personal
experience over the past year or so the payoff is pretty good. These new
abilities are great.

If you find yourself trying to figure out how to use pointers when you're
doing something with an object, collection or entity you are on the wrong
path. Take a step back and figure out how to accomplish your goals using
references.

You know since Form I rarely use pointers for anything except buttons. Why?
Because it's easier to simply put those objects in the Form object and
reference them.
Input fields: you need to recognize the On data change event but from there
I just work with whatever the value in Form.thisField is.
Listboxes: the only place I've made a listbox with an array is in v15
projects I'm still working on. Otherwise they are either collections or
entity selections. Once more there is nothing I need a pointer to - the
components of them are referenced in Form and easy to work with from there.

Speaking of them, your example suggests to me you are working out a way to
have several different 'boxes' in an array, perhaps with the intent of
making it easy for the user to switch between them? Great idea. I might do
something like:

$lb_obj:=New object("name";"my name";"data"; )

as the object. And instead of an IP var consider using a process variable.
To accommodate multiple windows you use DIALOG(*). You can have many
independent windows in a single method. I'm starting to have a single UI
process where all the windows the user interacts with exist. Coupled with
CALL FORM it's very easy to support this.

Finally, keep in mind that when we create a reference to something we
aren't duplicating it. This is where the similarity to pointers is similar.

$obj:=new object(with a bunch of data)

And then I include this in a collection:

processColl.push($obj)


There is still only 1 instance of $obj. If I then do

$otherColl.push(processColl[0])

$myColl.push(processColl[0])

it's the same thing. There's only one instance of $obj and now 3 references
to it, one in a process variable and 2 in locals (these could be on forms).
So thinking about a form for a moment let's say I put $myColl into
Form.myColl. Now I can reference the values of $obj on my form with

Form.myColl[0].someProperty

which in this example is equivalent to

processColl[0].someProperty

And if the user makes some change on the form those changes are reflected
in all the instances. This is a pretty simple example and you could pretty
easily accomplish the same functionality using pointers. You would need a
lot more code to do it but really I just wanted to try to highlight the
differences in the way you think about the data.



-- 
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: v17R5 bug?

2019-07-28 Thread Keisuke Miyako via 4D_Tech
why not use a key value pair instead of a flat collection of pointers?

> 2019/07/29 2:16、John DeSoi via 4D_Tech <4d_tech@lists.4d.com>のメール:
> Disappointing because you can search for pointers in a pointer array, but not 
> in a collection. And the above gives -1 implying that the search was 
> completed rather than an error to indicate it is not supported.




**
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: Where is this resource file

2019-07-28 Thread Keisuke Miyako via 4D_Tech
before v11, the .RSR file adjacent to the structure file that shares the same 
name was automatically opened.
starting from v11, the recommendation is to move any .RSR files to the 
Resources folder,
and explicitly open it with Open resource file.

https://doc.4d.com/4Dv17/4D/17.2/Resources.201-4385996.en.html
https://doc.4d.com/4Dv17/4D/17.2/Managing-the-Resources-folder.300-4416935.en.html
https://doc.4d.com/4Dv17/4D/17.2/Description-of-4D-files.300-4403133.en.html

.RSR files are stacked.

so if there is a PICT resource in both a.RSR and b.RSR,
GET PICTURE RESOURCE returns a different image depending on which file you 
opened last.

if already see the correct image in design mode,
you can simply call GET P. RESOURCE passing the ID.

if not, you need to first Open R. file and then use the command.

once the image is loaded in a picture variable,
you can use TRANSFORM P. and WRITE P. FILE or CONVERT P.
to map the white pixel to alpha and convert the format to .PNG.

if the PICT has a MASK resource, you need to call GET RESOURCE,
if the image is a cicn (colour icon), you need to call GET ICON RESOURCE.

> 2019/07/28 17:37、JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com>のメール:
>
> I have a picture button that is using a Resource  File with an ID number. I 
> need to convert it to a png but do not have a clue where it is. I think it 
> should be in the Resource folder. Once I find it, I think I should move it 
> there??




**
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: Resize Window and Move Code

2019-07-28 Thread Keisuke Miyako via 4D_Tech
sounds like you just need to use both

W. SET RECT

and

RESIZE F. WINDOW

> 2019/07/29 7:56、John J Foster via 4D_Tech <4d_tech@lists.4d.com>のメール:
> Doe anyone have an code they’d be willing to share for managing
> both the resize and moving of a window to the exact location and width and 
> height of the form?




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

Resize Window and Move Code

2019-07-28 Thread John J Foster via 4D_Tech
Hi All,

4D v17R5 (Mac and Win)

I’ve been wrestling with this for a while and have had mixed and ugly results 
(I know I had this code in an earlier app and can’t find it!)

I have a popup menu on an open form. This popup allows the user to select a 
screen size for the window.

But I’d like the option of moving the window, after it’s resized, to left/top 
of the screen below the toolbar.

But we don’t have a Move window command. What works perfectly is SET WINDOW 
RECT but it doesn’t;lt eve the objects on the form. 4D says: "In order to 
modify a form window while taking the resizing properties and the objects it 
contains into account, you must use the RESIZE FORM WINDOW command”.

But the RESIZE FORM WINDOW command only adjust for width and height - 
perfectly! But it doesn’t have a move 

This seems like such a common thing and yet one can spend hours twiddling 
without getting anywhere.

Doe anyone have an code they’d be willing to share for managing both the resize 
and moving of a window to the exact location and width and height of the form?

Appreciate,
John…


**
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: can't load internal 4D component

2019-07-28 Thread David Ringsmuth via 4D_Tech
Jeffrey,

I added the C:\Program Files\4D\ (folder) to the exclusions in the real-time 
scanning for protection.

I added 4D and 4D server to the Allowed Applications.

There is no threat removal history on this box, it is only 16 days old.

I compared the installed contents with my copy on my computer which runs OK. 
Both appear to be the same.

Upon launching 4D Remote I continue to get the same errors.

David Ringsmuth

From: Jeffrey Kain
Sent: Sunday, July 28, 2019 4:22 PM
To: 4D iNug Technical
Cc: David Ringsmuth
Subject: Re: can't load internal 4D component

Just a thought — 

We had similar errors on Mac due to our anti-malware package which actually 
removed contents of the 4D bundle that it thought were unsafe.  Have you 
written exceptions in your antivirus software?

> On Jul 28, 2019, at 12:42 PM, David Ringsmuth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> 4Dv17R4 build 233874
> Windows Server 2019 1809 build 17763.397 (64bit)
> 
> An installed 4Dv17R4 application began not correctly launching this morning 
> on the  error(s).
> 
> 650 (xbox) Folder (name) not found (path) xtoolbox task 1444
> Cannot open the structure of the database development
> Can’t load component development.4DC component ‘4DRT’ task 1444
> 
> This error occurs for every c:\Program Files\4D\Resources\Internal 
> Components\  of which there are six internal components.

**
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: can't load internal 4D component

2019-07-28 Thread David Ringsmuth via 4D_Tech
Jeffery,

Thanks for that suggestion….I’m checking….

The application was running until this morning…

David Ringsmuth

From: Jeffrey Kain
Sent: Sunday, July 28, 2019 4:22 PM
To: 4D iNug Technical
Cc: David Ringsmuth
Subject: Re: can't load internal 4D component

Just a thought — 

We had similar errors on Mac due to our anti-malware package which actually 
removed contents of the 4D bundle that it thought were unsafe.  Have you 
written exceptions in your antivirus software?

> On Jul 28, 2019, at 12:42 PM, David Ringsmuth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> 4Dv17R4 build 233874
> Windows Server 2019 1809 build 17763.397 (64bit)
> 
> An installed 4Dv17R4 application began not correctly launching this morning 
> on the  error(s).
> 
> 650 (xbox) Folder (name) not found (path) xtoolbox task 1444
> Cannot open the structure of the database development
> Can’t load component development.4DC component ‘4DRT’ task 1444
> 
> This error occurs for every c:\Program Files\4D\Resources\Internal 
> Components\  of which there are six internal components.

**
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: can't load internal 4D component

2019-07-28 Thread Jeffrey Kain via 4D_Tech
Just a thought — 

We had similar errors on Mac due to our anti-malware package which actually 
removed contents of the 4D bundle that it thought were unsafe.  Have you 
written exceptions in your antivirus software?

> On Jul 28, 2019, at 12:42 PM, David Ringsmuth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> 4Dv17R4 build 233874
> Windows Server 2019 1809 build 17763.397 (64bit)
> 
> An installed 4Dv17R4 application began not correctly launching this morning 
> on the  error(s).
> 
> 650 (xbox) Folder (name) not found (path) xtoolbox task 1444
> Cannot open the structure of the database development
> Can’t load component development.4DC component ‘4DRT’ task 1444
> 
> This error occurs for every c:\Program Files\4D\Resources\Internal 
> Components\  of which there are six internal components.
**
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: v17R5 bug?

2019-07-28 Thread John DeSoi via 4D_Tech
Changed the subject, I assume you mean 17R5, version 15 does not have dot 
notation.

> On Jul 28, 2019, at 11:20 AM, Jeremy Roussak via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Is searching for pointers not allowed?

I would assume no because 4D can't search collections for a pointer: 

$test:=New collection(->[Table]Field).indexOf(->[Table]Field) `Returns -1

Disappointing because you can search for pointers in a pointer array, but not 
in a collection. And the above gives -1 implying that the search was completed 
rather than an error to indicate it is not supported.

See feature request here:

https://forums.4d.com/Post/EN/30491335/1/30491336#30491336


John DeSoi, Ph.D.
**
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
**

can't load internal 4D component

2019-07-28 Thread David Ringsmuth via 4D_Tech
4Dv17R4 build 233874
Windows Server 2019 1809 build 17763.397 (64bit)

An installed 4Dv17R4 application began not correctly launching this morning on 
the  error(s).

650 (xbox) Folder (name) not found (path) xtoolbox task 1444
Cannot open the structure of the database development
Can’t load component development.4DC component ‘4DRT’ task 1444

This error occurs for every c:\Program Files\4D\Resources\Internal Components\  
of which there are six internal components.

I re-installed the 4Dv17R4 application and the newly installed app has the same 
error.

I’m suspicious of the OS.

4D Server is running on this same machine and it uses four of the same internal 
components. I’m concerned that if I restart 4D Server it will fail also.

Please help!

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

Re: v15R5 bug?

2019-07-28 Thread Jeremy Roussak via 4D_Tech
Typo: the .push line should push “info”; $info, of course.

And I’ve no idea where the > came from - 
it’s not in the message I sent.

Jeremy

> On 28 Jul 2019, at 17:20, Jeremy Roussak  wrote:
> 
> I hope this is a more sensible query than my last one!
> 
> I have a collection objects, each of which has a pointer to a variable and an 
> associated object:
> 
>   <>boxes.push(new object(“lb”; ->list; “box”; $info))
> 
> I want to find the item in the collection from the pointer, which is in $ptr
> 
>   $boxes:=<>boxes.query(“lb = :1”;$ptr)
> 
> When I run this, 4d crashes instantly on the query line. If I put a trace 
> just before that line, I can see that <>boxes contains only one item, which 
> is an object whose lb is the same as $ptr (it’s given in the debugger as 
> “->form_9_1C”). 
> 
> If I code it as
> 
>   for each ($box; <>boxes)
>   if ($box.lb = $ptr)
>   $result:=$box.info 
>   end if
>   end for each
> 
> It works fine.
> 
> Is searching for pointers not allowed?
> 
> Jeremy

**
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: Where is this resource file

2019-07-28 Thread JOHN BAUGHMAN via 4D_Tech
The link talks about automatically inserting the reference as a file path. In 
this case the Source is Resource file and the Name/ID is 17836. If I right 
click the button and select Edit Picture it takes me to the picture library, 
but a picture with a 17836 ID does not exist. Nor does anything that might be 
it appear in the Resource Folder.

Is there a way to convert this picture directly in the button?

John



> On Jul 28, 2019, at 1:52 AM, Jeremy French  > wrote:
> 
> Have you looked at “Automatic referencing of picture files”? 
> 
> https://doc.4d.com/4Dv17R5/4D/17-R5/Using-static-pictures.300-4163735.en.html#4096601
>  
> 
> 
> 
>> On Jul 28, 2019, at 4:37 AM, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com 
>> > wrote:
>> 
>> I think it should be in the Resource folder
> 

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

v15R5 bug?

2019-07-28 Thread Jeremy Roussak via 4D_Tech
I hope this is a more sensible query than my last one!

I have a collection objects, each of which has a pointer to a variable and an 
associated object:

<>boxes.push(new object(“lb”; ->list; “box”; $info))

I want to find the item in the collection from the pointer, which is in $ptr

$boxes:=<>boxes.query(“lb = :1”;$ptr)

When I run this, 4d crashes instantly on the query line. If I put a trace just 
before that line, I can see that <>boxes contains only one item, which is an 
object whose lb is the same as $ptr (it’s given in the debugger as 
“->form_9_1C”). 

If I code it as

for each ($box; <>boxes)
if ($box.lb = $ptr)
$result:=$box.info 
end if
end for each

It works fine.

Is searching for pointers not allowed?

Jeremy
**
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: V17R5 Folder

2019-07-28 Thread Jeremy Roussak via 4D_Tech
Thanks, Arnaud. I must learn to read the documentation a little more carefully!

Jeremy

> On 28 Jul 2019, at 12:04, Arnaud init5 imap via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> 
> 
>> Le 28 juil. 2019 à 12:07, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> 
>> a écrit :
>> 
>> In a component, can Folder(fk resources folder) be used to make a reference 
>> to the host's resources folder, not the component's resources folder? 
> 
> It seems the unavoidable * is here as usual: 
> 
> "If the command is called from a component, pass the optional * parameter to 
> get the path of the host database. Otherwise, if you omit the * parameter, an 
> empty string is always returned."
> 
> -- 
> 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: Where is this resource file

2019-07-28 Thread Jeremy French via 4D_Tech
Have you looked at “Automatic referencing of picture files”? 

https://doc.4d.com/4Dv17R5/4D/17-R5/Using-static-pictures.300-4163735.en.html#4096601
 



> On Jul 28, 2019, at 4:37 AM, JOHN BAUGHMAN via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I think it should be in the Resource folder

**
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: V17R5 Folder

2019-07-28 Thread Arnaud init5 imap via 4D_Tech


> Le 28 juil. 2019 à 12:07, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> a 
> écrit :
> 
> In a component, can Folder(fk resources folder) be used to make a reference 
> to the host's resources folder, not the component's resources folder? 

It seems the unavoidable * is here as usual: 

"If the command is called from a component, pass the optional * parameter to 
get the path of the host database. Otherwise, if you omit the * parameter, an 
empty string is always returned."

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

V17R5 Folder

2019-07-28 Thread Jeremy Roussak via 4D_Tech
In a component, can Folder(fk resources folder) be used to make a reference to 
the host's resources folder, not the component's resources folder? 

The analogy is with Get 4d folder(Current resources folder;*).

There’s an obvious workaround using Folder(Get 4d folder…), but it seems a 
shame to have to mix the two.

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

Where is this resource file

2019-07-28 Thread JOHN BAUGHMAN via 4D_Tech
I have a picture button that is using a Resource  File with an ID number. I 
need to convert it to a png but do not have a clue where it is. I think it 
should be in the Resource folder. Once I find it, I think I should move it 
there??

Thanks,

John

John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.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
**