QB64 Phoenix Edition
LSTYLES.BAS - Printable Version

+- QB64 Phoenix Edition (https://staging.qb64phoenix.com)
+-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3)
+---- Forum: Programs (https://staging.qb64phoenix.com/forumdisplay.php?fid=7)
+---- Thread: LSTYLES.BAS (/showthread.php?tid=256)



LSTYLES.BAS - TarotRedhand - 04-28-2022

Here's a little something I wrote and posted on FidoNet back in 1997. It's just an illustration of some of the styles of line that you can have when you use the LINE command. If nothing else grab one or more of the included constants at the top of the code. When run you will get a small window that shows the linestyles (maybe too small for anything larger than full HD).


Code: (Select All)
'===========================================================================
' Subject: DIFFERENT LINE STYLES              Date: 12-22-97 (12:06)
'  Author: TarotRedhand                      Code: QB
'===========================================================================
'Just for a change I am posting a small program that illustrates what
'is probably an underused parameter of a well known command, LINE.  If
'you check out either the manual or the help system, you will see that
'the final (optional) parameter that can be passed to the LINE
'statement is one called linestyle.  In order to show what this
'parameter can produce when properly used here are 13 (12a? <g>)
'constants, for you to use, that are part of the following small
'program.

CONST DenseDotted% = &HAAAA            '| "- - - - - - - - "
CONST MediumDotted% = &H8888          '| "-  -  -  -  "
CONST SparseDotted% = &H8080          '| "-      -      "
CONST OneDot% = &H80                  '| "        -      "
CONST LongDash% = &HFFFC              '| "--------------  "
CONST MediumDash% = &HFCFC            '| "------  ------  "
CONST ShortDash% = &HDDDD              '| "--- --- --- --- "
CONST WideGapped% = &HF0F0            '| "----    ----    "
CONST SparseDash% = &HCCCC            '| "--  --  --  --  "
CONST LongShort% = &HFDBF              '| "------ -- ------"
CONST DashDot% = &HFAFA                '| "----- - ----- - "
CONST DotDashDot% = &H9FE4            '| "-  --------  -  "
CONST SixThreeOne% = &HFCE4            '| "------  ---  -  "

SCREEN 1
COLOR 8, 1
MyY% = 7
Gap% = 14
MyColour% = 3
X1% = 15
X2% = 302
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , DenseDotted%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , MediumDotted%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , SparseDotted%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , OneDot%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , LongDash%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , MediumDash%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , ShortDash%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , WideGapped%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , SparseDash%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , LongShort%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , DashDot%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , DotDashDot%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , SixThreeOne%
Q$ = INPUT$(1)
END

Enjoy.

TR


RE: LSTYLES.BAS - Keybone - 05-06-2022

(04-28-2022, 12:09 AM)TarotRedhand Wrote: Here's a little something I wrote and posted on FidoNet back in 1997. It's just an illustration of some of the styles of line that you can have when you use the LINE command. If nothing else grab one or more of the included constants at the top of the code. When run you will get a small window that shows the linestyles (maybe too small for anything larger than full HD).


Code: (Select All)
'===========================================================================
' Subject: DIFFERENT LINE STYLES              Date: 12-22-97 (12:06)
'  Author: TarotRedhand                      Code: QB
'===========================================================================
'Just for a change I am posting a small program that illustrates what
'is probably an underused parameter of a well known command, LINE.  If
'you check out either the manual or the help system, you will see that
'the final (optional) parameter that can be passed to the LINE
'statement is one called linestyle.  In order to show what this
'parameter can produce when properly used here are 13 (12a? <g>)
'constants, for you to use, that are part of the following small
'program.

CONST DenseDotted% = &HAAAA            '| "- - - - - - - - "
CONST MediumDotted% = &H8888          '| "-  -  -  -  "
CONST SparseDotted% = &H8080          '| "-      -      "
CONST OneDot% = &H80                  '| "        -      "
CONST LongDash% = &HFFFC              '| "--------------  "
CONST MediumDash% = &HFCFC            '| "------  ------  "
CONST ShortDash% = &HDDDD              '| "--- --- --- --- "
CONST WideGapped% = &HF0F0            '| "----    ----    "
CONST SparseDash% = &HCCCC            '| "--  --  --  --  "
CONST LongShort% = &HFDBF              '| "------ -- ------"
CONST DashDot% = &HFAFA                '| "----- - ----- - "
CONST DotDashDot% = &H9FE4            '| "-  --------  -  "
CONST SixThreeOne% = &HFCE4            '| "------  ---  -  "

SCREEN 1
COLOR 8, 1
MyY% = 7
Gap% = 14
MyColour% = 3
X1% = 15
X2% = 302
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , DenseDotted%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , MediumDotted%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , SparseDotted%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , OneDot%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , LongDash%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , MediumDash%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , ShortDash%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , WideGapped%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , SparseDash%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , LongShort%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , DashDot%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , DotDashDot%
MyY% = MyY% + Gap%
LINE (X1%, MyY%)-(X2%, MyY%), MyColour%, , SixThreeOne%
Q$ = INPUT$(1)
END

Enjoy.

TR

Wow. thats cool. I totally forgot that LINE had that option.
Thats not something you see used everyday.


RE: LSTYLES.BAS - Dav - 05-06-2022

This brings back memories - the reason I got online was to read the fidonet QB echo (via BBS first), and to download the ABC code packets which contained snippets like these.

Thanks for the code and reminder of the great LINE parameters that are great and so underused.

- Dav


RE: LSTYLES.BAS - TarotRedhand - 05-08-2022

Thanks guys. @Dav, did you post any code to FidoNet?

TR


RE: LSTYLES.BAS - Dav - 05-08-2022

I don’t think so, I mostly just lurked and learned back then.

- Dav


RE: LSTYLES.BAS - James D Jarvis - 05-14-2022

Thanks for posting this. I was playing with line styles and had an accidental discovery due to a poorly thought out algorithm that produced more interesting borders than I though it would:  
Boxing accident (qb64phoenix.com)