Hi All,

Using 4D v13 on Windows, i have need to transform some picture files in: BASE64ENCODED_MEDIA_RESOURCE

How i can do with 4D?

Thanks

/Ferdinando/

Il 07/05/2019 05:39, 4d_tech-requ...@lists.4d.com ha scritto:
Send 4D_Tech mailing list submissions to
        4d_tech@lists.4d.com

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.4d.com/mailman/listinfo/4d_tech
or, via email, send a message with subject or body 'help' to
        4d_tech-requ...@lists.4d.com

You can reach the person managing the list at
        4d_tech-ow...@lists.4d.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of 4D_Tech digest..."


Today's Topics:

    1. Re: Multiple SSL certificates on server (4dialog)
    2. Re: Printing an existing PDF File in Windows 10 (Tim Nevels)
    3. Re: Printing an existing PDF File in Windows 10 (Doug Cottrill)
    4. Re: Printing an existing PDF File in Windows 10 (Julio Carneiro)
    5. Re: Printing Structure Diagram (Herr Alexander Heintz)
    6. Re: Capturing workstation timezone from the OS (Peter Jakobsson)
    7. Re: Printing Structure Diagram (Keisuke Miyako)
    8. Re: Asynchronous Progress Wheel (Keisuke Miyako)
    9. Re: XML real number display (Keisuke Miyako)
   10. Re: Custom Form Events (Chris Belanger)


----------------------------------------------------------------------

Message: 1
Date: Mon, 6 May 2019 12:09:23 -0700 (MST)
From: 4dialog <helge.anton...@4dialog.no>
To: 4d_tech@lists.4d.com
Subject: Re: Multiple SSL certificates on server
Message-ID: <1557169763129-0.p...@n5.nabble.com>
Content-Type: text/plain; charset=us-ascii

Thanks, that was good news - all answers in my favor - almost too good to be
true? :)

Then i will turn all functions to sp functions and test on the server.
Thanks again. :)



-----
Hilsen
--------------------------------------
Helge Antonsen
www.4dialog.no
--
Sent from: http://4d.1045681.n5.nabble.com/4D-Tech-f1376241.html


------------------------------

Message: 2
Date: Mon, 6 May 2019 14:54:40 -0500
From: Tim Nevels <timnev...@mac.com>
To: 4d_tech@lists.4d.com
Subject: Re: Printing an existing PDF File in Windows 10
Message-ID: <d0866a6f-923c-4c23-9fd8-ac3a01fca...@mac.com>
Content-Type: text/plain;       charset=utf-8

On May 6, 2019, at 2:00 PM, Doug Cottril wrote:

Julio & all

That does indeed, work.  However, the SW_Hide parameter does not seem to 
suppress the print
dialogs.  Since I actually need to print multiple documents at once, the user 
does not want to
press the print button after every page (and there could be 50+ pages, so I 
don’t blame them)

I’ll read the docs a bit and the resource Chip posted, but if anyone has beat 
their head against
this wall before and either has a solution, or knows there isn’t one, I’d 
appreciate hearing
about it.
You appear to have several options:

PDFtoPrinter    http://www.columbia.edu/~em36/pdftoprinter.html  Have not used 
it, just found it with Google.

Foxit Reader    https://www.foxitsoftware.com/pdf-reader/    Have not used it, 
just found it with Google.

Acrobat Reader using “officially undocumented” command line interface.  This is 
the one I built and used many years ago. Not sure if it still works in the 
current version of Acrobat Reader. You will have to test it to see if it still 
works.

Here is some sample code initially written back in 2007. Yikes!!  But you can 
see it supports Acrobat Reader from version 5.0 to 10.0. But you will get the 
docs on the command line parameters. (I found this doing Google searches long 
time ago.)

   // ===========================================
   // PROJECT METHOD: ExpenseReport_PrintReceipts

   // PARAMETERS: $1 = full path to PDF file to print

   // DESCRIPTION: Called form PrintExpenseReport method to print a PDF file
   // of receipts.

   // This method uses the partially documented -- and unsupported -- way of 
getting
   // Adobe Reader to print a PDF file without displaying print dialogs to the 
