Re: Temp files in 4D package

2018-03-25 Thread Robert Livingston via 4D_Tech


> On Mar 25, 2018, at 3:46 AM, Maurice Inzirillo AJAR 
>  wrote:
> 
> Hi
> 
> This means that you are short of memory. 
> 
> 4D is creating temp files to store some objects which can’t be stored in the 
> cache because it’s too small. 
> 
> So try to extend the cache size. 
> 


Thanks. But shouldn't 4D take care of cleaning out these temp files on its own?
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Temp files in 4D package

2018-03-24 Thread Robert Livingston via 4D_Tech
Mac 10.13.3
4D 15.2

I have a local 4D database. I run it perhaps once every two days. I am running 
the non-compiled version of the database. I am exiting 4D conventionally when 
done with any particular time of use.

When I choose "Show Package" to look at things like the data file and 
Components I can see many temp files. (example below)

These accumulate relatively rapidly. I can erase them all and then within a 
week or two of use of this program, I end up with about 80 of these temp files.

What do these files represent and what does it mean that they keep getting 
created?

Thanks for any help.


…
418E222D5B644C63A042E2B132810CC2.temp
01166C6133B9446C93C5C9CBC3064616.temp
1308D95DF7CC4386A02A0E6D70BCDFCB.temp
1430B7B6F2794A4A9A33C27414CF99C0.temp
1699FC2926224E32BD314D698ABCEF4A.temp
5209C005F0A84A57BBB1B4E76FEF9E07.temp
19179BA34E2F460DA8423F357D06C6B2.temp
24799C4AFFB5457CA1ACCDA16E1D4023.temp
A9D76378B70B4EF5B99E6E78958DB780.temp
A86AF45622124ADB832619C8B3864BC9.temp
B2ED1EE75955429089E34FF6FF260843.temp
BBE9B1F039684A18B655BDBF8629FB8B.temp
C7C50919F91C42EEA0C0924014BCA3D2.temp
C9DF8A44382A454990F9D32CA1AF756B.temp
CF1915B474B5406B95CCB23F3B7F1B62.temp
…
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Resizing Window in Code keeping Background Image centered

2017-07-21 Thread Robert Livingston via 4D_Tech
Thanks for jumping in, Tim.

I am actually using V16 and so I generally use the V16 documentation.

But the link that Keisuke provided me to explain RESIZE FORM WINDOW happened to 
be a link to V15.4 documentation, immediately before CALL FORM arrived on the 
scene. So I was in that link when I then launched a search for CALL FORM which 
came up empty handed, so I was confused. 

Appreciate being put back on the path.



****************
***********

… SET WINDOW RECT is not the command to resize the window,
it is (since v2004) a command to resize the form.

http://doc.4d.com/4Dv15/4D/15.4/RESIZE-FORM-WINDOW.301-3274595.en.html 


but since RESIZE FORM WINDOW does not take the window reference as an argument …




> On Jul 21, 2017, at 10:02 AM, Timothy Penner  wrote:
> 
>> CALL FORM is capitalized so as to suggest to me that it is a command in 4D.
>> But I can find no such command.
> 
> CALL FORM is a v16 command (first created in v15R5):
> http://livedoc.4d.com/4Dv16/help/Command/en/page1391.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: Resizing Window in Code keeping Background Image centered

2017-07-20 Thread Robert Livingston via 4D_Tech
CALL FORM is capitalized so as to suggest to me that it is a command in 4D.

But I can find no such command.

?


> On Jul 20, 2017, at 5:26 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> you would need to use CALL FORM in order to apply it to the splash window.

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

Resizing Window in Code keeping Background Image centered

2017-07-20 Thread Robert Livingston via 4D_Tech
On Mac. 4D v16

There is an image that can be associated with menu bars and initially it 
displays in the center of the window. (This image is called the background 
image in the 4D Tool Box)

