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

Pages: 1 [2] 3
16
QB64 Discussion / Re: Anyone using LPRINT in QB64?
« on: February 11, 2021, 12:27:11 pm »
Thanks Pete and Steve.

I don't use _PRINTIMAGE as I am not printing what's on my screen, just text pulled from relational databases for background printing whilst I get on with more data inputting (I compile results for running races etc. so need to able to continue data entry on a different screen whilst pages are starting to print out)

Pete, yes I'd already got that rtf stuff set up but it would only open and write the document, not print it. It was only when looking at your example that I realised I didn't have the space after the /p switch and before my file name started, so that's why it wasn't printing. I'd never have noticed that without your example code! The smallest things eh?

Cheers

17
QB64 Discussion / Re: Anyone using LPRINT in QB64?
« on: February 11, 2021, 11:41:45 am »
I don't use LPRINT any more either. I can generate a perfect rtf file in my QB64 program for printing - just after a short cut to print multiple copies, which was easy back in the days of QuickBasic by just sending the right sequence of escape codes to the printer! Don't want to start learning PCL at my age ... :-)

18
QB64 Discussion / Re: Anyone using LPRINT in QB64?
« on: February 11, 2021, 07:55:24 am »
Hi

Thanks for the reminder of wordpad switches, which I'll include in my QB64 program.

Is there any additional switch, or maybe a QB64 command, which would run this "silently" i.e. just to print without bringing Wordpad up on screen?

Also, is there a switch which might instruct how many copies to print? Don't want to have to run the switch command in a loop (say) 20 times to print 20 copies.

Not a problem if it's not possible. I can always go into the rtf doc and print multiple copies via Windows - would just be handy to be able to send this command at the initial print instruction.

Thanks in advance.

19
QB64 Discussion / Re: find last record in a random file
« on: October 01, 2020, 01:26:57 pm »
ok thanks Petr. Looks like I'd have my work cut out and have to think a bit differently!

I don't think I'll be able to change what I already have as the program is about 8000 lines long, and here's a lot of file access throughout it, but it's certainly worth bearing in mind for some later stuff.

Cheers

20
QB64 Discussion / Re: find last record in a random file
« on: October 01, 2020, 07:04:32 am »
Hi

Thanks for the replies. I only work with text data, so images and such like I don't need to worry about. I'm compiling times for runners at races, so need to store certain brief details about them, pared down to the minimum I need for any event. Each race has it's own set of files (there are 6 files, which combine into effectively a relational database) but I'll just touch on a couple here).

First, I suppose this is the equivalent of your header, I have a very small text file with data like this storing details of the event:
143,"Podium Sub-30.00 10k, Barrowford","19th September 2020","998",21
143 shows the number of entries, then it's the name and date of the race, 998 is the number of club names stored (a separate file to look up by reference) and 21 is the number of finish times recorded, so if there had been 40 finishers, 21 would be replaced by 40. I open this file briefly (sequential read, as always in the same order) after selecting the event, to read in those variables for use in the main program. They are updated during operation and then written back to that file when I have finished with the data, with any changes reflected.

Next is the main runner data, for example:
1   Callum Smith        MS 606                 2   Mohd Ahmed          MS 452   29.114        3   Emile France        MS 79    28.461        4   Graham White        MS 79    29.437       
All of these are fixed length fields:
Runner number (4 characters), name (20 characters), category (3 characters). club number (3 characters), time (8 characters), position (4 characters), free text field (5 characters) to set any markers realting to sub-events or simply to flag up certain things like local runners.

Time remains blank if no time recorded

There are some other files with additional data (all effectively keyed on the race number) but if I can see how to read and write to the main data file then the same principles will apply to the other files.

I never have races over about 3000, so there are never massive amounts of data to be manipulating. I generally copy info from the random access files into arrays for sorting, and use temporary files as well, so apart from record sorting to store in numerical order during data entry, the files don't change much.

