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: Component and 4dd file

2017-05-31 Thread David Adams via 4D_Tech
Andreas,

Thanks for the kind offer. Miyako sorted out my conceptual gap. What I was
not understanding is that you need three files:

Component.4DC
ExternalData.4DB <--- This is what I was neglecting
ExternalData.4DD

In my case, ExternalData.4DB is really just Component.4DB. But they're
serving different roles and you need the physical file. You know all of
this, but I'm writing it down again to fix it in my memory. And for the
sake of the archives.


On Wed, May 31, 2017 at 3:44 PM, Andreas Overmeyer via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> David
>
> Please publish a small example on dropbox
>
> von unterwegs gesendet
>
> > Am 29.05.2017 um 10:56 schrieb 4d_tech-requ...@lists.4d.com:
> >
> > I've got a simple setup with a component that includes a .4DD file. I
> want
> > the component to open up and use the data file. I've gotten this working
> > when everything is interpreted. With a compiled component, I get a stack
> of
> > errors, starting with error -43, fil
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: "This component protected method cannot be edited." - but it's not a component method

2017-05-31 Thread David Adams via 4D_Tech
> Check the “Access” of the method. Also, I’ve found the batch edit option
only works for the Designer log in.

Ding! Thanks Floyd, I think that's it. I'm in with design access, but not
in as Designer. I guess that could be what's making the difference.



On Thu, Jun 1, 2017 at 4:58 AM, Floyd Zink via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> David,
>
>
>
> It’s not a very good error message as in my experience it has nothing to
> do with components.
>
>
>
> Check the “Access” of the method. Also, I’ve found the batch edit option
> only works for the Designer log in.
>
>
>
> Floyd Zink
>
> QMed Corporation
>
>
>
> From: 4D_Tech <4d_tech-boun...@lists.4d.com> on behalf of David Adams via
> 4D_Tech <4d_tech@lists.4d.com>
> Date: Wednesday, May 31, 2017 at 04:39 AM
> Subject: "This component protected method cannot be edited." - but it's
> not a component method
>
>
>
> Weird one. I've got a database and I want to make a batch modification of
>
> an attribute. (I want to set everything invisible and then show the handful
>
> of methods useful in user and the 4D editors.)
>
>
>
> But I'm getting the error "This component protected method cannot be
>
> edited." But I'm not specifically trying to edit a component method. Is it
>
> impossible to use the batch edit mode if you've got a component installed
>
> with unshared methods?
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D web server protected by a proxy server - pdfs don't come through

2017-05-31 Thread Jim Hays via 4D_Tech
Yes.  Most answers say something like replace (pseudo code) target="_blank"
with target="_document", and make it download instead of display in
browser.  It has the same problem though.
I few messages said there was a bug in Chrome some years ago, but this
happens with multiple browsers.

Tomorrow I'm hoping the IT person will turn off the firewall and anti-virus
temporarily and we'll see if that makes a difference.

Thanks,

Jim

On Wed, May 31, 2017 at 6:12 PM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> did you Google for that error message?
>
> 2017/06/01 6:52、Jim Hays via 4D_Tech <4d_tech@lists.4d.com d_t...@lists.4d.com>> のメール:
> "Resource interpreted as Document but transferred with MIME type
> application/pdf"
>
>
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: 4D web server protected by a proxy server - pdfs don't come through

2017-05-31 Thread Keisuke Miyako via 4D_Tech
did you Google for that error message?

2017/06/01 6:52、Jim Hays via 4D_Tech 
<4d_tech@lists.4d.com> のメール:
"Resource interpreted as Document but transferred with MIME type
application/pdf"



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

4D web server protected by a proxy server - pdfs don't come through

2017-05-31 Thread Jim Hays via 4D_Tech
tl;dr

PDFs served by 4D v12 open in a new  browser tab as expected from the same
machine, and also from other machines on the LAN.

When accessed from a machine in the DMZ, not on the LAN, we can navigate
the site, but the PDFs don't come over.

It seems like the OS firewall or WebRoot antivirus tools may be blocking it
on the DMZ machine, but we can't tell.

Any ideas?



details:

We have several 4D v12.6 servers with web servers running and a single
Apache server providing security, since v12 is too old for that.

These are very simple web servers - they provide lists of PDFs, and you
click on the links to open them.  The backend is using Active4D.  The same
basic setup has been used for about 10 years.

Until recently, this has worked well.  Yesterday, the customer said the
PDFs aren't opening for users logged in over the internet.

When we test, if we run a browser inside the LAN and connect directly to
the 4D server, it works fine.

If we run a browser on the proxy machine in the DMZ, we can connect
directly to the LAN 4D web server and use the site, but the PDFs fail to
load.  We get the same behavior connecting over the internet with the
Apache proxy in the middle.

There is an error message in the browser Console panel:
"Resource interpreted as Document but transferred with MIME type
application/pdf"


The link on the web page looks like this:
Account Statement - Axien International S.A.


Occasionally the PDF makes it through.  We've tried changing the target
attribute so it downloads instead, but if the file comes down, it is
corrupted and unreadable.
We get the same behavior with Chrome, Firefox, IE, and Edge.

In all cases, the web site works and behaves normally except for accessing
the PDFs.

It seems there is something about the proxy server machine that is causing
the problem.  Maybe an OS update that silently changed some security
settings, or a tool that is installed on the machine called WebRoot.


Thanks!

Jim Hays
**
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: Thanks and Goodbye

2017-05-31 Thread Tom Dillon via 4D_Tech
Joshua,

If you're still going to be doing 4D,  you should follow the 4D Tech NUG List 
of Happiness (that's what, I'm sure, everyone calls it now) since it's probably 
the best place to get 4D job postings.