If you resize the window by dragging on the sides or corner, that image keeps 
itself centered.

But if I resize the window in code  (SET WINDOW RECT) the window does resize 
itself as requested but the image does not keep itself centered.

The only way that I can get it back in the center is to change the Menu Bar and 
then return to the original Menu Bar and the picture will be recentered.


Is it not intended to use SET WINDOW RECT on this window?

Is there some trick to resize this window in code and have the background image 
stay centered?

Thanks in advance.



**
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: Set_Exists() function: Simple version

2017-07-17 Thread Robert Livingston via 4D_Tech
First I have to get some more logical errors out of my code. The below is 
cleaned up.



C_BOOLEAN($0;$setDoesExist)
C_TEXT($1;$setName)
C_BOOLEAN($testInSet)
C_LONGINT($numInSet)

$setName:=$1

$numInSet:=Records in set($setName)

If ($numInSet>0)
$setDoesExist:=True
Else 

  // two possibilities
  // 1. set does not exist
  // 2. set exists but has no records

  // logic: The documentation says: // ADD TO SET ( {aTable ;} set ) … 
ADD TO SET adds the current record of aTable to set. The set must already 
exist; if it does not, an error occurs.
  // if the set does not exist, I will get an error.
  // if it does exist then I will NOT get an error but it is safe 
because I will not have changed the state of anything since adding zero records 
to an existing set does nothing.
fErrorHappened:=False  // this is a process variable that is created at 
startup
ON ERR CALL("ErrorIgnore")  // ErrorIgnore is a method that sets 
fErrorHappened to true
ADD TO SET($setName)  // if the set does not exist, this will throw an 
error. This particular "Set" command is sensitive as to whether the set exists
ON ERR CALL("")

If (fErrorHappened)
$setDoesExist:=False
Else 
$setDoesExist:=True
End if 


End if 

$0:=$setDoesExist


> On Jul 17, 2017, at 1:07 AM, Julio Carneiro via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Just out of curiosity, what happens if there is no current record to add to 
> the set?
> - do you get an error, which might only indicate no record exists to add to 
> an existing set?
> - nothing happens, even if set does not exist?



I am doing the testing in a simple interpreted environment. No server etc.

If there is an empty current selection then the code (interpreted) correctly 
determines whether the set exists or does not exist.

If there is a multi-record current selection but the current record does not 
exist than the code (interpreted) correctly determines whether the set exists 
or does not exist.
**
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: Print Project Form

2017-07-17 Thread Robert Livingston via 4D_Tech

> On Jul 16, 2017, at 3:41 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> the command is called Print form, it can not be more obvious!

Keisuke: Thanks for taking time to reply


In my world, things are often not obvious.

In this case the reason is that the documentation refers to a first parameter 
as being optional {aTable}, but if it is not provided then it uses the Default 
Table.
I could not understand what the Default Table of a Project Form would be.

The fact that this command, Print form,  had this parameter scared me off of it.

Your reply got me burrowing a little deeper in the documentation. The 
discussion of the command

NO DEFAULT TABLE

has, I believe, clarified for me the whole issue of this first parameter in 
form commands. 

I have certainly used the analogous DIALOG command on project forms blithely 
ignoring the {aTable} first parameter without any problem so I can see why one 
might wonder how any such person could trip up when considering  Print form. 

But I managed :)



****************

Print form ( {aTable ;} form {; area1 {; area2}} ) -> Function result   

Parameter  Type  Description
aTable Table --> Table owning the form, or Default 
table, if omitted
form   String--> Form to print
area1  Longint   --> Print marker, or Beginning area 
(if area2 is specified)
area2  Longint   --> Ending area (if area1 specified)
Function resultLongint <--   Height of printed section




Cheers,

RRL

**
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: Set_Exists() function: Simple version

2017-07-17 Thread Robert Livingston via 4D_Tech
In the sample code:



$testInSet:=ADD TO SET($setName) 


should just be



