Re: Macro to check that local variables are declared in a method? [Solved]

2018-04-27 Thread jim.dorrance--- via 4D_Tech
Wow! Useful, thanks.

Sent from my iPhone
> 
**
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: 4DMethod meeting Xojo/4D files updated (John Baughman)

2018-04-27 Thread truegold via 4D_Tech
Hey John,

>  11. 4DMethod meeting Xojo/4D files updated (John Baughman)

Thank you!

That was a cool demonstration of another front end WEB UI with 4D as a backend.

I didn’t know but now I do. I didn’t now that XoJo handles Mac, windows, linux, 
iOS, etc.

If anyone missed may I suggest spending an hour in review and see what John has 
presented. Not to mention the example demo db!

Really good stuff!

Very much appreciate,
John…

**
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: Macro to check that local variables are declared in a method? [Solved]

2018-04-27 Thread Bob Miller via 4D_Tech
Thanks to everyone for all the responses!

I put the macro at the end of this posting.

Cannon Smith inquired:

RE> I don?t have a macro for you, but I?m curious to know why asking the 
compiler to check the syntax isn?t enough?

1. It may not be a syntactical problem; I may have simply forgotten to 
declare the variable.  While I use the 'All Variables are Typed' option, I 
find that 4D doesn't bark very loud if it can discern the typing.

2. The main reason is that I'm changing my coding style (a hard thing to 
do) from putting all my declarations on the first few lines in the method 
to putting them throughout the method, wherever the variable is used, so 
there's more opportunity for missed and double declarations.

3. I used to clear arrays by doing yet another array declaration, such as 
ARRAY TEXT($aText;0), which really isn't a best practice IMHO because way 
back when we had ARRAY STRING it was possible to change a string length in 
one place and not change it in another place - if you want to declare an 
array, then declare it, if you want to resize it, then resize it. Separate 
tools for separate operations.  Hence, I look for "double declarations" 
where I may have declared a variable twice. 

4. I've found that while I'm meticulous about declaring my variables, when 
I flub, it is often because of a mis-spelling. 
C_TEXT($MyVeryLongVariableName) works fine, but later in the thick and 
heat and smoke of a thundering coding session I might use 
$MyVaryLongVariableName:=2 - syntactically this works, the compiler 
probably won't bark, but I have a bug and an easy way to find it is to see 
if I've declared it.

Thanks *VERY* much to Lee Hinde for pointing out that it is a lot easier 
to examine what valid characters IN a local variable vs trying to examine 
characters that might fall AFTER a local variable.

++
Here's the macro, set up to run when the method is saved:


CheckLocalDeclarations("")


+++
Here's the 4D code, CheckLocalDeclarations, that does the check.  Provide 
your own dialog to display vMsgText, vMsgText1, and vMsgText2 - or if you 
are using v16, don't do this, just pass the values as parameters to the 
form.


//Bob Miller04/27/18CheckLocalDeclarations - called by macro to check that 
all local variables are declared.
//Method name is passed by the macro as $1
//This method calls itself in a new process if only one parm is sent (eg. 
when it is called by the macro).

C_TEXT($1;$2;$MethodName;$AllCodeButDeclarations;$LineDeclarationBlock;$ArrayDeclarationBlock;$NewProcessFlag)
C_TEXT($MethodCode;$CR)
C_TEXT($RegEx;$CodeLine)
C_LONGINT($N;$NumLines;$ProcNo;$L;$NumDeclarations;$WhereCommentBegins)
C_POINTER($DummyPtr)
$CR:=Char(Carriage return)//I know I should use a constant, yes...still 
haven't got around to this.

Case of 
: (Count parameters=1)//if called with only a single parm, then this 
method re-opens itself in its own process
//Note below on New Process: I chose to leave the * off so I can run it 
again if I want, a new window is opened
$ProcNo:=New process(Current method name;256*1024;Current method 
name;$1;"NewProcess")
BRING TO FRONT($ProcNo)


: (Count parameters=2)//cool technique I learned from Tim PENNER at 4D
$MethodName:=$1
$NewProcessFlag:=$2//existence of $2 simply means we are in a new process, 
that's all it does

