Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Juanjogomez

Pages: [1] 2
1
QB64 Discussion / Error downloading file from dropbox
« on: February 06, 2022, 03:43:45 am »
Hi all,
Until now, I was using a utility to update my clients' programs using a program pointed out to me by SpriggsySpriggs and SmcNeil at this link: https://qb64forum.alephc.xyz/index.php?topic=4454.0;prev_next=prev#new
All I had to do was change the final dl=0 to dl=1.
Everything was going fine until yesterday, when the program did not download the file and gave an error: "Error : HTTPQueryInfo" and the program closed. Do you know if there has been any change in Dropbox that makes it not possible to download the files in this way?
Thank you and regards

2
QB64 Discussion / Download files
« on: December 25, 2021, 01:48:44 am »
Hello everyone and Merry Christmas.

I have tried continuing this thread, but I think it is closed. https://qb64forum.alephc.xyz/index.php?topic=4411.msg138383#msg138383

I keep trying how to download files and with the examples that you gave me in the other thread, I still can't get it.


I'm trying to download a file from my dropbox with this code, but nothing is downloading.

Code: QB64: [Select]
  1. DEFINT A-Z
  2.  
  3. CrLf$ = CHR$(13) + CHR$(10) ' carriage return + line feed ASCII characters
  4.  
  5. Host = _OPENHOST("TCP/IP:319")
  6. IF Host THEN
  7.     PRINT "> Server started succesfully."
  8.  
  9.     '// Change this to the file's public link
  10.     IP_File$ = "www.dropbox.com/s/t6y91q4yjys35j7/ALTERAN.exe?dl=0" 'a Drop Box link
  11.  
  12.     URL$ = LEFT$(IP_File$, INSTR(IP_File$, "/") - 1)
  13.     Path$ = MID$(IP_File$, INSTR(IP_File$, "/"))
  14.     Client& = _OPENCLIENT("TCP/IP:80:" + URL$)
  15.     IF Client& THEN
  16.         Request$ = "GET " + Path$ + " HTTP/1.1" + CrLf$ + "Host:" + URL$ + CrLf$ + CrLf$
  17.         PRINT Request$
  18.         PUT #Client&, , Request$
  19.         DO: _LIMIT 20 '              load response header
  20.             GET #Client&, , Dat$
  21.             Header$ = Header$ + Dat$
  22.         LOOP UNTIL INSTR(Header$, CrLf$ + CrLf$) ' Loop until 2 CRLFs (end of HTML header) are found
  23.         PRINT "Header Done."
  24.         PRINT Header$
  25.  
  26.         ' Get file size from header
  27.         SizePos = INSTR(UCASE$(Header$), "CONTENT-LENGTH:") + 16
  28.         SizeEnd = INSTR(SizePos, Header$, CrLf$)
  29.         FileSize& = VAL(MID$(Header$, SizePos, (SizeEnd - SizePos) + 1))
  30.         PRINT "File size is"; FileSize&; "bytes"
  31.         EndPos = INSTR(Header$, CrLf$ + CrLf$) + 4
  32.         Response$ = MID$(Header$, EndPos) ' get data after header already downloaded
  33.  
  34.         start = 1 '// Get file name from original URL path if necessary
  35.         DO '// Change this to destination local file name and path...
  36.             posit = INSTR(start, IP_File$, "/")
  37.             IF posit THEN lastpos = posit: start = posit + 1
  38.         LOOP UNTIL posit = 0
  39.         File$ = MID$(IP_File$, lastpos + 1) 'beware of tag suffixes
  40.         OPEN File$ FOR BINARY AS #1
  41.         DO: _LIMIT 20
  42.             PUT #1, , Response$
  43.             GET #Client&, , Response$
  44.         LOOP UNTIL LOF(1) >= FileSize&
  45.         PRINT "File download completed!"
  46.         CLOSE #1
  47.     ELSE
  48.         PRINT "Failed to connect."
  49.     END IF
  50.     PRINT "Failed to create server connection..."

Could someone pass me some code to download that file or another, just renaming?