ADD TO SET($setName) 
**
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: Set_Exists() function: Simple version

2017-07-17 Thread Robert Livingston via 4D_Tech

> On Jul 16, 2017, at 9:18 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> So, I'd be grateful if anyone that is Really Into Sets (we all know you're
> out there!) gave it some thought. If it's reliable, great! If not, I'll
> kill it rather than rely on it.

I really should shut up since I have already penned an inaccurate post on this 
subject.

But in the interest of keeping the conversation going, how about using ADD TO 
SET as the command to test whether a set exists?

You can first check to see whether the proposed set has more than zero records. 
If it does, then the set exists.

If Records in set returns zero records then it might be because the set does 
not exist and it might be because the set is valid but has zero records. Now 
apply the ADD TO SET command and see if it throws an error.

ADD TO SET is documented to throw an error if the set does not exist.

If it does exist, then adding zero records to some set should not cause any 
harm.

WARNING: I would not actually rely on the code below without, as David has 
said, having people who are "Really Into Sets" make a contribution. It has been 
previously demonstrated that I am not "Really Into Sets"  :)





****************
******

  // PROJECT METHOD: rfSetExist  PATH: rfSetExist
  // PARAMETERS
  // $1 = Set name being tested
  // 
  // RETURNED VALUE(s)
  //$0 Type: Boolean
  //    
  // DESCRIPTION: Tells you whether a set exists. If True then the set exists


C_BOOLEAN($0;$setDoesExist)
C_TEXT($1;$setName)
C_BOOLEAN($testInSet)
C_LONGINT($numInSet)

$setName:=$1

$numInSet:=Records in set($setName) // Documentation: Records in set returns 
the number of records in set. If set does not exist, or if there are no records 
in set, the command returns 0.

If ($numInSet>0)

$setDoesExist:=True

Else 

  // two possibilities
  // 1. set does not exist
  // 2. set exists but has no records

  // logic: The documentation says: // ADD TO SET ( {aTable ;} set ) … 
ADD TO SET adds the current record of aTable to set. The set must already 
exist; if it does not, an error occurs.
  // if the set does not exist, I will get an error.
  // if it does exist then I will NOT get an error but it is safe 
because I will not have changed the state of anything since adding zero records 
to an existing set does nothing.

fErrorHappened:=False  // this is a process variable that is created at 
startup
ON ERR CALL("ErrorIgnore")  // ErrorIgnore is a method that sets 
fErrorHappened to true
$testInSet:=ADD TO SET($setName)  // if the set does not exist, this 
will throw an error. This particular "Set" command is sensitive as to whether 
the set exists
ON ERR CALL("")

If (fErrorHappened)
$setDoesExist:=False
Else 
$setDoesExist:=True
End if 

$0:=$setDoesExist

End if
**
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: Set_Exists() function: Simple version

2017-07-17 Thread Robert Livingston via 4D_Tech

> On Jul 16, 2017, at 9:09 PM, Justin Carr via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Are you able to provide a link to where the documentation states this?

I really have to totally retreat here. Talk about faulty memory| When I wrote 
that note, I was "convinced" that I had just read in the documentation that 
  Is In setreturned an error when the set did not exist.

Then I went back to find it in the current documentation. No luck.

I was SO convinced that I had seen this, that I then looked at multiple old 
versions of the documentation thinking that perhaps it was there but I could 
not find it anywhere. 

So I reluctantly conclude that I am simply wrong and retract all of my comments 
on this matter.

SoIs In setat least sometimes does return an error when applied to a 
set that does not exist, but that is not to say it is "reliable" in this which 
was, of course, Davids's original question.



> I would strongly discourage the use of an interprocess variable here.

Thanks for your warning here.

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

Print Project Form

2017-07-16 Thread Robert Livingston via 4D_Tech
Is it possible to print a project form?

When I review the "print" functions, they always seem to refer to table forms.

