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

Pages: [1] 2 3 ... 5
1
QB64 Discussion / Re: Code fragment sought: user-specified file names
« on: December 21, 2021, 12:10:12 pm »
Thanks, both!  I did the seach, and found examples.  But SMcNeill's "easy" code fragment suits my needs fine.

Thanks again.

Malcolm

2
QB64 Discussion / Code fragment sought: user-specified file names
« on: December 21, 2021, 11:00:33 am »
A job for over the holiday is to adapt an old program of mine so that it can accept a data file.  Nothing fancy, just numbers, one per line.

Rather than hard-code the file name into the program (which is what I tended to do, back in the day), I'm looking to specify it at run-time, in a user dialogue.

Does anyone have a code fragment that they'd share, showing how to do this?  Or is it as simple as inputting a string, and then entering that string in an OPEN# statement?

Malcolm

3
QB64 Discussion / Re: I discovered this difference between QB and QB64
« on: October 09, 2021, 05:02:49 pm »
Runs here, too, in QB45 and PDS 7.1, although I haven't tried in QBasic, as that's not presently installed on this machine.

Malcolm

4
QB64 Discussion / Re: A Question on Sorting
« on: September 18, 2021, 06:40:03 pm »
I don't think the Bubble sort is good for any case except for ease of understanding of how it works.


Agreed.  But gosh, it's easy to use in real-world low-number scenarios.

Malcolm

5
QB64 Discussion / Ethan Winer: Basic Techniques and Utilities
« on: July 12, 2021, 12:32:42 pm »
I've just by chance discovered that Ethan Winer's marvellous Basic Techniques and Utilities, which I lovingly re-read many times in the early 1990s, has been released in a free 2019 digital edition.  (It's a 520-page free download.)

It's mostly QuickBASIC 4.5, with quite a bit of Microsoft Basic Professional Development System 7.1 thrown in, where there are differences between the two.

Here's the link: https://ethanwiner.com/BTU_BOOK.PDF

Malcolm

6
I think you're asking for a link for QuickBasic 4.5?  You'll also need vDosPlus to run it under.

My recommendation would be prove to yourself it works, and then port it to QB64 using the advice in this thread.  Much simpler than using DOS-era code under a DOS emulator!

I bought my copy of QuickBasic 4.5 back in 1989, but you'll probably find it on an abandonware site -- I'd try Vetusware first.

You can get vDosPlus here: http://vdosplus.org/

That said, I'd click through to the link to Ed Mendelson's download page, and download it from there.

Malcolm

7
Program runs fine under QuickBasic 4.5 in 64-bit Windows 10, and QuickBasic 4.5 is what it looks like it was written in.

When I say "runs fine", I mean that it gets past the line in question OK, and prints to my laser printer.

Obviously, I don't possess whatever the device is, and so can't check that aspect of things.

Malcolm

8
QB64 Discussion / Re: Multiple ANDs have tangled my brain...
« on: September 29, 2020, 05:00:54 pm »
Thanks again, folks.  Food for thought.

The vast majority of my numeric inputs get passed to a long-established subroutine that works like a charm, although I've recently had to tweak it to accept zero values as genuine.

Pure alphameric input in my programs is unusual, and in the original 1980s code, things worked.  (For reasons made clear here.)

There have been some useful suggestion in this thread, and with a couple of further programs on the stocks, I will be trying them out.  Call it the Covid-19 dividend: after many years of almost zero programming, there's something of a personal coding flurry underway at present!

Malcolm

9
QB64 Discussion / Re: Multiple ANDs have tangled my brain...
« on: September 28, 2020, 11:47:05 am »
Thanks, both.  Bplus, I now see the problem -- cheers.  And SS, that's a neat idea.

Malcolm

10
QB64 Discussion / Multiple ANDs have tangled my brain...
« on: September 28, 2020, 10:27:09 am »
I'm attempting to straighten out some 1980s code so as to eliminate a few GOTOs and make the whole thing a bit more linear.

The line below is supposed to check that an INPUTted string (text$) doesn't contain either an uppercase or lowercase 'Y' or 'N'.

Quote
IF (text$ <> "y" AND text$ <> "Y") AND (text$ <> "n" AND text$ <> "N") THEN linenumber = 20

Except that it doesn't: it fails heroically.

What have I done wrong?!  TIA.

Malcolm

 

11
QB64 Discussion / Re: Scientific or exponential notation remover
« on: September 15, 2020, 04:10:10 pm »
I'm sorry: "it's listed right" doesn't mean anything to me.  Where?

Malcolm

12
QB64 Discussion / Re: Scientific or exponential notation remover
« on: September 09, 2020, 06:00:08 pm »
Hi.

Where's the original post on this?  Happy to download the code and do some testing.

Malcolm

13
QB64 Discussion / Re: Problem with locate command
« on: August 28, 2020, 10:54:10 am »
I'd add that LOCATE has for me always been a difficult command in terms of code compatibility: different BASICs implement it in different ways.  I once ported some regularly-used statistics calculations over to Liberty BASIC, in the days before QB64 (or at least, before I discovered QB64).

Liberty BASIC implements LOCATE the other way round -- ie, not LOCATE x, y but instead LOCATE y, x...!  Which to me is crazy.  When I gave up on Liberty BASIC (I felt ripped off on licensing too, which didn't help), I had to convert everything back.

So use LOCATE with caution, is my advice.

Malcolm


14
QB64 Discussion / Re: Reading data from data files
« on: May 29, 2020, 05:44:41 am »
This may be a place to begin. In this section of my tutorial I outline file input/output and drive navigation.

http://qb64sourcecode.com/task13.html

Thanks, Terry.  That was very useful.  I didn't know about some of those new QB64 commands.

Malcolm

15
QB64 Discussion / Re: Reading data from data files
« on: May 27, 2020, 05:18:24 pm »
I'm not sure if there is also an example in the tutorial with the INPUT$ function, this is the right function, that definitely works properly for reading binary files in both QB 4.5 and QB64.

That's useful, as I had explicitly ruled out INPUT$ in favor of LINE INPUT. Looks like I need to do more reading!

Malcolm

Pages: [1] 2 3 ... 5