Author |
Topic: Font selection dialogue (Read 2121 times) |
|
admin
Administrator
member is offline


Posts: 1145
|
 |
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.
|
|
Logged
|
|
|
|
Nick
New Member
member is offline


Gender: 
Posts: 33
|
 |
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
|
|
Logged
|
|
|
|
|