I suppose I can use some table form in some "pseudo table" for what I am trying 
to do, but it would be more straight-forward if I could just print a project 
form


Thanks
**
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: Set_Exists() function: Simple version

2017-07-16 Thread Robert Livingston via 4D_Tech
When David writes I generally find it very clear if it is discussing something 
that is basic enough for me to have  a chance to understand in the first place. 

But I found this  message a little confusing and yet sets seem to be a fairly 
basic topic.


> On Jul 14, 2017, at 5:10 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I was just consolidating some old code and ran across something that I
> wrote some time back called Set_Exists. No clue. It seems to work, but I
> can't say why.

No clue??  I cannot say why?? I am not sure whether this is a joke that I don't 
get or what.

It would seem to be fairly clear that the basic logic here is to use the 

Is in set()Command to test for whether a set exists. The documentation says 
that if a set does not exist, then this will throw an error. So the code is 
taking advantage of this

(Interesting, as a sidelight, the command:Records in Set() does NOT throw 
an error if the set does not exist. Rather it just returns 0. Unfortunately, 
use of this command does not allow you to distinguish whether the set exists 
and is empty or whether the set does not exist at all. If it returns a number 
greater than 0 then you know the set exists, but that is not quite enough)

So David is using: Is in setto throw an error when the set does not 
exist.

Then he asks us to confirm if the code is reliable. But there are three methods 
included in the code

ErrorHandler_Install
ErrorHandler_SuppressError
ErrorHandler_InstallPrevious

that we are not given. How am I supposed to test it?


Now I assume that from the names of these methods that basically that if an 
error occurs that 

ErrorHandler_SuppressError is called and that this method turns the process 
variable Error to a number other than zero and that is how you figure out 
whether the error was thrown and thus whether 

Is in set()threw an error.

I cannot see how this would not be reliable  if I am interpreting David's code 
correctly



****************
**

For those who might have been confused in the fashion that I was, I would offer 
this version of what I think David's code is that I think is clearer. You might 
disagree:
The method "ErrorIgnore" sets a inter-process variable (<>fErrorHappened) to 
True


  // PROJECT METHOD: rfSetExist  PATH: rfSetExist
  // PARAMETERS
  // $1 = Set name being tested
  // 
  // RETURNED VALUE(s)
  //$0 Type: Boolean
  //    
  // DESCRIPTION: Tells you whether a set exists. If it returns True then the 
set exists.  ( rf is a personal naming convention for "returns flag")


C_BOOLEAN($0;$setDoesExist)
C_TEXT($1;$setName)
C_BOOLEAN($testInSet)

$setName:=$1

<>fErrorHappened:=False  // this is a global that is created at startup

ON ERR CALL("ErrorIgnore")  // ErrorIgnore is a method that sets 
<>fErrorHappened to true
$testInSet:=Is in set($setName)  // if the set does not exist, this will throw 
an error. This particular "Set" command is sensitive as to whether the set 
exists
ON ERR CALL("")

If (<>fErrorHappened)
$setDoesExist:=False
Else 
$setDoesExist:=True
End if 

$0:=$setDoesExist


****************
**







> 
> C_BOOLEAN($0;$exists)
> C_TEXT($1;$set_name)
> 
> $set_name:=$1
> 
> Error:=0
> 
> ErrorHandler_Install ("ErrorHandler_SuppressError")
> 
> C_BOOLEAN($is_in_set)
> $is_in_set:=Is in set($set_name)
> 
> ErrorHandler_InstallPrevious
> 
> $exists:=Error=0  // You could test for error 39 to be a bit more specific.
> 
> $0:=$exists
> 
> Here's a little routine I wrote to try it out:
> 
> ALL RECORDS([Cart])
> CREATE SET([Cart];"Cart_All")
> REDUCE SELECTION([Cart];0)
> UNLOAD RECORD([Cart])
> 
> $this_returns_true_correctly:=Set_Exists ("Cart_All")
> 
> $this_returns_false_correctly:=Set_Exists ("Foo")
> 
> Obviously, you would need to use a table name that exists in your structure
> to check this out.
> 
> Can anyone confirm/deny that this code is reliable? Seriously, I have no
> memory of writing this...Not that unusual for me, frankly...I tend to punch
> out reams of code/writing and don't always look back.

