BBC BASIC for Windows
« Font selection dialogue »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 11:13pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Font selection dialogue  (Read 2113 times)
admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Font selection dialogue
« Reply #7 on: Sep 4th, 2011, 2:46pm »

on Sep 4th, 2011, 1:26pm, Nick wrote:
Almost certainly! But if that is the case, I would be grateful to know why the 'incorrectness' does not manifest itself in the SAME way in authoring and runtime...?

You are not permitted to split a DATA statement between multiple lines using the line continuation character '\'. This is explicitly stated in the documentation:

Quote:
You can use the line continuation character almost anywhere that a space would be allowed, but not:
  • within a quoted (constant) string
  • in a star command (use OSCLI instead)
  • in a REM statement
  • in a DATA statement
  • immediately after the initial keyword of a statement

I am surprised that you didn't receive an error message, but it is absolutely not compatible with compiling/crunching.

Anyway, I can hardly think of a more horrible thing than initialising a LOGFONT structure from a load of constants in a DATA statement! This is how I would do it:

Code:
      DIM logfont{lfHeight%, lfWidth%, lfEscapement%, lfOrientation%, lfWeight%, \
      \      lfItalic&, lfUnderline&, lfStrikeOut&, lfCharSet&, lfOutPrecision&, \
      \      lfClipPrecision&, lfQuality&, lfPitchAndFamily&, lfFaceName&(31)}
      logfont.lfHeight% = -29
      logfont.lfWeight% = FW_NORMAL
      logfont.lfOutPrecision& = OUT_STROKE_PRECIS
      logfont.lfClipPrecision& = CLIP_STROKE_PRECIS
      logfont.lfQuality& = DRAFT_QUALITY
      logfont.lfPitchAndFamily& = FF_SWISS OR VARIABLE_PITCH
      logfont.lfFaceName&() = "Microsoft Sans Serif" 

That actually conveys some meaning!

Richard.
User IP Logged

Nick
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 33
xx Re: Font selection dialogue
« Reply #8 on: Sep 4th, 2011, 5:53pm »

on Sep 4th, 2011, 2:46pm, Richard Russell wrote:
You are not permitted to split a DATA statement between multiple lines using the line continuation character '\'. This is explicitly stated in the documentation:


Yet again, "RTFM!"....thanks.

Quote:
Anyway, I can hardly think of a more horrible thing than initialising a LOGFONT structure from a load of constants in a DATA statement!


Also very much agreed!

(I did REM to myself; "This is a really dumb way to do it, but time is pressing..."). But it was part of my learning curve - I intended to come back and do redo that bit - at least for now, I could be sure of the values being passed.

Remember, I am not used to this level of access to variables - it is truly amazing. (The last time I got deeply involved using BBC Basic was 25 years ago!)

I am still gtting my head (back) around the different indirection operators. I wanted to get the functionality (vaguely) right before coming back to make things more orthodox!

This now works perfectly - thank you so much.

Nick
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls