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.


Messages - bugmagnet

Pages: [1]
1
QB64 Discussion / Teaching people to program in QB64?
« on: September 23, 2019, 11:15:18 pm »
I'm learning a few languages over on exercism.io. I imagine QB64 could be one of them. Some suitably motivated individuals could be maintainers and mentors. There might be folk who just want to contribute somehow.

It bugs me that QB64 isn't represented. Mind you it also bugs me that COBOL and Fortran aren't represented as well.

2
QB64 Discussion / Re: Compile to C?
« on: August 19, 2019, 04:59:53 am »
Decidedly unpretty. But that's usually the case with machine generated code.

3
QB64 Discussion / Compile to C?
« on: August 19, 2019, 02:34:59 am »
So I put QB64 on the PATH. I did a CD \tmp. I typed qb64 -? and got the help text. So then i tried to compile a local file to C. What I got is below. It was weird: I had to be specific about the path even though the source file was in the directory I was invoking from. And to cap it off, I couldn't find any C code anywhere.

Does "-z" actually work?

Interestingly, if you want to run the IDE with a file from the command line, you also need to put in the full path.
Code: QB64: [Select]
  1. C:\TMP>dir hello.bas
  2.  Volume in drive C is OS
  3.  Volume Serial Number is 2652-D365
  4.  
  5.  Directory of C:\TMP
  6.  
  7. 08/05/2019  10:41 PM               539 hello.bas
  8.               1 File(s)            539 bytes
  9.               0 Dir(s)  122,409,455,616 bytes free
  10.  
  11. C:\TMP>qb64 -z hello.bas
  12. QB64 COMPILER V1.3
  13.  
  14. CANNOT LOCATE SOURCE FILE:hello.bas
  15.  
  16. C:\TMP>qb64 -z .\hello.bas
  17. QB64 COMPILER V1.3
  18.  
  19. CANNOT LOCATE SOURCE FILE:.\hello.bas
  20.  
  21. C:\TMP>qb64 -z c:\tmp\hello.bas
  22. QB64 COMPILER V1.3
  23.  

4
QB64 Discussion / Re: String array size
« on: August 10, 2019, 09:59:16 am »
Works as advertised. Thanks very much.

5
QB64 Discussion / Library code?
« on: August 09, 2019, 10:03:39 am »
Is anyone gathering library code that might get put in a kind of "stdlib.bi" or equivalent?

I was building a binary search today based on a Wikipedia article and wondered if anyone else needed it.

-- bugmagnet

6
QB64 Discussion / String array size
« on: August 09, 2019, 09:55:23 am »
Is there a limit to how large a string array can be? Or is my problem just due to the way in which I am loading the array?

I'm using QB64 on Linux, specifically Linux version 4.15.0-55-generic (buildd@lcy01-amd64-029) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #60-Ubuntu

Code: QB64: [Select]
  1. '$DYNAMIC
  2.  
  3. DIM words(1 TO 1000) AS STRING
  4. DIM wordCount AS INTEGER
  5. DIM newBound AS INTEGER
  6. DIM inputFile AS STRING
  7.  
  8. inputFile = COMMAND$(1)
  9. IF inputFile = "" THEN inputFile = "wordlist.txt"
  10.  
  11. wordCount = 1
  12. OPEN inputFile FOR INPUT AS #1
  13.     LINE INPUT #1, word
  14.     words(wordCount) = UCASE$(word)
  15.     wordCount = wordCount + 1
  16.     IF wordCount > FIX(UBOUND(words) - (UBOUND(words) / 10)) THEN
  17.         newBound = UBOUND(words) * 2
  18.         REDIM _PRESERVE words(1 TO newBound)
  19.     END IF
  20.  
  21. PRINT wordCount - 1; "words loaded"

I downloaded the large words.txt from https://github.com/dwyl/english-words and attempted to load that into memory as per the above. It crashed with a core dump.

-- bugmagnet

Pages: [1]