user.

   // Command Line Parameters:
   //      /p = displays the Print Dialog box  (but my testing shows it does 
not always show dialog box)
   //      /t = prints without dialog box (but you need to also include the 
printer name parameter)
   //      /n = Launches a separate instance of Acrobat or Adobe Reader, even 
if one is currently open.
   //      /s = Opens Acrobat or Adobe Reader, suppressing the splash screen.
   //      /o = Opens Acrobat or Adobe Reader, suppressing the open file dialog.
   //      /h = Opens Acrobat or Adobe Reader in a minimized window.

   // CREATED BY: Tim Nevels, Innovative Solutions ©2007
   // DATE: 9/20/2007
   // LAST MODIFIED:
   // ============================================

C_TEXT($1;$documentPath_t)
$documentPath_t:=$1

$OKtoContinue_b:=True

If (<>MacOS)
        Msg ("Printing receipt PDF files is currently not supported for Mac OS 
X.")
        $OKtoContinue_b:=False
End if

   // get path to Adobe Reader
If ($OKtoContinue_b)
        $adobeReaderProgramPath_t:="C:\\Program Files\\Adobe\\Reader 
10.0\\Reader\\AcroRd32.exe"
        If (Test path name($adobeReaderProgramPath_t)#Is a document)
                $adobeReaderProgramPath_t:="C:\\Program Files\\Adobe\\Reader 
9.0\\Reader\\AcroRd32.exe"
                If (Test path name($adobeReaderProgramPath_t)#Is a document)
                        $adobeReaderProgramPath_t:="C:\\Program Files\\Adobe\\Reader 
8.0\\Reader\\AcroRd32.exe"
                        If (Test path name($adobeReaderProgramPath_t)#Is a 
document)
                                $adobeReaderProgramPath_t:="C:\\Program 
Files\\Adobe\\Reader 7.0\\Reader\\AcroRd32.exe"
                                If (Test path 
name($adobeReaderProgramPath_t)#Is a document)
                                        $adobeReaderProgramPath_t:="C:\\Program 
Files\\Adobe\\Acrobat 7.0\\Acrobat\\Acrobat.exe"
                                        If (Test path 
name($adobeReaderProgramPath_t)#Is a document)
                                                
$adobeReaderProgramPath_t:="C:\\Program Files\\Adobe\\Acrobat 
5.0\\Acrobat\\Acrobat.exe"
                                                If (Test path 
name($adobeReaderProgramPath_t)#Is a document)
                                                        Msg ("ERROR: Unable to locate Adobe Reader 
application."+<>CR+<>CR+"Please locate the program.")
                                                        $docRef:=Open 
document("";"APPL";Get pathname)
                                                        If (OK=1)
                                                                
$adobeReaderProgramPath_t:=Document
                                                        Else
                                                                
$adobeReaderProgramPath_t:=""
                                                        End if
                                                End if
                                        End if
                                End if
                        End if
                End if
        End if
        
        If ($adobeReaderProgramPath_t="")
                Msg ("ERROR: Unable to print Receipts PDF file.  The Adobe Reader application 
could not"+" be found.")
                $OKtoContinue_b:=False
        End if
End if


   // get current printer name
If ($OKtoContinue_b)
        $printerName_t:=Get current printer
End if


   // issue the print command to Acrobat Reader
If ($OKtoContinue_b)
        $documentPath_t:=Char(Double quote)+$documentPath_t+Char(Double quote)
        $adobeReaderProgramPath_t:=Char(Double 
quote)+$adobeReaderProgramPath_t+Char(Double quote)
        
          // handle special command line parameters for different Adobe versions
        Case of
                : (Caps lock down)  // %%%%%%%%%%%% Debugging Code %%%%%%%%%%%%
                        $commandLineParameters_t:=" /p /h /s "
                        $userInput_t:=Request("Enter command line 
parameters:";$commandLineParameters_t)
                        If (OK=1)
                                $commandLineParameters_t:=$userInput_t
                        End if
                          // %%%%%%%%%%%% Debugging Code %%%%%%%%%%%%
                        
                : ($adobeReaderProgramPath_t="@Reader 10.0@")
                        $commandLineParameters_t:=" /t "
                        
                : ($adobeReaderProgramPath_t="@Reader 9.0@")
                        $commandLineParameters_t:=" /t "
                        
                : ($adobeReaderProgramPath_t="@Reader 8.0@")
                        $commandLineParameters_t:=" /t "
                        
                Else
                        $commandLineParameters_t:=" /p /h /s "
        End case
        
        SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
        
        LAUNCH EXTERNAL 
PROCESS($adobeReaderProgramPath_t+$commandLineParameters_t+$documentPath_t+" 
"+$printerName_t)
End if

Tim

*****************************************
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
*****************************************



------------------------------

Message: 3
Date: Mon, 6 May 2019 16:12:30 -0400
From: Doug Cottrill <d...@ptmsoftware.com>
To: 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: Printing an existing PDF File in Windows 10
Message-ID: <8a07401d-9582-4521-b625-1772273be...@ptmsoftware.com>
Content-Type: text/plain;       charset=utf-8

Thanks Tim,

I’ll take a look at each of these options.  Much appreciated!

DKC

On May 6, 2019, at 3:54 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> wrote:

On May 6, 2019, at 2:00 PM, Doug Cottril wrote:

Julio & all

That does indeed, work.  However, the SW_Hide parameter does not seem to 
suppress the print
dialogs.  Since I actually need to print multiple documents at once, the user 
does not want to
press the print button after every page (and there could be 50+ pages, so I 
don’t blame them)

I’ll read the docs a bit and the resource Chip posted, but if anyone has beat 
their head against
this wall before and either has a solution, or knows there isn’t one, I’d 
appreciate hearing
about it.
You appear to have several options:

PDFtoPrinter    http://www.columbia.edu/~em36/pdftoprinter.html  Have not used 
it, just found it with Google.

Foxit Reader    https://www.foxitsoftware.com/pdf-reader/    Have not used it, 
just found it with Google.

Acrobat Reader using “officially undocumented” command line interface.  This is 
the one I built and used many years ago. Not sure if it still works in the 
current version of Acrobat Reader. You will have to test it to see if it still 
works.

Here is some sample code initially written back in 2007. Yikes!!  But you can 
see it supports Acrobat Reader from version 5.0 to 10.0. But you will get the 
docs on the command line parameters. (I found this doing Google searches long 
time ago.)

  // ===========================================
  // PROJECT METHOD: ExpenseReport_PrintReceipts

  // PARAMETERS: $1 = full path to PDF file to print

  // DESCRIPTION: Called form PrintExpenseReport method to print a PDF file
  // of receipts.

  // This method uses the partially documented -- and unsupported -- way of 
getting
  // Adobe Reader to print a PDF file without displaying print dialogs to the 
user.

  // Command Line Parameters:
  //      /p = displays the Print Dialog box  (but my testing shows it does not 
always show dialog box)
  //      /t = prints without dialog box (but you need to also include the 
printer name parameter)
  //      /n = Launches a separate instance of Acrobat or Adobe Reader, even if 
one is currently open.
  //      /s = Opens Acrobat or Adobe Reader, suppressing the splash screen.
  //      /o = Opens Acrobat or Adobe Reader, suppressing the open file dialog.
  //      /h = Opens Acrobat or Adobe Reader in a minimized window.

<Snip>




------------------------------

Message: 4
Date: Mon, 6 May 2019 18:30:42 -0300
From: Julio Carneiro <jjfo...@gmail.com>
To: 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: Printing an existing PDF File in Windows 10
Message-ID: <c449d670-8525-4169-8238-17951ef20...@gmail.com>
Content-Type: text/plain;       charset=utf-8

@Tim, one problem with those non-Adobe solutions is compatibility. Depending on 
the type/contents of your PDF’s, those non-Adobe alternatives may not handle 
them well.

In my case I'm dealing mostly with PDFs that contain images, and no text at 
all. In my experience those non-Adobe alternatives did not render my pdfs 
properly. So, if possible I’d stick with Adobe Reader.

julio

On May 6, 2019, at 4:54 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> wrote:

On May 6, 2019, at 2:00 PM, Doug Cottril wrote:

Julio & all

That does indeed, work.  However, the SW_Hide parameter does not seem to 
suppress the print
dialogs.  Since I actually need to print multiple documents at once, the user 
does not want to
press the print button after every page (and there could be 50+ pages, so I 
don’t blame them)

I’ll read the docs a bit and the resource Chip posted, but if anyone has beat 
their head against
this wall before and either has a solution, or knows there isn’t one, I’d 
appreciate hearing
about it.
You appear to have several options:

PDFtoPrinter    http://www.columbia.edu/~em36/pdftoprinter.html  Have not used 
it, just found it with Google.

Foxit Reader    https://www.foxitsoftware.com/pdf-reader/    Have not used it, 
just found it with Google.

Acrobat Reader using “officially undocumented” command line interface.  This is 
the one I built and used many years ago. Not sure if it still works in the 
current version of Acrobat Reader. You will have to test it to see if it still 
works.

Here is some sample code initially written back in 2007. Yikes!!  But you can 
see it supports Acrobat Reader from version 5.0 to 10.0. But you will get the 
docs on the command line parameters. (I found this doing Google searches long 
time ago.)

  // ===========================================
  // PROJECT METHOD: ExpenseReport_PrintReceipts

  // PARAMETERS: $1 = full path to PDF file to print

  // DESCRIPTION: Called form PrintExpenseReport method to print a PDF file
  // of receipts.

  // This method uses the partially documented -- and unsupported -- way of 
getting
  // Adobe Reader to print a PDF file without displaying print dialogs to the 
user.

  // Command Line Parameters:
  //      /p = displays the Print Dialog box  (but my testing shows it does not 
always show dialog box)
  //      /t = prints without dialog box (but you need to also include the 
printer name parameter)
  //      /n = Launches a separate instance of Acrobat or Adobe Reader, even if 
one is currently open.
  //      /s = Opens Acrobat or Adobe Reader, suppressing the splash screen.
  //      /o = Opens Acrobat or Adobe Reader, suppressing the open file dialog.
  //      /h = Opens Acrobat or Adobe Reader in a minimized window.

  // CREATED BY: Tim Nevels, Innovative Solutions ©2007
  // DATE: 9/20/2007
  // LAST MODIFIED:
  // ============================================

C_TEXT($1;$documentPath_t)
$documentPath_t:=$1

$OKtoContinue_b:=True

If (<>MacOS)
        Msg ("Printing receipt PDF files is currently not supported for Mac OS 
X.")
        $OKtoContinue_b:=False
End if

  // get path to Adobe Reader
If ($OKtoContinue_b)
        $adobeReaderProgramPath_t:="C:\\Program Files\\Adobe\\Reader 
10.0\\Reader\\AcroRd32.exe"
        If (Test path name($adobeReaderProgramPath_t)#Is a document)
                $adobeReaderProgramPath_t:="C:\\Program Files\\Adobe\\Reader 
9.0\\Reader\\AcroRd32.exe"
                If (Test path name($adobeReaderProgramPath_t)#Is a document)
                        $adobeReaderProgramPath_t:="C:\\Program Files\\Adobe\\Reader 
8.0\\Reader\\AcroRd32.exe"
                        If (Test path name($adobeReaderProgramPath_t)#Is a 
document)
                                $adobeReaderProgramPath_t:="C:\\Program 
Files\\Adobe\\Reader 7.0\\Reader\\AcroRd32.exe"
                                If (Test path 
name($adobeReaderProgramPath_t)#Is a document)
                                        $adobeReaderProgramPath_t:="C:\\Program 
Files\\Adobe\\Acrobat 7.0\\Acrobat\\Acrobat.exe"
                                        If (Test path 
name($adobeReaderProgramPath_t)#Is a document)
                                                
$adobeReaderProgramPath_t:="C:\\Program Files\\Adobe\\Acrobat 
5.0\\Acrobat\\Acrobat.exe"
                                                If (Test path 
name($adobeReaderProgramPath_t)#Is a document)
                                                        Msg ("ERROR: Unable to locate Adobe Reader 
application."+<>CR+<>CR+"Please locate the program.")
                                                        $docRef:=Open 
document("";"APPL";Get pathname)
                                                        If (OK=1)
                                                                
$adobeReaderProgramPath_t:=Document
                                                        Else
                                                                
$adobeReaderProgramPath_t:=""
                                                        End if
                                                End if
                                        End if
                                End if
                        End if
                End if
        End if
        
        If ($adobeReaderProgramPath_t="")
                Msg ("ERROR: Unable to print Receipts PDF file.  The Adobe Reader application 
could not"+" be found.")
                $OKtoContinue_b:=False
        End if
End if


  // get current printer name
If ($OKtoContinue_b)
        $printerName_t:=Get current printer
End if


  // issue the print command to Acrobat Reader
If ($OKtoContinue_b)
        $documentPath_t:=Char(Double quote)+$documentPath_t+Char(Double quote)
        $adobeReaderProgramPath_t:=Char(Double 
quote)+$adobeReaderProgramPath_t+Char(Double quote)
        
          // handle special command line parameters for different Adobe versions
        Case of
                : (Caps lock down)  // %%%%%%%%%%%% Debugging Code %%%%%%%%%%%%
                        $commandLineParameters_t:=" /p /h /s "
                        $userInput_t:=Request("Enter command line 
parameters:";$commandLineParameters_t)
                        If (OK=1)
                                $commandLineParameters_t:=$userInput_t
                        End if
                          // %%%%%%%%%%%% Debugging Code %%%%%%%%%%%%
                        
                : ($adobeReaderProgramPath_t="@Reader 10.0@")
                        $commandLineParameters_t:=" /t "
                        
                : ($adobeReaderProgramPath_t="@Reader 9.0@")
                        $commandLineParameters_t:=" /t "
                        
                : ($adobeReaderProgramPath_t="@Reader 8.0@")
                        $commandLineParameters_t:=" /t "
                        
                Else
                        $commandLineParameters_t:=" /p /h /s "
        End case
        
        SET ENVIRONMENT VARIABLE("_4D_OPTION_HIDE_CONSOLE";"true")
        
        LAUNCH EXTERNAL 
PROCESS($adobeReaderProgramPath_t+$commandLineParameters_t+$documentPath_t+" 
"+$printerName_t)
End if

Tim

*****************************************
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.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
**********************************************************************
--
Julio Carneiro
jjfo...@gmail.com





------------------------------

Message: 5
Date: Mon, 6 May 2019 23:59:38 +0200
From: Herr Alexander Heintz <listrea...@heintz.net>
To: 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: Printing Structure Diagram
Message-ID: <b1d269a6-326a-42d4-bffb-e316e9013...@heintz.net>
Content-Type: text/plain;       charset=us-ascii

Salut Patrick

Am 18.04.2019 um 08:45 schrieb Patrick Emanuel via 4D_Tech 
<4d_tech@lists.4d.com>:
In QS_Toolbox, I've implemented the Vincent solution.
You can view inside the component the diagram and also export it as picture.
nice, but a tad blurry for a large strcuture, actually nothing is readable.
Is there a setting somewhere to define the size and resolution of the picture 
created?

Merci
A+

------------------------------

Message: 6
Date: Tue, 7 May 2019 00:41:51 +0200
From: Peter Jakobsson <li...@netkelvin.com>
To: 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: Capturing workstation timezone from the OS
Message-ID: <84f8a072-f484-4b68-9f3e-9f972dd56...@netkelvin.com>
Content-Type: text/plain;       charset=us-ascii

Hi John

Many thanks. Nearly a decade old ! Should be well trodden.

Peter

On 6 May 2019, at 18:03, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> wrote:

This gives the number of seconds offset from GMT.

John DeSoi, Ph.D.


------------------------------

Message: 7
Date: Mon, 6 May 2019 22:46:13 +0000
From: Keisuke Miyako <keisuke.miy...@4d.com>
To: 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: Printing Structure Diagram
Message-ID: <40dc3f6e-3925-46e3-b7fa-dbf358b33...@4d.com>
Content-Type: text/plain; charset="utf-8"

perhaps you could take the printing portion from this one:

https://github.com/miyako/4d-utility-structure-to-svg-converter-v2

SVG is scalable and vectorial,
but some picture commands would rasterise it.
so don't do that.

2019/05/07 6:59、Herr Alexander Heintz via 4D_Tech 
<4d_tech@lists.4d.com<mailto:4d_tech@lists.4d.com>>のメール:
nice, but a tad blurry for a large strcuture, actually nothing is readable.
Is there a setting somewhere to define the size and resolution of the picture 
created?




------------------------------

Message: 8
Date: Mon, 6 May 2019 22:47:40 +0000
From: Keisuke Miyako <keisuke.miy...@4d.com>
To: 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: Asynchronous Progress Wheel
Message-ID: <63db4502-bf5d-4d1c-9bd6-94ab38a44...@4d.com>
Content-Type: text/plain; charset="utf-8"

my 2 yen

https://github.com/miyako/4d-widget-chasing-arrow

2019/05/07 3:18、Neal Schaefer via 4D_Tech 
<4d_tech@lists.4d.com<mailto:4d_tech@lists.4d.com>>のメール:
code for displaying an asynchronous progress wheel.




------------------------------

Message: 9
Date: Mon, 6 May 2019 23:04:45 +0000
From: Keisuke Miyako <keisuke.miy...@4d.com>
To: 4D iNug Technical <4d_tech@lists.4d.com>
Subject: Re: XML real number display
Message-ID: <eda4de78-14f0-45b0-a455-df5c0e208...@4d.com>
Content-Type: text/plain; charset="utf-8"

I would imagine you'd need to write a wrapper DOM function that concatenates Int(), 
".", Dec().

xml itself allows scientific notation but not if you filter it with a schema.

you might also want to take care of INF (which is never allowed in xml)

B.T.W.

I confirm the e-05 threshold with the xml format in 4D

$num:=String(0.000000000000001)  //0.000000000000001
$num:=String(0.00001;"&xml")  //1E-05

so maybe you could use the classic ####0.000000 type of format if the precision 
is limited.
(need to check the compatibility setting re: placeholders in formats)

2019/05/07 2:14、Andrea Angeli via 4D_Tech <4d_tech@lists.4d.com>のメール:

I should write an xml file with a specific schema where numbers must be always 
in decimal format, but 4D, when the numbers value is less or egual to value 
0.00001, changes their format from decimal to scientific notation.
The Scientific notation is not allowed in the xml schema and obviously the 
server, that should import the xml file, return an error.
Does anyone know a way to force 4D to use always a decimal format?
I would like to avoid to change number in string.




------------------------------

Message: 10
Date: Mon, 6 May 2019 21:39:13 -0600
From: Chris Belanger <macprogram...@gmail.com>
To: 4D iNUG Technical <4d_tech@lists.4d.com>
Subject: Re: Custom Form Events
Message-ID: <09161fa5-e0c8-4feb-a0dc-82586ed73...@gmail.com>
Content-Type: text/plain;       charset=utf-8

Hi Justin,
Just to let you know, that SET TIMER() trick just came in handy in another 
situation.
There is a weird thing that in the Form's on Load event,

   LISTBOX SORT COLUMNS(*;$LB_Name;$ColSortBy;<)     // this is doing a reverse 
sort on the sort column

would not sort the records in reverse, but the listbox header would give the 
impression that it was.
I was at a loss on how to force it to work.

What I did is add this line to the last line of the Form Method’s   on Load   
Event:
SET TIMER(-1)  // we need to do the LB_SORT and it won't do a reverse sort at this point. 
So we cause a "on Timer" event and let the LB_SORT() happen then.           

Then I set the ‘on Timer’ event to work for this form,

Then added this to the Form Method
: (Form event=On Timer) 
                LB_SORT ("LB_Browser")
                SET TIMER(0)  // reset so it stops

——

now the sort gets performed prior to the browser form being displayed.
Thanks!

— Chris


On Apr 24, 2019, at 10:15 PM, Chris Belanger <macprogram...@gmail.com> wrote:

Hi Justin,

Thanks for the observations. I never thought about using a SET TIMER(-1) to 
make something run immediately after On Load is done. It is true that many 
objects are not ‘existent’ by the On Load cycle and that causes me some 
problems in trying to make code that is as generic as possible.

I am going to try employing some of the functionality you describe.

Regarding ’new formula’, just to let you know how I have been using it, I 
‘install’ a   Form.onSave,  Form.onLoad,  Form.onNew   group of formulas
i.e. Form.onLoad:=new formula( )     or   := new formula from string( )
in conjunction with some other Form.   objects, I can have a generic mechanism 
for new / save/ load of records, with the specialized ’nub’ being executed in 
the appropriate formula.

I have been absolutely enthralled with the new focus of 4D on ORDA and 
object-oriented programming.
It is exciting to see how they are expanding this to other areas of the 
language.
I find that the code is greatly simplified and concise.


— Chris

On Apr 23, 2019, at 5:20 PM, Justin Carr via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

Hi Chris

We use SET TIMER(-1) a lot for this purpose. It is ideal when you want to do 
something as part of On Load but you need the On Load execution cycle to finish 
first before you do the next thing, e.g. you need to know the size and position 
of an object on a form before you take some other action.

POST OUTSIDE CALL can also be used for this purpose, particularly if you're sending the event from 
another process. CALL FORM is the the "new way" to do this sort of thing but you have to 
be aware that it does not always run in its own execution cycle, i.e. you can't rely on it to 
perform the sort of On Load workflow I just described because the chances are it will run in the 
same exection cycle as the original On Load. Even when the CALL FORM is made from a separate 
process it won't necessarily run in its own execution cycle. That said, if I'm not relying on some 
previous execution cycle to have finished and want to "send an event" to the form then 
CALL FORM is definitely the way to go.

I haven't tried New formula yet so can't comment on that.

cheers
J

On 24 Apr 2019, at 1:24 am, Chris Belanger via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

Douglas, that is an ingenious way to facilitate it. I suppose one could use a 
Form object (Form.myEvent) to specify the ‘event’ to perform.
But it seems that SET TIMER(-1) is what needs to be done [trigger as soon as 
possible] and then SET TIMER(0) disables the triggering?

— Chris

On Apr 23, 2019, at 9:19 AM, Douglas von Roeder via 4D_Tech 
<4d_tech@lists.4d.com> wrote:

Chris:

Set timer (0) and then catch it in On timer.

--
Douglas von Roeder
949-336-2902


On Tue, Apr 23, 2019 at 8:17 AM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

I have been using New formula too.
In the context of ORDA-based forms, I have set up  Form.onSave(),
Form.onLoad(), Form.onNew() etc. I like it because the code for record
selection and change can be generic with these ’nubs’.
I wish that one did not have to create a project method [for other than
the most rudimentary use] to use ’New Formula’, but still it is a great new
feature.

In any case, back to my question about form events. Is the only mechanism
to do an ‘Outside Call’ with POST OUTSIDE CALL? What have you found that
works, if anything.


On Apr 23, 2019, at 9:05 AM, Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:
I think the future is to use New formula.

it is like a function pointer in other languages,
it allows the callee to invoke a callback function at a later time.

https://blog.4d.com/new-formula-more-power-behind-simplicity/

alternatively, one could say that CALL FORM is like a custom form event.

regarding subforms,
CALL SUBFORM CONTAINER can only convert an event in the subform context
to another event in the host's context,
it does not generate a new event.

2019/04/23 23:32、Chris Belanger via 4D_Tech <4d_tech@lists.4d.com
<mailto:4d_tech@lists.4d.com>>のメール:
I remember — but cannot find again — some documentation that talked
about using negative-numbered values for events to facilitate custom
events. However, I seem to remember it only was in the context of subforms.


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


------------------------------

Subject: Digest Footer

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

------------------------------

End of 4D_Tech Digest, Vol 144, Issue 10
****************************************
**********************************************************************
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
**********************************************************************

Reply via email to