Also, unless you're pretty well planted where you currently are, pick a place 
you'd love to live or an RV and work remotely.

Thanks for participating in the NUG. Good luck. Have fun in whatever you do.

See you in the funny papers.

-- 
   --
   Tom Dillon   825 N. 500 W.
   DataCraft   Moab, UT 84532
   tomdil...@datacraft-inc.com   720/209-6502
   --
The life you chase,
will eventually catch up to you.  --- Sunastar
   --


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

[4DTidbits] New Post : Fun with Backups

2017-05-31 Thread Herr Alexander Heintz via 4D_Tech
Hi Folks,

here is something new from my never ending collection of components:

AC_BackupTools

http://blog.heintz.net/to-backup-or-not-to-backup/ 


Enjoy, feedback welcome.

Cheers
Alex
**
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: GET PRINT OPTION value2 typing

2017-05-31 Thread John Baughman via 4D_Tech
I just answered my own question. Just use 2 different variables. Duhhh. 

That being said, the compiler never complained before. Why now.

John


> On May 31, 2017, at 9:07 AM, John Baughman  wrote:
> 
> The compiler in v16 is complaining that the 3rd parameter in GET PRINT OPTION 
> type is unknown.It can either be a longint or text value so how do you type 
> the variable?
> 
> In my particular case the answer is easy as I am only using it to get the 
> destination option so can type it as text. What do you do if you need to get 
> the double sided option as well?

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

GET PRINT OPTION value2 typing

2017-05-31 Thread John Baughman via 4D_Tech
The compiler in v16 is complaining that the 3rd parameter in GET PRINT OPTION 
type is unknown.It can either be a longint or text value so how do you type the 
variable?

In my particular case the answer is easy as I am only using it to get the 
destination option so can type it as text. What do you do if you need to get 
the double sided option as well?
**
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: "This component protected method cannot be edited." - but it's not a component method

2017-05-31 Thread Floyd Zink via 4D_Tech
David,

 

It’s not a very good error message as in my experience it has nothing to do 
with components.

 

Check the “Access” of the method. Also, I’ve found the batch edit option only 
works for the Designer log in.

 

Floyd Zink

QMed Corporation

 

From: 4D_Tech <4d_tech-boun...@lists.4d.com> on behalf of David Adams via 
4D_Tech <4d_tech@lists.4d.com>
Date: Wednesday, May 31, 2017 at 04:39 AM
Subject: "This component protected method cannot be edited." - but it's not a 
component method

 

Weird one. I've got a database and I want to make a batch modification of

an attribute. (I want to set everything invisible and then show the handful

of methods useful in user and the 4D editors.)

 

But I'm getting the error "This component protected method cannot be

edited." But I'm not specifically trying to edit a component method. Is it

impossible to use the batch edit mode if you've got a component installed

with unshared methods?

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

[no subject]

2017-05-31 Thread Andreas Overmeyer via 4D_Tech
David I will pay 100 bucks, if you include me in your code manager beta list, 
if you create one:)

Andreas

> Am 28.05.2017 um 19:19 schrieb 4d_tech-requ...@lists.4d.com:
> 
> Right now if you want to make a really efficient, reliable and
> easy-to-extend form code manager,
**
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
**

Component and 4dd file

2017-05-31 Thread Andreas Overmeyer via 4D_Tech
David

Please publish a small example on dropbox

von unterwegs gesendet

> Am 29.05.2017 um 10:56 schrieb 4d_tech-requ...@lists.4d.com:
> 
> I've got a simple setup with a component that includes a .4DD file. I want
> the component to open up and use the data file. I've gotten this working
> when everything is interpreted. With a compiled component, I get a stack of
> errors, starting with error -43, fil
**
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: USE DATABASE from 4D client

2017-05-31 Thread Alan Chan via 4D_Tech
I might be missing something obvious. Why not simply using SQL login to access 
external database and the data could be accessed by multiple 4D clients.

SQL LOGIN($externaAddress;$user;$pswd;*)
If (OK=1)
Begin SQL
//do whatever SQL query
End SQL
SQL LOGOUT
End if 

Alan Chan

4D iNug Technical <4d_tech@lists.4d.com> writes:
>If I have an external datafile held on the server how do I access it
>(purely for lookup) from a 4D client?

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

TEXT TO ARRAY won't break solid text

2017-05-31 Thread Don Lapin via 4D_Tech
Does anyone know how to measure the size of an unbroken text string, in a 
particular font, size, etc, such as --

"P201+P373+P401+P502"

In a 4D Write area with two tabs (v14 Windows), I would like to see --

P201 Item stored under refrigerated conditions
P201+P373+P401+P502
 Item stored in refrigerated, dried conditions, with like items. Use
 precautions when handling. Dispose of safely.
P203 Item stored in dessicator


But because TEXT TO ARRAY doesn't work on the codes, I get --

P201 Item stored under refrigerated conditions
P201+P373+P401+P502 Item stored in refrigerated, dried conditions, with like 
items. 
 Use precautions when handling. Dispose of safely.
P203 Item stored in dessicator


Thanks,
Don

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

"This component protected method cannot be edited." - but it's not a component method

2017-05-31 Thread David Adams via 4D_Tech
Weird one. I've got a database and I want to make a batch modification of
an attribute. (I want to set everything invisible and then show the handful
of methods useful in user and the 4D editors.)

But I'm getting the error "This component protected method cannot be
edited." But I'm not specifically trying to edit a component method. Is it
impossible to use the batch edit mode if you've got a component installed
with unshared methods?
**
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
**