**
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: revelation! - Choose

2017-07-07 Thread Robert Livingston via 4D_Tech
Choose — Caution

IMO the documentation is slightly faulty in its example for the “integer” use 
of this command.
The issue is that Choose returns the “null” value for the type being used if 
the integer value is not in the range covered.


From the Documentation

****************
*****
Example 2  

Here is an example of the typical use of this command with a Number type 
criterion:
 vStatus:=Choose([Person]Status;"Single";"Married";"Widowed";"Divorced")
This code is strictly equivalent to:
 Case of
:([Person]Status=0)
   vStatus:="Single"
:([Person]Status=1)
   vStatus:="Married"
:([Person]Status=2)
   vStatus:="Widowed"
:([Person]Status=3)
   vStatus:="Divorced"
 End case
 ****************   
 ***
 
 This is not "strictly" correct. You need to add an Else to the Case statement 
to get complete equivalency
 The null value of the type (in this case "") is returned if the integer value 
is out of range (in this case the range is 0-3)
 
  Case of
:([Person]Status=0)
   vStatus:="Single"
:([Person]Status=1)
   vStatus:="Married"
:([Person]Status=2)
   vStatus:="Widowed"
:([Person]Status=3)
   vStatus:="Divorced"
Else
   vStatus:=""
 End case


So if vStatus had some other value going into the Choose statement, it is going 
to loose that value even if there was no matching criteria.


> On Jul 6, 2017, at 9:45 AM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I found out about a command I had not known about
> Choose
> 
> I love this command
> if anyone does not know about it - read it is so nice to do in  one 
> line of code what other wee takes at least5

**
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: Enterable Variables in Output Form headers

2017-06-18 Thread Robert Livingston via 4D_Tech
KM 

Thanks a lot for your reply. I did a quick look over of the link that you sent 
and will study the material. Much appreciated.




> On Jun 18, 2017, at 3:22 PM, Keisuke Miyako via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> section "Why Use Project Forms?"
> 
> quote:
> 
> Lastly, project forms can be used to create interfaces that comply with OS 
> standards more easily. In particular, calling (via the DIALOG command ) 
> project forms that display the selections of records in subforms is now 
> recommended by 4D for the display of records in list form. With a little 
> additional programming, this combination is an improvement on the MODIFY 
> SELECTION and DISPLAY SELECTION commands.

So this is 4D confirming what Arnaud was telling me. I am glad I have been 
directed to the correct track.

**
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: Enterable Variables in Output Form headers

2017-06-18 Thread Robert Livingston via 4D_Tech

> On Jun 18, 2017, at 7:45 AM, Arnaud de Montard via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> I could never obtain an enterable variable with DISPLAY/MODIFY SELECTION. 
> Since I use selection listbox in a form opened by DIALOG, I can. 

Well, it works for me with MODIFY SELECTION just not DISPLAY SELECTION

> 
> BTW, I think you should consider removing DISPLAY/MODIFY SELECTION, these are 
> old commands that work less and less well. And DIALOG makes possible to 
> remove ADD/MODIFY RECORD too. One command to open any form sounds better to 
> me… 

I do appreciate the advice. But it makes me feel that I am not one of the in 
crowd. I use DISPLAY/MODIFY SELECTION all day long! I have never seen anything 
from 4D that these commends were headed into the sunset. That these were "old 
commands".

 I am so invested in these commands on the current project that I am working on 
that I find it hard to conceive of changing all this. I feel that I am wearing 
a tie-dyed shirt and saddle shoes and just did not know that that was not done 
in 2017.

