<![CDATA[HMGforum.com]]> http://www.hmgforum.com Tue, 13 Jan 2026 00:18:10 +0000 Smartfeed extension for phpBB http://www.hmgforum.com/styles/prosilver/theme/images/site_logo.svg <![CDATA[HMGforum.com]]> http://www.hmgforum.com en-gb Tue, 13 Jan 2026 00:18:10 +0000 60 <![CDATA[HMG News and Updates :: Happy New Year 2026 :: Author serge_girard]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72027#p72027 no_email@example.com (serge_girard) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72027#p72027 Thu, 01 Jan 2026 07:45:08 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72027#p72027 <![CDATA[HMG News and Updates :: Re: Happy New Year 2026 :: Reply by mol]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72028#p72028 no_email@example.com (mol) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72028#p72028 Thu, 01 Jan 2026 08:23:45 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72028#p72028 <![CDATA[HMG News and Updates :: Re: Happy New Year 2026 :: Reply by nekbmm]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72029#p72029 no_email@example.com (nekbmm) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72029#p72029 Thu, 01 Jan 2026 15:34:52 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72029#p72029 <![CDATA[HMG News and Updates :: Re: Happy New Year 2026 :: Reply by quartz565]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72032#p72032 no_email@example.com (quartz565) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72032#p72032 Fri, 02 Jan 2026 22:40:17 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72032#p72032 <![CDATA[HMG News and Updates :: Re: Happy New Year 2026 :: Reply by franco]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72034#p72034 no_email@example.com (franco) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72034#p72034 Sat, 03 Jan 2026 01:32:55 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72034#p72034 <![CDATA[HMG News and Updates :: Re: Happy New Year 2026 :: Reply by freexbase]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72035#p72035 no_email@example.com (freexbase) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72035#p72035 Mon, 05 Jan 2026 10:37:37 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72035#p72035 <![CDATA[HMG News and Updates :: Re: Happy New Year 2026 :: Reply by tonton2]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72036#p72036 no_email@example.com (tonton2) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72036#p72036 Mon, 05 Jan 2026 12:40:48 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72036#p72036 <![CDATA[HMG News and Updates :: Re: Happy New Year 2026 :: Reply by mustafa]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72037#p72037 Saludos,Regards,Salam]]> no_email@example.com (mustafa) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72037#p72037 Mon, 05 Jan 2026 14:17:20 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72037#p72037 <![CDATA[HMG News and Updates :: Re: Happy New Year 2026 :: Reply by Steed]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72038#p72038 no_email@example.com (Steed) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72038#p72038 Mon, 05 Jan 2026 17:58:40 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72038#p72038 <![CDATA[HMG News and Updates :: Re: Happy New Year 2026 :: Reply by luisvasquezcl]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72039#p72039 no_email@example.com (luisvasquezcl) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72039#p72039 Tue, 06 Jan 2026 08:36:21 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72039#p72039 <![CDATA[HMG News and Updates :: Re: Happy New Year 2026 :: Reply by Algernon]]> http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72055#p72055 Happy New Year]]> no_email@example.com (Algernon) http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72055#p72055 Mon, 12 Jan 2026 12:59:20 +0000 http://www.hmgforum.com/viewtopic.php?f=2&t=7720&p=72055#p72055 <![CDATA[HMG General Help :: variable Lost after Second Call :: Author AUGE_OHR]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72021#p72021
i have a funny Problem : i "lost" a Variable after Second Call ?
it work twice, but when call 3rd, Time i got "Error BASE/1003 Variable does not exist: DFROM" ???

i init it here
Image

here i pass Parameter Image

and here i set Parameter as DEFAULT Image

here is the full Source CODE, look at BLPRESS.PRG
BLPRESS01.ZIP
goto Main/Menu an select "Date Range" use one of the Radio Button (1-3, not 4)
Image
try it again and when thy 3rd. Time you will get the Error ...

Attachments