Thanks in advance.



3
QB64 Discussion / How to download file
« on: November 23, 2021, 11:55:02 am »
Hi,
I have marketed a warehouse management program made in QB64 and currently 14 companies have it. As each company has an average of 3 computers, the program is installed on 42 computers.
Every time I update the program for an improvement or correction of an error, I have to do it on all 42 computers one by one.
Is there a way to make when it enters the program, it will check for an update in a folder on my NAS and download it directly?
Thanks

4
QB64 Discussion / Suggestion for new version. Improve printing
« on: August 23, 2021, 02:11:34 am »

Hi everyone.
I've been using QB64 in an accounting and warehouse management program for several years, and I print a lot of listings and invoices.
I think a lot of Qb64 users are currently focused on games and graphics, but I find it to be a great language for developing business applications with databases and reports. The versatility with respect to QB45 (which was the language I used in my programs) is enormous.
One limitation that I consider to be very great and would help a lot in the development of management programs is the printing options. Currently, to print an invoice or a list, I have to create a graphic page, load a template in JPG, fill it with the data and images of the company logo, etc. and then execute _PRINTIMAGE with each of the pages. The file that it sends to the printer, being graphic, is quite large and makes it not immediate, especially if what I want is to convert it into PDF with PDFCreator or some other similar program. A 20 page listing (very common) can take 30 minutes to generate, which is not operational.
Likewise, since there are 20 independent pages (although it is the same document) if I have the double-sided printer configured, it does not print double-sided because that only does it if it is a single document. I do not know if I explain myself very well.
A solution for large listings is the one Pete pointed me out, creating a text file and using WordPad in the background. With that method, converting the same 20-page listing to PDF takes 2-3 seconds. The problem that I see using an external program is that I do not trust that Windows 11, 12, 13 or 14 (to name them) removes WorPad, calls it something else or what do I know what Windows developers can do. Also with this method I cannot print images as it happens in the invoices in which the template and the logo are a JPG.
Anyway, after this roll, I think it would be interesting to include in the following versions another way of sending data to the printer, other than through images. I already know that LPRINT exists but it does not allow changing sizes or fonts, or anything like that.
Greetings

5
InForm Discussion / Click event
« on: February 03, 2021, 05:56:15 am »
Hi,
How can a click event be generated by pressing a key?

I am doing my first form and I am lost
I have a form in which there are buttons with numbers (like a numeric keyboard). With the mouse and the click event I do what I need, but I also want to do it with the numeric keyboard, and it has occurred to me, in order not to duplicate code, that with the KeyPress event of the key 1 (for example) make a click of the button that draws a 1. Thus, the same thing that is done when clicking with the mouse on that button would be executed.

And another thing. Where can I find the list of commands and the syntax of all of them? I can't find it on the Wiki.

Thanks

6
QB64 Discussion / RUN or CHAIN
« on: December 04, 2020, 05:34:25 am »
Hi,
To load a program without having to send variables, is it better to use "RUN" or can you use "CHAIN" anyway?
By not having to use an intermediate file to pass variables, "RUN" would load the other program more quickly?.

7
QB64 Discussion / email from QB64
« on: November 25, 2020, 06:06:38 am »
Hi
Could an email be sent from Qb64? If possible from a gmail account and attaching a file.
Thanks

8
QB64 Discussion / Printers parameters
« on: November 13, 2020, 01:50:25 am »
Hello everyone,
A question that I do not know if it is easy or difficult ..... Is it possible to access the printer parameters and change them ?, such as printing double-sided or not? (the printer that has that function)
Thanks

9
QB64 Discussion / Problem whith PCOPY
« on: September 24, 2020, 03:01:18 am »
Hi.
I have a problem copying the above screen using PCOPY.
I have always worked with Screen 0 and the PCOPY command has been used regularly to copy the current screen with the data, paint a second screen over it to introduce other data, and then restore the previous screen with another PCOPY; but when I have tried it defining a new screen and loading an image, trying to restore the previous screen with PCOPY does not. It comes out in black.
What am I doing wrong?
Thank you