But your "equivalent" is to have a form with a LISTBOX that fills the available 
space and which has been filled by SELECTION TO ARRAY? And then (if you are 
trying to mimic DISPLAY SELECTION behavior) you double click on a row of that 
listbox and another form pops up which contains the single record? Is that how 
the cool crowd is doing things?

**************

The problem that I was trying to solve was to have an enterable variable in the 
header area of an output form being displayed with DISPLAY SELECTION. But you 
can't enter anything. The purpose of the enterable variable was  to enter text 
that would "filter" the selection when an adjacent button was clicked.

Anyway, my uber-kludge for my current project is to have an invisible button 
over the enterable variable in the header. When the user clicks on it to enter 
data, the invisible button calls up, with Open form window, a Dialog window 
that exactly matches the look of that portion of the header and it is placed in 
that exact location and contains an enterable variable and action button. The 
user can then enter data into the Dialog equivalent of what was on the header. 
When he clicks the adjacent button ( "cloned" in the Dialog window) the Dialog 
window is dismissed and the action carried out. 

There are a few vague UI weirdness that accompanies this but it is not actually 
all that unsettling. I use a Modal Form Dialogue Box which essentially put the 
main window to sleep until the users proceeds with the filtering or cancels it 
all within the Dialog window. The user, after this Dialogue window is called 
up, cannot just forget the whole thing and go off and do something else because 
the main window is dead until the Modal Window is dismissed.

************** 

But I am curious and ask the assembled crowd. Has everyone basically given up 
on using DISPLAY/MODIFY SELECTION? The cool kids have moved 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: Horizontal Sizing Move

2017-06-17 Thread Robert Livingston via 4D_Tech
Thanks for taking time to reply.

In my case, the button is the only item in the header. The output form itself 
was just created in the Wizard. During editing I remove all the button in the 
header except for my cancel button which I place in the upper right of the 
header.

Basically, that button will move to the right if the window is widened but will 
not move much to the left if the window is narrowed. Rather it just disappears 
from view.

I am not sure what the "static objects" are.


> On Jun 17, 2017, at 10:59 AM, Pat Bensky via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I think it depends  on whatever static objects are on the form. If you've
> got an object that is not set to move, that will form the boundary for
> resizing purposes.

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

Horizontal Sizing Move

2017-06-17 Thread Robert Livingston via 4D_Tech
I am confused by an apparent restriction.

Mac os

4D version: 16 R2

When I create a list view (say 1400 pixels wide) and it is resizable then the 
user can grab the right lower corner and resize the window. If they make it 
very narrow then more and more information of the various listed records gets 
hidden. If they make it very wide, the rightmost field expands to take 
advantage of the space made available. This is fine and expected.

My problem is with a button in the header. In the design environment, I set it 
at the upper right of the window. I set its property to Horizontal Sizing: 
Move. 

If I make the window, very wide then the button keeps up traveling to the right 
as I would want.

If I start to make the window narrow, then at first the button behaves as I 
would like. It travels to the left so as to stay in view. But then it "stops" 
and as I make the window narrower, it disappears from view. I am not making the 
window some bizarre extremely narrow thing. There is nothing in the header that 
is "in the way" 

Is there some setting that I do not understand that I have applied to make the 
button refuse to move further to the left? How does 4D decide just where it is 
going to stop letting the button move as the user shrinks the window?
**
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: Macro anyone?

2017-05-31 Thread Robert Livingston via 4D_Tech
The final 100 yards using Bob Finnerty's suggestion - (Hey! Finnerty. Glad to 
see still working with 4D!)



1. Here is the code (non-pseudo) that you place in your project as a Project 
Method: here called SortMethod. Paste this text in and save it.


  // PROJECT METHOD: SortMethod
  // 
  // CREATED: 05/31/17, 17:40:22 Robert Livingston
  // DESCRIPTION: Alphabetically sorts the lines of a method when used in a 