BLPRESS01.ZIP (42.44 KiB)
]]>
no_email@example.com (AUGE_OHR) http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72021#p72021 Wed, 24 Dec 2025 14:49:15 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72021#p72021
<![CDATA[HMG General Help :: Re: variable Lost after Second Call :: Reply by serge_girard]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72022#p72022 S]]> no_email@example.com (serge_girard) http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72022#p72022 Wed, 24 Dec 2025 15:43:10 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72022#p72022 <![CDATA[HMG General Help :: Re: variable Lost after Second Call :: Reply by AUGE_OHR]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72023#p72023
found a Way to work : use Function instead of Variable !

Code: Select all

*+--------------------------------------------------------------------
*+
*+ Source Module => x:\hmg.3.4.4\0\PULS\STACK.PRG
*+
*+    Copyright(C) 1983-2026 by Auge & Ohr
*+
*+    Functions: Function SP_INIT()
*+               Function SP_DFROM()
*+               Function SP_DTO()
*+
*+    Reformatted by Click! 2.05.42 on Dec-25-2025 at  6:51 am
*+
*+--------------------------------------------------------------------

#include "hmg.ch"

#xtranslate F_DFROM       => Stack\[SP, 1]
#xtranslate F_DTO         => Stack\[SP, 2]

STATIC Stack := {}
STATIC SP    := 0

*+--------------------------------------------------------------------
*+
*+    Function SP_INIT()
*+
*+    Called from ( blpress.prg )   1 - procedure main()
*+
*+--------------------------------------------------------------------
*+
FUNCTION SP_INIT()                                                    // init STACK

   AADD( Stack, ARRAY( 2 ) )
   SP ++
   F_DFROM := CTOD( " / / " )
   F_DTO := CTOD( " / / " )
RETURN NIL

*+--------------------------------------------------------------------
*+
*+    Function SP_DFROM()
*+
*+    Called from ( blpress.prg )   1 - static procedure dosetrange()
*+                                   4 - static procedure dosetfilterrange()
*+
*+--------------------------------------------------------------------
*+
FUNCTION SP_DFROM( Value )

   IF PCOUNT() > 0
      F_DFROM := Value
   ENDIF
RETURN F_DFROM

*+--------------------------------------------------------------------
*+
*+    Function SP_DTO()
*+
*+    Called from ( blpress.prg )   1 - static procedure dosetrange()
*+                                   4 - static procedure dosetfilterrange()
*+
*+--------------------------------------------------------------------
*+
FUNCTION SP_DTO( Value )

   IF PCOUNT() > 0
      F_DTO := Value
   ENDIF
RETURN F_DTO

*+ EOF: STACK.PRG

Code: Select all

PROCEDURE MAIN()
...
// on TOP
   SP_INIT()
...

Code: Select all

STATIC PROCEDURE DoSetRange()
...
         ACTION { || nZEIT := DateFilter.RadioGroup_1.VALUE, ;
                  SP_DFROM( DateFilter.DatePicker_FROM.VALUE ), ;
                  SP_DTO( DateFilter.DatePicker_TO.VALUE ), ;
                  DoSetFilterRange( nZEIT ) }
  

Code: Select all

STATIC PROCEDURE DoSetFilterRange( nZEIT )

LOCAL lUse   := USED()
LOCAL bError := ERRORBLOCK( { | oErr | BREAK( oErr ) } )
LOCAL oError

   BEGIN SEQUENCE
      SET FILTER TO
      BLPRESS.Text_Min.ReadOnly := .F.
      BLPRESS.Text_Max.ReadOnly := .F.

      IF SP_DTO() >= SP_DFROM()

         DO CASE
            CASE nZEIT = 3
               SET FILTER TO BLPRESS->PDATE >= SP_DFROM() .AND. ;
                             BLPRESS->PDATE <= SP_DTO()

            CASE nZEIT = 2
now it work as i like :)]]>
no_email@example.com (AUGE_OHR) http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72023#p72023 Thu, 25 Dec 2025 06:01:19 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72023#p72023
<![CDATA[HMG General Help :: Re: variable Lost after Second Call :: Reply by franco]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72025#p72025 They stay active until you close the function/procedure that you create them in. Not sure about static procedure, have never used them.]]> no_email@example.com (franco) http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72025#p72025 Mon, 29 Dec 2025 15:59:39 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72025#p72025 <![CDATA[HMG General Help :: Re: variable Lost after Second Call :: Reply by AUGE_OHR]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72026#p72026
franco wrote: Mon Dec 29, 2025 3:59 pm Jimmy, your first program may have worked with PRIVATE variables for dates instead of local.
THX for Answer.
i´m not sure if i have used PRIVATE for Test, i use PRIVATE only very rare.

Now using Function to store Value it work without Problem.

But i still don´t understand why it have crash before
i do not understand why it work Twice, but than Fail at 3rd Call ???]]>
no_email@example.com (AUGE_OHR) http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72026#p72026 Mon, 29 Dec 2025 19:49:56 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72026#p72026
<![CDATA[HMG General Help :: Re: variable Lost after Second Call :: Reply by franco]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72030#p72030 procedure making them.
Build this below. you will see how it works. in procedure checkvar variable "B" is known but "A" will crash as it was local only
to first Procedure or Function.

Code: Select all

#include "hmg.ch"

FUNCTION Main
local a:= 'ax'
private b := 'bx'
checkvar()

RETURN

PROCEDURE checkvar()
msgbox(b)
msgbox(a)
RETURN
]]>
no_email@example.com (franco) http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72030#p72030 Thu, 01 Jan 2026 17:39:34 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72030#p72030
<![CDATA[HMG General Help :: Re: variable Lost after Second Call :: Reply by AUGE_OHR]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72031#p72031
franco wrote: Thu Jan 01, 2026 5:39 pm Build this below. you will see how it works. in procedure checkvar variable "B" is known but "A" will crash as it was local only to first Procedure or Function.
THX, i know this

as you can see i pass LOCAL as Parameter and i also declare DEFAULT TO so i don´t understand why a Error of "unkown DFROM" can exist ?!

p.s. i do not like using PRIVATE, because it becomes confusing with large programs containing many lines of CODE.
Using FUNCTION instead of PRIVATE/PUBLIC, together with a documenter like CLICK, you get an overview of WHERE the variables are called up.]]>
no_email@example.com (AUGE_OHR) http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72031#p72031 Fri, 02 Jan 2026 15:26:11 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72031#p72031
<![CDATA[HMG General Help :: Re: variable Lost after Second Call :: Reply by franco]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72033#p72033 I use this all the time in very large programs, but never from a main type function. these functions get closed fairly quickly.
If I need variables for throughout the program I make them public. I also have a large control file that if I need to store variables
I have a field for them in there and can change them when needed.
I guess it depends on what you get used to doing..... We all have own ways.]]>
no_email@example.com (franco) http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72033#p72033 Sat, 03 Jan 2026 01:31:06 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7718&p=72033#p72033
<![CDATA[HMG General Help :: Re: Codepage, hb_Translate(), OEM <-> ANSI :: Reply by jozef]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7041&p=72052#p72052 I started to move from ANSI version to UNICODE version of HMG. Your convert program is very usefull.
Thank you,
Jozef]]>
no_email@example.com (jozef) http://www.hmgforum.com/viewtopic.php?f=5&t=7041&p=72052#p72052 Fri, 09 Jan 2026 09:18:57 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7041&p=72052#p72052
<![CDATA[HMG General Help :: Re: Codepage, hb_Translate(), OEM <-> ANSI :: Reply by AUGE_OHR]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7041&p=72053#p72053
here full Source of App
CONVERT_Source.ZIP

Attachments

CONVERT_Source.ZIP (24.57 KiB)
]]>
no_email@example.com (AUGE_OHR) http://www.hmgforum.com/viewtopic.php?f=5&t=7041&p=72053#p72053 Sat, 10 Jan 2026 20:27:35 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7041&p=72053#p72053
<![CDATA[HMG General Help :: Re: Codepage, hb_Translate(), OEM <-> ANSI :: Reply by franco]]> http://www.hmgforum.com/viewtopic.php?f=5&t=7041&p=72054#p72054