Sorting etc. only takes fractions of a second, so this is probably a bit of a theoretical exercise for me, rather than something I might actually change over to, but it would be interesting to see how it might work in practice.

Am I correct in assuming that there wouldn't be much change in the actual file structure for the main, as each record would need to remain a fixed length so as to access it accurately, or would binary files enable me to have flexibility in field length?

Thanks again for your input.


21
QB64 Discussion / Re: find last record in a random file
« on: September 30, 2020, 07:30:13 pm »
Am confused as to what benefits Binary has over Random where you have defined field sizes in records.

Is it quicker to access or sort, more efficient for memory etc.?

How backwards compatible will it be with QB45 programs (believe it or not I still have some laptops using XP 32 bit)

Would you be OK for me to post some code samples showing how I currently store data for my programs then you can advise how Binary might be better?

Cheers

22
QB64 Discussion / Re: Basics of QB64 - Looping around
« on: September 08, 2020, 07:20:04 am »
Thanks Fellippe. Good to know about _Continue! Could prove useful.

23
QB64 Discussion / Re: Basics of QB64 - Using fonts
« on: August 26, 2020, 11:54:44 am »
ok thanks Fellippe.

24
QB64 Discussion / Re: Basics of QB64 - Using fonts
« on: August 25, 2020, 08:00:59 pm »
Is there a rule of thumb to follow when trying to find a font which looks OK when scaled up?

I have had a look at the fonts website suggested by Fellippe and some of the 8x8 fonts actually make the window look smaller than the default on my windows pc, while some of the other fonts look very scrappy when enlarged.

I assume you should try to use multiples of the pixel height to scale them up, but would other scales also work. For example,  if you have an 8 pixel high font, should you stick to 8, 16, 24 etc. Or would 12 and 20 also work?

Also had a look at the built in Windows fonts but not spotted anything which looks OK in dos yet! So you know, I only work in 5ext mode, not graphic.

I know you will just say experiment 😏 🙂!!

25
QB64 Discussion / Re: vWatch64
« on: August 24, 2020, 07:35:15 pm »
Thanks. Marked as safe programs now in malwarebytes so should be OK now  -)

26
QB64 Discussion / vWatch64
« on: August 24, 2020, 01:26:37 pm »
hi Fellippe

I had a quick look at your vwatch program from your repository.

Malwarebytes viewed it as ransomware and quarantined it when I ran your try-me progam in it! :-(

Very odd!!

27
QB64 Discussion / Re: Basics of QB64 - Using fonts
« on: August 24, 2020, 08:00:06 am »
Thanks for this tutorial - much appreciated.

I was struggling with a very small window size on my Win10 pcs, while running my dos program in text mode.

This should help my eyesight!!

28
I use the old school method of opening the .bas code up in Wordpad and printing what I need from there.

It was certainly useful for me in QB45 to be able to highlight a section of code with the mouse and then use the "print selected text" option, but the wordpad method works fairly well for me anywway.

29
QB64 Discussion / Re: adding/subtracting times
« on: August 05, 2020, 11:20:45 am »
Hi guys

Thanks for all your input. All very helpful.

To clarify, the time in the reader I am accessing is stored as a full time of day with the date and then the time, with seconds to 2 decimal places, stored in a string like this:
15/03/2020 10:53:04.77

I've managed now to strip out the times, and worked out a small subroutine which slices the time up into variables for hours, minutes and seconds, then converts that all to seconds, so I can subtract one decimal number of seconds from another, and then I can convert the result back to a string (rounded up to whole seconds in that final conversion).

I can't use TIMER as I'm not accessing times on my pc - just on an external reader.

Grateful for all your very useful responses and snippets of code.

John

30
QB64 Discussion / Re: adding/subtracting times
« on: July 27, 2020, 04:39:12 am »
Many thanks

I'm trying to keep it within QB64 for various reasons, but I'll certainly have a close look at this

Regards

John

Pages: 1 [2] 3