This is then program:
Code: QB64: [Select]
  1. LOCATE 10, 10: PRINT "This is the first screen"
  2. LOCATE 12, 20: PRINT "Press a key to load image"
  3.  
  4. x$ = INPUT$(1)
  5.  
  6. PCOPY 0, 1
  7.  
  8. SCREEN _NEWIMAGE(2100, 1900, 32)
  9. WIDTH 150, 40
  10.  
  11. i& = _LOADIMAGE("image.jpg", 32)
  12. PageScale = 10
  13. PageHeight = 190 * PageScale
  14. PageWidth = 210 * PageScale
  15.  
  16. PointSize = 10
  17. FontHeight10 = INT(PointSize * 0.3527 * PageScale)
  18. Fuente10 = _LOADFONT("c:\windows\fonts\times.ttf", FontHeight10)
  19.  
  20. LOCATE 14, 20: PRINT "press a key to go to the previous screen"
  21.  
  22. x$ = INPUT$(1)
  23.  
  24. _FREEFONT Fuente10
  25.  
  26. PCOPY 1, 0
  27.  
  28. LOCATE 20, 10: PRINT "press a key to end": x$ = INPUT$(1)

10
QB64 Discussion / Problem whith install in windows 10 Home
« on: April 27, 2020, 02:44:32 am »
This is one of the posts that were lost on the afternoon of the 26th due to the server failure.