Macro
  // Call SortMethod from the Macro dropdown in the Method Editor

C_TEXT ($inputText)
C_TEXT ($sortedText)

C_LONGINT ($FULL_METHOD_TEXT)
$FULL_METHOD_TEXT:=1
GET MACRO PARAMETER ($FULL_METHOD_TEXT;$inputText)

  // take the input text and turn it into a Text array
ARRAY TEXT ($axLineCode;0)
C_LONGINT ($positionDelimiter)
C_TEXT ($element)

Repeat

  $positionDelimiter:=Position (Char (Carriage return);$inputText)

  If ($positionDelimiter=0)

If ($inputText#"")  // don't gratuitously add a blank line to the array at 
the end
  APPEND TO ARRAY ($axLineCode;$inputText)
End if

  Else

$element:=Substring ($inputText;1; ($positionDelimiter-1))
$inputText:=Substring ($inputText;$positionDelimiter+1)

If ($element#"")  // filter out blank lines
  APPEND TO ARRAY ($axLineCode;$element)
End if

  End if

Until ($positionDelimiter=0)

SORT ARRAY ($axLineCode)

C_LONGINT ($nElement;$totElement)
$totElement:=Size of array ($axLineCode)

If ($totElement>0)

  $sortedText:=$axLineCode{1}

  For ($nElement;2;$totElement)
$sortedText:=$sortedText+Char (Carriage return)+$axLineCode{$nElement}
  End for

Else

  $sortedText:="ALERT("+Char (Double quote)+"Method passed has no content"+Char 
(Double quote)+")"

End if

SET MACRO PARAMETER ($FULL_METHOD_TEXT;$sortedText)



2. Here is the Macro that you have in your Macro v2 folder (you can just add 
these lines to any existing Macros.xml that you may have.




SortMethod




****************
***********

To use: 

– Be in the method that you wish to sort. 

– Call the Macro -- SortMethod -- from the macro dropdown list that is part of 
the method editor.

– Boom, the method is sorted.


****************
***********

It can be a little disconcerting if you accidentally apply this Macro to some 
random method. It will instantly turn into an alphabetized mess. Fortunately, 
the Undo Command will restore its original state.



> On May 30, 2017, at 8:39 AM, Bob Finnerty via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hi Chip,
> 
> Here's the pseudocode:
> 
> Create a 4d method mySortMethod
> GET MACRO PARAMETER highlighted text
> Parse returned text to text array with substring using CR as delimiter
> Sort array
> Rebuild method text from array: For(1;$element;size of array())+CR
> SET MACRO PARAMETER highlighted text
> 
> Then in your macros.xml v2 file:
> 
> name="Sort method lines"
>in_toolbar="true"
>in_menu="true"
>type_ahead="false"
>version="2"
>> 
>mySortMethod
> 
> 
> HTH
> 
> -- 
> Bob Finnerty
> Exodus Software
> **
> 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
> **
> 
> On Tue, May 30, 2017 at 8:04 AM, Chip Scheide via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Anyone have a macro (or anything else)
>> which will sort method editor text?
>> 
>> I have a method which I am using to keep track of other methods I have
>> worked on.
>> I would like to sort this list. Currently I am copy/pasting in excel
>> and sorting and copy/pasting back
> 
> 

**
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: Help with Regex

2017-05-29 Thread Robert Livingston via 4D_Tech
JR's solution works   Some would argue that more specifically alluding to the 
six digits is more robust in case some slightly mis-titled file exists. 

Therefore
^SP_\d\d\d\d\d\d

^SP_INS_\d\d\d\d\d\d


iPhone RRL

> On May 29, 2017, at 11:45 AM, Jeremy Roussak via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Tim,
> 
> “SP_[0-9]*” will match the first lot, and “SP_INS_[0-9]*” will match the rest.
> 
> 
**
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
**