METHOD GET CODE($MethodName;$MethodCode)

ARRAY TEXT($aMethodCodeArr;0)
TextToArrayList (->$MethodCode;->$aMethodCodeArr;"";"";"NoSort")//this 
takes text and puts each line as an array element

$NumLines:=Size of array($aMethodCodeArr)

For ($N;1;$NumLines)//go through all the lines of the method, separate 
into 4 pieces: variable declarations, array declarations, code, and 
comments.
//We don't keep any comments.I don't know why I want to keep variable 
declarations separate from array declarations; it makes me feel better.

$CodeLine:=$aMethodCodeArr{$N}//this is one line of code.We examine it.

$WhereCommentBegins:=Position("//";$CodeLine)//find and remove all 
comments; they may contain local variable references, such as unused code
If ($WhereCommentBegins>=1)
$CodeLine:=Substring($CodeLine;1;$WhereCommentBegins-1)
End if 

$CodeLine:=Replace string($CodeLine;Char(Tab);"")//remove leading TAB's, 
we want what we're looking for to be at position 1
$CodeLine:=DeLBlank ($CodeLine)//remove leading spaces from the code line, 
so we're assured what we are looking for will be at position 1

Case of 
: (Position("C_";$CodeLine)=1)//this is a C_BOOLEAN or C_TEXT or 
C_Something declaration command and now will be at position 1 (no tabs, no 
spaces)
$LineDeclarationBlock:=$LineDeclarationBlock+$CodeLine+$CR//this is all 
the code containing declarations


: (Position("ARRAY ";$CodeLine)=1)//this is an ARRAY BOOLEAN or ARRAY TEXT 
or ARRAY Something command
$ArrayDeclarationBlock:=$ArrayDeclarationBlock+$CodeLine+$CR//this is all 
the code containing array declarations

Else 
// this is not a declaration line
If ($CodeLine#"")//make sure it is 

Re: Collection.orderBy()

2018-04-27 Thread Chip Scheide via 4D_Tech
I   **KNOW**  I am going to hate this when I start using collections 
etc.

B vs b 

ARGH!

:)

On Fri, 27 Apr 2018 21:39:46 +, Julio Carneiro via 4D_Tech wrote:
> 
> The collection member function is ‘orderBy’, capital B. That’s why you get
> a runtime error, because ‘orderby’ does not exist.
---
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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Collection.orderBy()

2018-04-27 Thread Cannon Smith via 4D_Tech
Thanks Jeff and Julio. Funny, I thought I’d double-checked case, but apparently 
not well enough! As soon as I changed it from “orderby” to “orderBy” it started 
working.

BTW, I finally turned on object notation in my database and have started using 
object notation as well as collections directly inside my code. So so nice! 
Easy to read and use and I’m finding I use a lot less local variables as well. 
I can’t wait until they get the AST working so the method editor can do 
checking and better type-ahead as I go!

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Apr 27, 2018, at 3:39 PM, Julio Carneiro via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> If the statement in your code reads exactly as you posted then the error is
> in v16r6 syntax checker :-)
> 
> The collection member function is ‘orderBy’, capital B. That’s why you get
> a runtime error, because ‘orderby’ does not exist.
> 
> At this point 4D does not manage class typing properly, so compiler does
> not know that your object property is a Collection and thus cannot validate
> if ‘orderby’ is a valid member function. Hopefully that will be fixed soon.

**
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: Collection.orderBy()

2018-04-27 Thread Julio Carneiro via 4D_Tech
Cannon,

If the statement in your code reads exactly as you posted then the error is
in v16r6 syntax checker :-)

The collection member function is ‘orderBy’, capital B. That’s why you get
a runtime error, because ‘orderby’ does not exist.

At this point 4D does not manage class typing properly, so compiler does
not know that your object property is a Collection and thus cannot validate
if ‘orderby’ is a valid member function. Hopefully that will be fixed soon.

HTH
Julio