Code: Select all

  cDir := GetFolder( cTitle, TRIM( cInitPath ),, lNewFolderButton )
   IF !EMPTY( cDir )
       IF RAT( "\", cDir ) <> LEN(cDir)
                 cDir += "\"
       ENDIF
      ExportDbf.Text_Path.value := cDir                                //+ "\"  // add "\"
   ENDIF
]]>
no_email@example.com (franco) http://www.hmgforum.com/viewtopic.php?f=5&t=7041&p=72054#p72054 Sat, 10 Jan 2026 18:21:29 +0000 http://www.hmgforum.com/viewtopic.php?f=5&t=7041&p=72054#p72054
<![CDATA[General :: Re: Acerda de Libreria PrintSystem :: Reply by franco]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7717&p=72018#p72018 I do not quit understand. Could you send a code sample of what you are trying to do.]]> no_email@example.com (franco) http://www.hmgforum.com/viewtopic.php?f=24&t=7717&p=72018#p72018 Thu, 18 Dec 2025 17:57:01 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7717&p=72018#p72018 <![CDATA[General :: Re: Acerda de Libreria PrintSystem :: Reply by franco]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7717&p=72020#p72020 This is beyond my knowledge.

which library I need to add to include PrintSystem in a command-line (DOS) project using HBMK2 to compile.]]>
no_email@example.com (franco) http://www.hmgforum.com/viewtopic.php?f=24&t=7717&p=72020#p72020 Sun, 21 Dec 2025 16:55:41 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7717&p=72020#p72020
<![CDATA[General :: Re: Acerda de Libreria PrintSystem :: Reply by mjaviergutierrez]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7717&p=72040#p72040 Gracias "franco" por su respuesta, era una tontería, me había equivocado yo con el archivo de compilación.
Pido disculpas por haber ocupado un hilo para una consulta fallida.
Muy feliz 2026 para todos !
Saludos]]>
no_email@example.com (mjaviergutierrez) http://www.hmgforum.com/viewtopic.php?f=24&t=7717&p=72040#p72040 Wed, 07 Jan 2026 13:54:09 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7717&p=72040#p72040
<![CDATA[General :: Integración con WhatsApp :: Author mjaviergutierrez]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72041#p72041 Estuve investigando en Post anteriores, sobre la posibilidad de integran mi programa con WhatsApp, puntualmente enviar un documento (factura en PDF), pero NO encuentro nada claro. Alguien tendrá alguna info si existe esta posibilidad ?
Saludos.]]>
no_email@example.com (mjaviergutierrez) http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72041#p72041 Wed, 07 Jan 2026 14:32:11 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72041#p72041
<![CDATA[General :: Re: Integración con WhatsApp :: Reply by serge_girard]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72042#p72042
WhatsApp Business API + cURL

Serge]]>
no_email@example.com (serge_girard) http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72042#p72042 Wed, 07 Jan 2026 16:34:43 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72042#p72042
<![CDATA[General :: Re: Integración con WhatsApp :: Reply by mjaviergutierrez]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72043#p72043 Gracias, me voy a poner a investigar.]]> no_email@example.com (mjaviergutierrez) http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72043#p72043 Wed, 07 Jan 2026 16:38:01 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72043#p72043 <![CDATA[General :: Re: Integración con WhatsApp :: Reply by franco]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72044#p72044 I prints to file
#include <hmg_hpdf.ch>
set HpdfDoc Encoding to "WinAnsiEncoding"
set printer to your invoice number +".pdf" to print to file for emailing.

@10,20 HpdPrint Customer->Name size 10

Give it a try. I think everything you need is here.

Sorry
This may not work but has some good ideas I will get back with proper code.]]>
no_email@example.com (franco) http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72044#p72044 Wed, 07 Jan 2026 17:04:20 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72044#p72044
<![CDATA[General :: Re: Integración con WhatsApp :: Reply by franco]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72046#p72046 You can use a printer instead of file. File is pdf for emailing or printing.

Code: Select all


#include "hmg.ch"

Function Main()
SELECT HPDFDOC "sample.pdf" PAPERLENGTH 300 PAPERWIDTH 300 LOG
START HPDFDOC
    START HPDFPAGE
	
	SET HPDFDOC ENCODING TO "WinAnsiEncoding"
	    
		@ 10,20  HPDFPRINT "I want Euro sign here: "+CHR(128)
		
        @ 20,20  HPDFPRINT "I want this STRIKEOUT (not working)" STRIKEOUT

		@ 18,67  HPDFPRINT "_________" // COLOR { 51, 255, 255 }
		@ 20,92  HPDFPRINT "<----  This line was drawing to simulate a baseline (made manually)" SIZE 9 COLOR { 0, 0, 255 }
		
        @ 30,20  HPDFPRINT "I want this italic" ITALIC
        @ 40,20  HPDFPRINT "I want this bold" BOLD
        @ 50,20  HPDFPRINT "I want this UNDERLINE (not working)" UNDERLINE
		
		@ 50,67  HPDFPRINT "_________" // COLOR { 255, 0, 0 }
		@ 52,92  HPDFPRINT "<----  This line was drawing to simulate a baseline (made manually)" SIZE 9 COLOR { 0, 0, 255 }
        
		@ 60,20 HPDFPRINT "I have HMG 3.2.1 (stable) in Courier-Bold" FONT "Courier-Bold"
        
        @ 80, 10 HPDFPRINT "This is a sample Text in default font in ITALIC." ITALIC
        @ 90, 10 HPDFPRINT "This is a sample Text in default font in BOLD." BOLD
        
        @ 100, 10 HPDFPRINT "This is a sample Text in Arial or Helvetica font in ITALIC." FONT "aRIAL" SIZE 14 ITALIC
        @ 110, 10 HPDFPRINT "This is a sample Text in Arial or Helvetica font in BOLD and ITALIC." FONT "aRIAL" SIZE 14 BOLD ITALIC


*@ 120, 10 hpdfprint image 'img.jpg'  TYPE JPG width 40 height 40' size 10     // (((YOU CAN USE IF YOU HAVE A .JPG PICTURE.)))

        
  *      @ 120, 10 HPDFPRINT "This is a sample Text in Times-Roman font in ITALIC with size 8" font "TIMES-ROMAN" SIZE 8 ITALIC
        
        @ 135, 200 HPDFPRINT "This is right aligned text" SIZE 14 RIGHT
        
        @ 150, 105 HPDFPRINT "This is center aligned text" COLOR { 255, 0, 0 } CENTER
        
        @ 170, 100 HPDFPRINT "This is text in bigger font size" SIZE 30 COLOR { 255, 0, 0 }
        
        @ 190, 10 HPDFPRINT "The font is Tscparan.TTF" size 12

    END HPDFPAGE
END HPDFDOC
Execute File 'sample.pdf'
Return Nil

]]>
no_email@example.com (franco) http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72046#p72046 Wed, 07 Jan 2026 21:58:15 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72046#p72046
<![CDATA[General :: Re: Integración con WhatsApp :: Reply by mol]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72047#p72047 THX for your samples, but I think, Mr Javier beeds whatsapp integration sample...]]> no_email@example.com (mol) http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72047#p72047 Thu, 08 Jan 2026 06:38:56 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72047#p72047 <![CDATA[General :: Re: Integración con WhatsApp :: Reply by AUGE_OHR]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72048#p72048 here is a older Fivewin Desktop Sample :
(not sure if it still work !)

Code: Select all

// whatsapp app must be installed and opened before running this code

#include "FiveWin.ch"

#define ORANGES "https://www.jesmondfruitbarn.com.au/wp-content/uploads/2016/10/Jesmond-Fruit-Barn-Oranges.jpg"

function Main()

   local cPhone   := ""
   local cMsg     := "Hello"

   if EDITVARS cPhone, cMsg
      SendToWhatsApp( AllTrim( cPhone ), AllTrim( cMsg ), ;
         { "tutor01.prg", "..\bitmaps\007.bmp", ORANGES, ;
            "https://www.google.co.in/" } )
   endif

return nil

function SendToWhatsApp( cPhone, cMsg, aAttach )

   local oShell
   local aFiles   := {}
   local aOthers  := {}

   if Empty( cPhone ); return .f.; endif

   DEFAULT cMsg := "Hello"

   if !Empty( aAttach )
      if !HB_ISARRAY( aAttach ); aAttach := { aAttach }; endif
      AEval( aAttach, {|c| if( HB_ISSTRING( c ) .and. File( c ), ;
            AAdd( aFiles, c ), AAdd( aOthers, c ) ) } )
   endif

   cMsg  := StrTran( cMsg, CRLF, "%0D%0A" )

   oShell := CreateObject( "WScript.Shell" )
   ShellExecute( 0, "Open", "whatsapp://send?phone="+cPhone+"&text="+cMsg )
   SysWait( 0.5 )

   if !Empty( aFiles )
      if FW_CopyToClipBoard( aFiles, 15 )
         SysWait( 2 ); oShell:SendKeys( "^v" ); SysWait( 1 )
      endif
   endif

   AEval( aOthers, <|u|
      if FW_CopyToClipBoard( u, 2 ) .or. FW_CopyToClipBoard( u )
         SysWait( 1 ); oShell:SendKeys( "^v" ); SysWait( 1 )
      endif
      return nil
      > )

   oShell:SendKeys("~")

return nil
you need to replace "FW_CopyToClipBoard()"]]>
no_email@example.com (AUGE_OHR) http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72048#p72048 Thu, 08 Jan 2026 09:35:17 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72048#p72048
<![CDATA[General :: Re: Integración con WhatsApp :: Reply by serge_girard]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72049#p72049 no_email@example.com (serge_girard) http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72049#p72049 Thu, 08 Jan 2026 09:44:50 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72049#p72049 <![CDATA[General :: Re: Integración con WhatsApp :: Reply by serge_girard]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72050#p72050

Code: Select all

#include "hmg.ch"
// whatsapp app must be installed and opened before running this code



#define ORANGES "https://www.jesmondfruitbarn.com.au/wp-content/uploads/2016/10/Jesmond-Fruit-Barn-Oranges.jpg"

FUNCTION Main()

   LOCAL cPhone := ""
   LOCAL cMsg   := "Hello"

   cPhone := InputBox( "Telefoonnummer", "WhatsApp", "" )
   IF Empty( cPhone )
      RETURN NIL
   ENDIF

   cMsg := InputBox( "Bericht", "WhatsApp", "Hello" )

   SendToWhatsApp( AllTrim( cPhone ), AllTrim( cMsg ), ;
      { "C:\bols\bols.dbf", ;
        "C:\bols\confirmQR.jpg"} )
        //ORANGES, ;
        //"https://www.google.com/" } )

RETURN NIL






FUNCTION SendToWhatsApp( cPhone, cMsg, aAttach )

   LOCAL oShell
   LOCAL aFiles  := {}
   LOCAL aOthers := {}
   LOCAL cItem

   IF Empty( cPhone )
      RETURN .F.
   ENDIF

   DEFAULT cMsg := "Hello"

   IF HB_ISARRAY( aAttach )
      FOR EACH cItem IN aAttach
         IF HB_ISSTRING( cItem ) .AND. File( cItem )
            AAdd( aFiles, cItem )
         ELSE
            AAdd( aOthers, cItem )
         ENDIF
      NEXT
   ENDIF

   cMsg := StrTran( cMsg, CRLF, "%0D%0A" )

   // WhatsApp openen
   ShellExecute( 0, "open", ;
      "whatsapp://send?phone=" + cPhone + "&text=" + cMsg, ;
      NIL, NIL, 1 )

   hb_idleSleep( 0.5 )

   oShell := CreateObject( "WScript.Shell" )

   // Bestanden plakken
   IF Len( aFiles ) > 0
      CopyFilesToClipboard( aFiles )
      hb_idleSleep( 2 )
      oShell:SendKeys( "^v" )
      hb_idleSleep( 1 )
   ENDIF

   // URL's / tekst
   FOR EACH cItem IN aOthers
      System.Clipboard := cItem
      hb_idleSleep( 1 )
      oShell:SendKeys( "^v" )
      hb_idleSleep( 1 )
   NEXT

   // Enter = verzenden
   oShell:SendKeys( "~" )

RETURN .T.





FUNCTION CopyFilesToClipboard( aFiles )

   LOCAL cList := ""

   AEval( aFiles, {|c| cList += '"' + c + '"' + CRLF } )
   System.Clipboard := cList
RETURN NIL


Whatsapp app must be installed and opened and logged in before running this code !

Beter solution is:
WhatsApp Business API
Twilio / 360dialog
Via HTTP POST + hbcurl]]>
no_email@example.com (serge_girard) http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72050#p72050 Thu, 08 Jan 2026 10:03:41 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72050#p72050
<![CDATA[General :: Re: Integración con WhatsApp :: Reply by franco]]> http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72051#p72051 I pdf print to printers or pdf print to file for email. In all my reports I give the option of print to file or print to printer.
I do not use @1,1 print any more. I use @1,1 hpdfprint.
If a person calls my clients using my software for a quote They will make up an estimate while they are on the phone with them.
Then ask them their email address. They then send the quote while on the phone with them. That way if customers
accept the can arrange right away how to the complete the sale. Works pretty well.
Don`t forget I am old school, still haven't figured out sql.
Having a bit of trouble sending daily inventory values to website.]]>
no_email@example.com (franco) http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72051#p72051 Thu, 08 Jan 2026 17:33:54 +0000 http://www.hmgforum.com/viewtopic.php?f=24&t=7721&p=72051#p72051