|
Post by donjohn24 on Oct 30, 2022 0:49:25 GMT
I can't find the syntax for setting print size when using lprint. I would like my text a bit bigger when I print the Quiz results. And if I could print to Landscape that would be wonderful!
|
|
|
Post by plus on Oct 30, 2022 3:05:51 GMT
If you save the text into a file, you can use a Word Processor to print it out. They usually have more bells and whistles for printing.
|
|
|
Post by donjohn24 on Oct 30, 2022 11:00:27 GMT
Thanks, plus - I may use that later, to provide a file for the Quiz controller to give to participants. But for now I found PRINTERDIALOG which enables me to set for Landscape printing, and the text is then quite readable. I can't really use a larger text as I need to get 20 columns of figures across landscape A4. Perhaps I should search more thoroughly before posting
|
|
|
Post by plus on Oct 30, 2022 13:55:34 GMT
Oh, is PrinterDialog one of things that comes in JB package? That might be convenient.
|
|
|
Post by donjohn24 on Oct 30, 2022 16:01:00 GMT
Oh, is PrinterDialog one of things that comes in JB package? That might be convenient. Indeed it is, and I couldn't believe how easy it was to to use - just a program line containing the word Printerdialog. I've used it for outputting the scores in my Quiz Program - which I've attached if you want to take a look, and also added your suggestion to create a file version which could be emailed to participants. I've included QUIZ.DAT which saves having to enter test data when it is initially Loaded. If you do take a look, any comments would be welcomed as I might offer it as a free program here. I've also added some screen pics on my website page www.donjohnson24.co.uk/quiz.htmlCheers, Don Attachments:Quiz.bas (76.11 KB)
QUIZ.DAT (1.14 KB)
|
|
|
Post by plus on Oct 30, 2022 16:17:51 GMT
Thanks Don, I will check it out later, right now I am hunting a tiger of a translation challenge.
|
|
|
Post by tsh73 on Oct 30, 2022 20:37:53 GMT
There is a "printer font" menu item under Setup You can change font size where.
And it is written to justbasic2.ini - in my case it's second line,
printfont courier_new 9 bold italic
I believe if you include copy of justbasic2.ini with your program (in program folder), settings will work in your EXE (at least it works with "Setup\Editor Font", which works as font for a mainwin)
|
|
|
Post by plus on Oct 30, 2022 23:00:05 GMT
OK checked out DAT and bas code file looks like a huge effort went into putting this code together! When I see pages and pages of code like this (see attached), I wonder if arrays might be used. We did have a discussion on using Control array variables, kind of tricky when and when not to add the # as I recall. But me thinks you code effort might have been greatly eased by use of array like variables. BTW looking at DAT file had me scratching my head when every Round was same as Team? Maybe just some test code... Attachments:
|
|
|
Post by donjohn24 on Oct 30, 2022 23:45:17 GMT
OK checked out DAT and bas code file looks like a huge effort went into putting this code together! When I see pages and pages of code like this (see attached), I wonder if arrays might be used. We did have a discussion on using Control array variables, kind of tricky when and when not to add the # as I recall. But me thinks you code effort might have been greatly eased by use of array like variables. BTW looking at DAT file had me scratching my head when every Round was same as Team? Maybe just some test code... My natural inclination would be to use arrays in some way, but the only way I could find to show data on a graphic display was to use statements like statictext #dscr.tb1, " ", w * 5, h * 12, w * 4, 4 * h statictext #dscr.tb2, "", w * 5, h * 16, w * 4, 4 * h etc to set screen locations, but I could only put array contents into these specific locations using the appropriate specific array content print #dscr.tb1, rdscor(1,1) print #dscr.tb2, rdscor(1,2) etc I could not see how to do this as one can for printing or sending to a file, where one can use - for example: for i = 1 to 16 lprint using("####",i); lprint " "; for j = 1 to 16 lprint using("####",rdscor(i,j)); lprint " "; next j lprint " "; lprint using("#####",ttscor(i)); lprint " "; lprint using("###",rank(i,1)); lprint " "; lprint using("###",i); lprint next i Perhaps there is another way to work with graphic screens, but I haven't found it. and, yes, it is a pain having to create repeated blocks of code that require lots of changing one or two digits or characters in each line The content in QUIZ.DAT is just test data, but there are Rounds 1 to 16 and Teams 1 to 16
|
|
|
Post by donjohn24 on Oct 30, 2022 23:49:35 GMT
There is a "printer font" menu item under Setup You can change font size where. And it is written to justbasic2.ini - in my case it's second line, printfont courier_new 9 bold italic I believe if you include copy of justbasic2.ini with your program (in program folder), settings will work in your EXE (at least it works with "Setup\Editor Font", which works as font for a mainwin) Thanks for the heads up, which will prove useful. However for my 20 columns I will probably have to stick with my default printfont courier_new 10 to get them all in
|
|
|
Post by xxgeek on Oct 31, 2022 1:23:26 GMT
I love cundo's jbsearch for searching the help files with keywords. Found this with keyword lprint - page had a link to PRINTERDIALOG which had a link to PrinterFont$
For future readers.....straight from the JB help files using a home built search engine written by cundo. jbsearch.bas Also, if you're using lprint you'll want to look into the DUMP command as well.
PrinterFont$ PrinterFont$ = fontSpec
Description: Just BASIC lets you set the font used for LPRINTing text to the printer. The format used for specifying the font is the same as for specifying the font in a graphics window. See also How to Specify Fonts, LPRINT.
'set a courier 10 italic font PrinterFont$ = "courier_new 10 italic"
The last font set before a page is printed is used for all the text on that page.
Usage: 'show the current printer font$ print PrinterFont$ lprint "This text will appear in "; PrinterFont$ dump
'set a courier 10 italic font PrinterFont$ = "courier_new 10 italic" lprint "This text will appear in "; PrinterFont$ dump
|
|
|
Post by tsh73 on Oct 31, 2022 5:37:33 GMT
Something new every day ,)
|
|
|
Post by donjohn24 on Oct 31, 2022 15:44:49 GMT
I love cundo's jbsearch for searching the help files with keywords. Found this with keyword lprint - page had a link to PRINTERDIALOG which had a link to PrinterFont$ For future readers.....straight from the JB help files using a home built search engine written by cundo. jbsearch.bas Also, if you're using lprint you'll want to look into the DUMP command as well. PrinterFont$ PrinterFont$ = fontSpec Description: Just BASIC lets you set the font used for LPRINTing text to the printer. The format used for specifying the font is the same as for specifying the font in a graphics window. See also How to Specify Fonts, LPRINT. 'set a courier 10 italic font PrinterFont$ = "courier_new 10 italic" The last font set before a page is printed is used for all the text on that page. Usage: 'show the current printer font$ print PrinterFont$ lprint "This text will appear in "; PrinterFont$ dump 'set a courier 10 italic font PrinterFont$ = "courier_new 10 italic" lprint "This text will appear in "; PrinterFont$ dump Interesting that PrinterFont$ does not show in cundo's jbsearch Contents list, and when searched for, indicates a reference is contained in Printerdialog. Similarly PrinterFont$ does not show in JB's Help Keyword list, but does show in Command Reference N - P. If I had looked more closely when guided to Printerdialog, or looked in Command Reference, I would have spotted the references to PrinterFont$, but I didn't so had to get more help. Anyway, I managed to get up to 12 point for my printout, using PrinterFont$ and a bit of respacing of columns, so thanks, everyone.
|
|
|
Post by xxgeek on Oct 31, 2022 21:26:10 GMT
Yes, I noticed that too while searching. It should pick up PrinterFont$ with as little as pri for a keyword. At first i thought my edits were the culprit, but cundo's original code does the same thing. I've been reading the code to figure out how and when a file is checked for a keyword to see if an adjustment needs made. cundo didn't use the "files" command to get all files in the help folder and then parse each one, so I'll need to figure out his/her method. It may take me a bit of time, but I want to get to the bottom of this and fix it.
I'm wondering how many other help searches are affected by this problem.
I'll post back if/when I get this straightened out.
Thanks for bringing this up donjohn24, and I'm glad you weren't discouraged to ask when you need help. When I post about using jbsearch it is to help, not discourage, those who ask for help. Back in "the day" if the answer was in a help file all we ever got from asking was RTFM............remember those days?
Need some help.......always ask, and remember - posting your problem code helps the helper. Unless of course you're like me and enjoy the torture and frustration of reading code and experimenting.
|
|
|
Post by donjohn24 on Oct 31, 2022 23:46:21 GMT
RTFM always amused me, as from 1962 for about ten years I was a Technical Author, writing manuals on electronic equipment, so if anyone ought to follow that dictum, it was me. The highlight of that short career occurred in later years when, on a ski trip flight, I was allowed to visit the cockpit of a Comet, and spotted the Control Box for the Cossor SSR 1600, and was able to brag 'I wrote the manual for the transponder installed in this aircraft'. BTW, my first flight, on a school holiday in 1954, was in a Dakota!
|
|