On Fri, Apr 27, 2018 at 6:26 PM Cannon Smith via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Jeff,
>
> Yeah, the ending quote must have been converted by my mail app. It’s a
> proper quote in code.
>
> I _think_ the asc should be inside the double quotes. But I’m just going
> by the examples found at:
>
>
> http://doc.4d.com/4Dv16R6/4D/16-R6/collectionorderBy.301-3690504.en.html.
>
> I don’t really know where else to try putting it???
>
> --
> Cannon.Smith
> Synergy Farm Solutions Inc.
> Hill Spring, AB Canada
> 403-626-3236
> 
> 
>
>
> > On Apr 27, 2018, at 3:20 PM, Jeffrey Kain via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> >
> > Well, you have a curly quote in that line of code - maybe that's just a
> mail artifact?
> >
> > Should the asc be inside the double quotes?
> >
>
> **
> 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
> **
**
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: Collection.orderBy()

2018-04-27 Thread Jeffrey Kain via 4D_Tech
Yep - you're right. I was thinking of the other syntax that uses a constant.

Does the debugger give you any clues if you trace it?


--
Jeffrey Kain
jeffrey.k...@gmail.com




> On Apr 27, 2018, at 5:26 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Yeah, the ending quote must have been converted by my mail app. It’s a proper 
> quote in code.
> 
> I _think_ the asc should be inside the double quotes. But I’m just going by 
> the examples found at:
> 
>   
> http://doc.4d.com/4Dv16R6/4D/16-R6/collectionorderBy.301-3690504.en.html.
> 
> I don’t really know where else to try putting it???

**
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: Collection.orderBy()

2018-04-27 Thread Cannon Smith via 4D_Tech
Hi Jeff,

Yeah, the ending quote must have been converted by my mail app. It’s a proper 
quote in code.

I _think_ the asc should be inside the double quotes. But I’m just going by the 
examples found at:


http://doc.4d.com/4Dv16R6/4D/16-R6/collectionorderBy.301-3690504.en.html.

I don’t really know where else to try putting it???

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Apr 27, 2018, at 3:20 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Well, you have a curly quote in that line of code - maybe that's just a mail 
> artifact?
> 
> Should the asc be inside the double quotes?
> 

**
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: Collection.orderBy()

2018-04-27 Thread Jeffrey Kain via 4D_Tech
Well, you have a curly quote in that line of code - maybe that's just a mail 
artifact?

Should the asc be inside the double quotes?


--
Jeffrey Kain
jeffrey.k...@gmail.com




> On Apr 27, 2018, at 5:10 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Has anyone else gotten orderBy to work on collections in v16r6? Can you see 
> anything obvious I’m doing wrong?

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

Collection.orderBy()

2018-04-27 Thread Cannon Smith via 4D_Tech
I’m having trouble with the collection.orderBy() command working. Not sure if 
it is me or a bug. I’m using 4D v16r6, 64-bit, on macOS with this line of code:

$cSortedFrames:=$oPage.frames.orderby("position.zIndex asc”)

In the method editor everything colors correctly, including “orderBy” which 
turns green and is italicized. $cSortedFrames has been declared as a collection 
and $oPage.frames is also a collection of objects, each one of which has a 
numeric value at “position.zIndex”. The code also passed a syntax check.

But when I actually run the code, I get an error: -10729 Unknown member 
function. It displays the line of code with the “(“ after orderBy shown in red.

Has anyone else gotten orderBy to work on collections in v16r6? Can you see 
anything obvious I’m doing wrong?

Thanks.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




**
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: Picture resources Related Question

2018-04-27 Thread Keith Culotta via 4D_Tech
The Picture Library is still in 17b, but you can only add a new pic to by 
loading it from a volume.  Pics in the library can still be assigned to form 
objects.

Keith - CDI

> On Apr 27, 2018, at 2:42 PM, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Is the Picture library depreciated?
>   
> 
> 
> On Fri, 27 Apr 2018 15:09:43 -0400, Dave Tenen via 4D_Tech wrote:
>> I know this has probably been covered here but I searched and found 
>> no clear answer to this and any direction would be appreciated!.  
>> I am trying to upgrade some older dbs to version 16, that have 
>> picture library entries that are all coming up with the default 
>> images.  How can I retrieve the original Picture library images?  
>> Also related to that…is there anything that will allow me retrieve 
>> old embedded resources (mostly pics and icons) that have the format 
>> 15000;1 etc.?
>> 
>> Thanks for any help in this area!
>> 
>> Dave Tenen
>> 
>> 
>> Personal Chef 
>> 
>> Coming to you from Spec Pond and I swear the fish was
>> []
>> this big
>> 
>> dte...@me.com
>>  

**
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: Picture resources Related Question

2018-04-27 Thread Chip Scheide via 4D_Tech
Is the Picture library depreciated?



On Fri, 27 Apr 2018 15:09:43 -0400, Dave Tenen via 4D_Tech wrote:
> I know this has probably been covered here but I searched and found 
> no clear answer to this and any direction would be appreciated!.  
> I am trying to upgrade some older dbs to version 16, that have 
> picture library entries that are all coming up with the default 
> images.  How can I retrieve the original Picture library images?  
> Also related to that…is there anything that will allow me retrieve 
> old embedded resources (mostly pics and icons) that have the format 
> 15000;1 etc.?
> 
> Thanks for any help in this area!
> 
> Dave Tenen
> 
> 
> Personal Chef 
> 
> Coming to you from Spec Pond and I swear the fish was
> []
> this big
> 
> dte...@me.com
> 
> **
> 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
> **
---
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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Picture resources

2018-04-27 Thread Patrick Emanuel via 4D_Tech
Hi,

you have to open the *32bits* 4D v16 version and to export your picture
library. This is the only one way to get you pictures back. 
Then, one by one replace the call from a file coming from your ressources
folder.
Easy, but take times. Or get help with QS_Toolbox ;-)

Patrick




-
Patrick EMANUEL

Administrator
www.association-qualisoft.eu 
(Soft1002, Simply Asso & QS_Toolbox)
--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
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: Picture resources

2018-04-27 Thread Keith Culotta via 4D_Tech
Take a look at this Tech Tip and its link to Tech Tip 76775: 
http://kb.4d.com/assetid=77713
The code must be run the the older version of 4D, the one compatible with the 
depreciated picture format.

Keith - CDI

> On Apr 27, 2018, at 2:09 PM, Dave Tenen via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I know this has probably been covered here but I searched and found no clear 
> answer to this and any direction would be appreciated!.  
> I am trying to upgrade some older dbs to version 16, that have picture 
> library entries that are all coming up with the default images.  How can I 
> retrieve the original Picture library images?  
> Also related to that…is there anything that will allow me retrieve old 
> embedded resources (mostly pics and icons) that have the format 15000;1 etc.?
> 
> Thanks for any help in this area!
> 
> Dave Tenen
> 
> 
> Personal Chef 
> 
> Coming to you from Spec Pond and I swear the fish was
> []
> this big
> 
> dte...@me.com
> 
> **
> 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
> **

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

Picture resources

2018-04-27 Thread Dave Tenen via 4D_Tech
I know this has probably been covered here but I searched and found no clear 
answer to this and any direction would be appreciated!.  
I am trying to upgrade some older dbs to version 16, that have picture library 
entries that are all coming up with the default images.  How can I retrieve the 
original Picture library images?  
Also related to that…is there anything that will allow me retrieve old embedded 
resources (mostly pics and icons) that have the format 15000;1 etc.?

Thanks for any help in this area!

Dave Tenen


Personal Chef 

Coming to you from Spec Pond and I swear the fish was
[]
this big

dte...@me.com

**
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: SMTP_Attachment (16r4, 5 & 6) and MacOS 10.13 and APFS (encrypted)

2018-04-27 Thread Timothy Penner via 4D_Tech
Hi Stephen,

I think there is a limitation based on the length of the path.

I checked the bug you filed: ACI0097873 (it’s a duplicate of ACI0097739)

On ACI0097739 I see the following comment:
{
MacOS x32 4DIC Plugin uses obsolete FSSpecs file-objects.
The MacOS API rejects the filename if it exceeds 32 chars.
}

Currently ACI0097739 is marked as standard behavior.
You must use 64 bit or make sure the path is less than 32 chars long.
I am not sure if the 32 bit app will be refactored to work with paths longer 
than 32 chars.

-Tim






-Original Message-
From: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] On Behalf Of Stephen Shaw 
via 4D_Tech
Sent: Friday, April 27, 2018 11:33 AM
To: 4d_tech@lists.4d.com
Cc: Stephen Shaw 
Subject: SMTP_Attachment (16r4, 5 & 6) and MacOS 10.13 and APFS (encrypted)