In it, I asked for help because the programs that I have made -and sold- to a client do not work on their computer. They simply go out when you finch on them (they don't even open).

After several posts and suggestions from other forum members, in which you told me to remove antivirus, Wwindows Defender and put it on the firewall whitelist, and given the problem that it remains exactly the same, my last question was that if not It would be because of the graphics card, although the program does not use graphics, only text, as it is a billing program.
The graphics card has a maximum resolution of 1440x900 and the processor is a 1900 Intel Celeron

11
QB64 Discussion / SQL and 64 bits version
« on: April 23, 2020, 04:28:52 am »
Hi,
I have finished the billing program with which I have taken several months. To do this I have used version 1.3 of 32 bits.
Now, I have decided to use the 64-bit version to see if it achieved a higher speed, and when compiling any of the programs I get the "cannot find dynamic library file" window.
In the QB64 folder I have copied the files: mysql.dll and msql_helper.h
Did I have to do something else, or does the SQL library not work in 64 bits?
Thank you

12
QB64 Discussion / Fonts to barcodes
« on: January 02, 2020, 02:12:13 pm »
Hi everyone.

Again I have a problem with the program I am doing and I hope you can help me.

I am trying to print a barcode on the printer but it fails to load barcode fonts such as ConnectCode39.ttf or ean13.ttf

Is it possible to load these types of sources and print barcodes?

Thanks and best regards

13
QB64 Discussion / Problem with _FREEIMAGE
« on: November 17, 2019, 03:42:56 pm »
Hi,

I'm doing a billing program and print the invoices using...

Page & = _NEWIMAGE (PageWidth, PageHeight, 256)
_DEST Page &

... I design the invoice and print the invoice with

    _PRINTIMAGE Page &

... and I release the memory with:

    _FREEIMAGE (Page &)

The problem is that the memory is not released completely and the program grows and grows with successive invoices until it fails.

Making a list of invoices, when it takes more than 50 pages the program already occupies more than 1.5 GB in memory and produces a "handle error"

It might not work well _FREEIMAGE?

Thanks

14
Programs / Select printer
« on: January 04, 2019, 11:27:53 am »
Hi,

The program allows you to select the default printer from the list of printers that your computer has.
When it starts, the red line indicates the current printer and with the arrows up and down another one is indicated in the list. With the ENTER key the new printer is selected and with the ESC key the program is left without changing it.
I hope it works for you in your programs.

CLS
COLOR 15, 0
SHELL _HIDE "cmd/c wmic printer get name, default> impresora.txt"
DIM impresora(50) AS STRING
OPEN "I", 10, "impresora.txt"
n% = 0
LINE INPUT #10, dato$
DO
    LINE INPUT #10, dato$: LINE INPUT #10, dato$
    IF EOF(10) THEN EXIT DO
    n% = n% + 1
    DO
        a% = INSTR(dato$, CHR$(0))
        IF a% = 0 THEN EXIT DO
        IF a% = 1 THEN
            dato$ = MID$(dato$, a% + 1)
        ELSEIF a% = LEN(dato$) THEN
            dato$ = LEFT$(dato$, a% - 1)
        ELSE
            dato$ = LEFT$(dato$, a% - 1) + MID$(dato$, a% + 1)
        END IF
    LOOP
    a% = INSTR(dato$, "FALSE"): b% = INSTR(dato$, "TRUE")
    IF a% <> 0 THEN
        MID$(dato$, a%, 5) = SPACE$(5)
        dato$ = LTRIM$(RTRIM$(dato$))
    END IF
    IF b% <> 0 THEN
        MID$(dato$, b%, 5) = SPACE$(4)
        dato$ = LTRIM$(RTRIM$(dato$))
        loca% = n%
    END IF
    impresora(n%) = dato$
    impresora(0) = LTRIM$(STR$(n%))
LOOP
COLOR 7, 0
CLS
COLOR 1, 7
LOCATE 8, 20: PRINT "ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"
LOCATE 9, 20: PRINT "º                                        º"
LOCATE 10, 20: PRINT "ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹"
LOCATE 11, 20: PRINT "º                                        º"
LOCATE 12, 20: PRINT "º                                        º"
LOCATE 13, 20: PRINT "º                                        º"
LOCATE 14, 20: PRINT "º                                        º"
LOCATE 15, 20: PRINT "º                                        º"
LOCATE 16, 20: PRINT "ÈÍÍÍÍÍÍÍ<Esc>ÍÍÍÍ<"; CHR$(24); ">Í<"; CHR$(25); ">ÍÍÍÍ<"; CHR$(17); CHR$(217); ">ÍÍÍÍÍÍÍÍͼ"
COLOR 15, 1
LOCATE 9, 21: PRINT "            SELECT PRINTER              ";
COLOR 1, 7
max% = VAL(impresora(0))
GOSUB impridatos
DO
    x$ = "": WHILE x$ = "": x$ = INKEY$: WEND
    x$ = UCASE$(x$)
    x% = ASC(RIGHT$(x$, 1))
    SELECT CASE x%
        CASE IS = 27
            a$ = "@"
            EXIT DO
        CASE IS = 13
            a$ = impresora(loca%)
            EXIT DO
        CASE IS = 72: '--Subir
            IF loca% > 1 THEN
                loca% = loca% - 1
                GOSUB impridatos
            END IF
        CASE IS = 80: '--Bajar
            IF loca% < max% THEN
                loca% = loca% + 1
                GOSUB impridatos
            END IF
    END SELECT
LOOP
COLOR 7, 0
CLS
IF a$ <> "@" THEN
    SHELL _HIDE "cmd/c wmic printer where name='" + a$ + "' call setdefaultprinter"
    PRINT "Selected printer: "; a$
ELSE
    PRINT "The printer has not been modified"
END IF
END

impridatos:
y% = 1
FOR n% = loca% - 2 TO loca% + 2
    IF n% < 1 OR n% > max% THEN
        COLOR 1, 7: LOCATE y% + 10, 21: PRINT "                                        "
    ELSE
        IF n% = loca% THEN COLOR 15, 4 ELSE COLOR 1, 7
        LOCATE y% + 10, 21: PRINT "                                        "
        LOCATE y% + 10, 21: PRINT LEFT$(impresora(n%), 40)
    END IF
    y% = y% + 1
NEXT
RETURN


15
QB64 Discussion / select a printer?
« on: January 03, 2019, 03:35:06 pm »
Hi,
Is it possible to select a printer and change it to the default printer ?.
I would like to be able to select between several printers, before executing _PRINTIMAGE
Thanks

Pages: [1] 2