HI

Is anyone successfully using this command with the APFS?
I am getting file not found (error -43)
Test path name = 1 (document)

And the document is present and there are no permission issues that I can see

Many thanks for any help

Steve Shaw
UK
**
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
**
**
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: Macro to check that local variables are declared in a method?

2018-04-27 Thread Tim Nevels via 4D_Tech
On Apr 27, 2018, at 1:03 PM, Jody Bevan wrote:

> I would suggest if you are going to write something this far, why not make it 
> so that it will declare all local variables for you, and remove declarations 
> that are no longer needed. A great time saver. Of course to go that far, 
> there needs to be a strictly enforced naming convention.

That is exactly what I did. My naming convention is to suffix the type to all 
variable names. A text variable name could be “$name_t”, an ARRAY TEXT could be 
“$name_at”, etc.  Then I have a macro that will grab the current method text, 
parse it, build all the compiler directives for me and put them on the 
pasteboard. 

So my method creation workflow is to write the method. Don’t declare any 
variables. When I’m done writing the method and I’m ready to run it for the 
first time to test it, I run the macro and get my C_TEXT, C_LONGINT, ARRAY TEXT 
etc. declarations and I paste that at the top of the method. Done.

If I make changes to the method and use more local variables, I delete the 
local variable compiler declaration block and run the macro again. 

One advantage is you can easily spot any typos in variable names. Just scan the 
declarations and if you see “$ii” you’ll know you made a mistake and go find 
“$ii” and change it to “$i”. You get the idea.

This saves me a lot of time and makes it easy to always compile with all 
variables typed.  

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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

SMTP_Attachment (16r4, 5 & 6) and MacOS 10.13 and APFS (encrypted)

2018-04-27 Thread Stephen Shaw via 4D_Tech
HI

Is anyone successfully using this command with the APFS?
I am getting file not found (error -43)
Test path name = 1 (document)

And the document is present and there are no permission issues that I can see

Many thanks for any help

Steve Shaw
UK
**
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: Macro to check that local variables are declared in a method?

2018-04-27 Thread John DeSoi via 4D_Tech
$localRegex:="\\$[0-9_\\p{Letter}]+"  //Includes parameters. Assumes locals do 
not have spaces.

A simple way to ensure you are not matching within strings is to split the 
method into lines and then on each line collapse the strings so they are empty. 
You only need to do this on lines that have a "$". Here is a method to do this:


//Collapes all string constants in the code to "" prevent contents from 
matching simple regex scanning.

//$0 - Code with strings collapsed.
//$1 - Code.

C_TEXT($0;$1)

C_LONGINT($start;$end;$pos)
C_BOOLEAN($done)

$0:=$1

$end:=1

Repeat 
  $start:=Position("\"";$0;$end;*)
  If ($start>0)
$pos:=$start+1
Repeat 
  $end:=Position("\"";$0;$pos;*)
  Case of 
: ($end<1)  //Unbalanced?
  $end:=Length($0)+1  //Kill all to the end.
  $done:=True
: ($0[[$end-1]]="\\")  //Escaped quote.
  $done:=False
  $pos:=$end+1
Else 
  $done:=True
  End case 
Until ($done)
$0:=Delete string($0;$start+1;$end-$start-1)
$end:=$start+2
  End if 
Until ($start<1)


John DeSoi, Ph.D.


> On Apr 27, 2018, at 10:54 AM, Bob Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> The "tough" issue for me is "how to identify a local variable":
> - it begins with a $
> - it may end with any of these characters: space, equals, semicolon, 
> colon, dash, left paren, left curly brace, end of line, or any arithmetic 
> or comparison operator
> - it is not fully enclosed in quotes; example: "$ ###,###.00" is a format, 
> not a local variable, but I'm ignoring EXECUTE ON SERVER, etc.

**
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: [Tip?] Test path name and Posix

2018-04-27 Thread Stephen Shaw via 4D_Tech
I have found this too!  Error -43
and also giving 'Get localized document path' an absolute path results in an 
empty string which is rather disappointing!

Steve

> On 27 Apr 2018, at 18:29, Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Test Path Name FAILS (file/folder does not exist) if given a POSIX 
> formatted path.
> 
> ---
> 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: https://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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

4DMethod meeting Xojo/4D files updated

2018-04-27 Thread John Baughman via 4D_Tech
HI all,

If anyone downloaded the Xojo/4D demo files from my presentation during the 
4DMethod meeting on Wednesday, please note that a couple of bugs in the Xojo 
project file have been reported to me. The download files have been updated. 
Specifically JASON data exchange had a bug so only XML worked. Also the "Switch 
Web Page" button did not work and that button should have been titled "Go to 
location…"

Also, the 4D database was originally created using 4Dv16R6 so it will not work 
with any version of 4D prior to v16R4. The updated demo files now include a 
v16.2 version of the data file as well.

If anyone has questions for me with regard to this or anything else, please 
feel free to contact me directly.

BTW, if you did not attend the meeting and have any interest is using Xojo with 
4D you can catch the presentation at…

 Xojo4dpresentation 



John


John Baughman
Kailua, Hawaii
(808) 262-0328
john...@hawaii.rr.com





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

[Tip?] Test path name and Posix

2018-04-27 Thread Chip Scheide via 4D_Tech
Test Path Name FAILS (file/folder does not exist) if given a POSIX 
formatted path.

---
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: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Macro to check that local variables are declared in a method?

2018-04-27 Thread Patrick Emanuel via 4D_Tech
Hi,

I haven't a macro but a tool that try to answer to this point (not only).
It works on local ($), variable (without $ or <>) and global (<>) variable.
Manage $ and <> variables is pretty easy, standard variable, more difficult.
So, this code works with method of all objects and cross declaration to
identify variables declared and not used anymore, or used, and not declare.
For that, you can have a look on QS_Toolbox, v2.20ß. You get the source for
free
The final release of this version is planned for the beginning of May.

Hope that is can help you.

Patrick




-
Patrick EMANUEL

Administrator
www.association-qualisoft.eu 
(Soft1002, Simply Asso & QS_Toolbox)
--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html
**
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: Macro to check that local variables are declared in a method?

2018-04-27 Thread Jody Bevan via 4D_Tech
Bob:

Another thought to watch out for.

As you know in some cases 4D names some of it’s own things starting with a ‘$’. 
For example a Process name can be named starting with a ‘$’. If you have 
strictly named local variables those should be easy to filter out.

Jody


> On Apr 27, 2018, at 9:54 AM, Bob Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hello,
> 
> Has anyone created a macro to check a method to make sure all its local 
> variables are declared?
> 
> I've thought about undertaking such a thing, but as it probably involves 
> getting into regular expressions, I've been looking forward to doing this 
> with some dread.
> 
> If anyone has done this already and is willing to share, I'd be much 
> obliged!
> 
> The "tough" issue for me is "how to identify a local variable":
> - it begins with a $
> - it may end with any of these characters: space, equals, semicolon, 
> colon, dash, left paren, left curly brace, end of line, or any arithmetic 
> or comparison operator
> - it is not fully enclosed in quotes; example: "$ ###,###.00" is a format, 
> not a local variable, but I'm ignoring EXECUTE ON SERVER, etc.
> 
> I'm probably making a mountain out of a molehill, but hey, that's what 
> this list is for - to let people show me exactly that.  I appreciate it.
> 
> 
> Bob Miller
> Chomerics, a division of Parker Hannifin Corporation
> 

**
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: Macro to check that local variables are declared in a method?

2018-04-27 Thread Jody Bevan via 4D_Tech
Bob:

I would suggest if you are going to write something this far, why not make it 
so that it will declare all local variables for you, and remove declarations 
that are no longer needed. A great time saver. Of course to go that far, there 
needs to be a strictly enforced naming convention.

Jody


> On Apr 27, 2018, at 9:54 AM, Bob Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Hello,
> 
> Has anyone created a macro to check a method to make sure all its local 
> variables are declared?
> 
> I've thought about undertaking such a thing, but as it probably involves 
> getting into regular expressions, I've been looking forward to doing this 
> with some dread.
> 
> If anyone has done this already and is willing to share, I'd be much 
> obliged!
> 
> The "tough" issue for me is "how to identify a local variable":
> - it begins with a $
> - it may end with any of these characters: space, equals, semicolon, 
> colon, dash, left paren, left curly brace, end of line, or any arithmetic 
> or comparison operator
> - it is not fully enclosed in quotes; example: "$ ###,###.00" is a format, 
> not a local variable, but I'm ignoring EXECUTE ON SERVER, etc.
> 
> I'm probably making a mountain out of a molehill, but hey, that's what 
> this list is for - to let people show me exactly that.  I appreciate it.
> 

**
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: Macro to check that local variables are declared in a method?

2018-04-27 Thread Lee Hinde via 4D_Tech
On Apr 27, 2018, at 8:54 AM, Bob Miller via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> Hello,
> 
> Has anyone created a macro to check a method to make sure all its local 
> variables are declared?
> 
> I've thought about undertaking such a thing, but as it probably involves 
> getting into regular expressions, I've been looking forward to doing this 
> with some dread.
> 
> If anyone has done this already and is willing to share, I'd be much 
> obliged!
> 
> The "tough" issue for me is "how to identify a local variable":
> - it begins with a $
> - it may end with any of these characters: space, equals, semicolon, 
> colon, dash, left paren, left curly brace, end of line, or any arithmetic 
> or comparison operator
> - it is not fully enclosed in quotes; example: "$ ###,###.00" is a format, 
> not a local variable, but I'm ignoring EXECUTE ON SERVER, etc.
> 
> I'm probably making a mountain out of a molehill, but hey, that's what 
> this list is for - to let people show me exactly that.  I appreciate it.
> 
> 
> Bob Miller
> Chomerics, a division of Parker Hannifin Corporation


I just tried this as the search criteria, using BBEdit,  in a method and it 
found all the locals. \$[a-zA-Z0-9]*

I don’t think you have to worry about how the var ends, just look for valid 
characters in the var, which I think are numbers and letters. So, your format 
wouldn’t match because there’s a space and non-valid characters (#)
**
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
**

Macro to check that local variables are declared in a method?

2018-04-27 Thread Bob Miller via 4D_Tech
Hello,

Has anyone created a macro to check a method to make sure all its local 
variables are declared?

I've thought about undertaking such a thing, but as it probably involves 
getting into regular expressions, I've been looking forward to doing this 
with some dread.

If anyone has done this already and is willing to share, I'd be much 
obliged!

The "tough" issue for me is "how to identify a local variable":
- it begins with a $
- it may end with any of these characters: space, equals, semicolon, 
colon, dash, left paren, left curly brace, end of line, or any arithmetic 
or comparison operator
- it is not fully enclosed in quotes; example: "$ ###,###.00" is a format, 
not a local variable, but I'm ignoring EXECUTE ON SERVER, etc.

I'm probably making a mountain out of a molehill, but hey, that's what 
this list is for - to let people show me exactly that.  I appreciate it.


Bob Miller
Chomerics, a division of Parker Hannifin Corporation


ll
"PLEASE NOTE: The preceding information may be confidential or privileged. It 
only should be used or disseminated for the purpose of conducting business with 
Parker. If you are not an intended recipient, please notify the sender by 
replying to this message and then delete the information from your system. 
Thank you for your cooperation."
**
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
**