Page 1 of 1

Post your favorite SUBs here!

Posted: Sat Sep 03, 2005 1:04 pm
by Patz QuickBASIC Creations
The best, fastest, and most useful will be put into PQBC's latest project, ECLIPSE.

Posted: Sat Sep 03, 2005 3:51 pm
by Rattrapmax6
Should be SUBs and FUNCTIONs.... And is this QB or FB or both? Cause I have mountians of FB SUBs and FUNCTIONs I put into code,.. or at least I think,.. but half are probaly useless w/o the code,... :roll: :wink:

Posted: Sun Sep 04, 2005 1:18 pm
by Zamaster
My 2 favorite subs!

Code: Select all

DIM SHARED RCol%, GCol%, BCol%
SCREEN 13

SUB PutRGB(col%)
OUT &H3C8, col%
OUT &H3C9, RCol%
OUT &H3C9, GCol%
OUT &H3C9, BCol%
END SUB

SUB GetRGB(col%)
OUT &H3C7, col%
RCol% = INP(&H3C9)
GCol% = INP(&H3C9)
BCol% = INP(&H3C9)
END SUB
I use these puppies all the time!

Posted: Sun Sep 04, 2005 2:19 pm
by Deleter
I don't know why, but I really like this function...I know, its not a sub, but so what. 8)

Code: Select all

Function MathDistance (x1 as double, y1 as double, x2 as double, y2 as double) as double
    Return Sqr( ( x1 - x2 ) ^ 2 + ( y1 - y2 ) ^ 2 )
End function 

Posted: Sun Sep 04, 2005 6:07 pm
by {Nathan}
Hey... uhh... what the hell does that sub calculate?

Posted: Sun Sep 04, 2005 7:55 pm
by Deleter
thats distance formula. :D

Posted: Sun Sep 04, 2005 11:49 pm
by DrV
6" ham on wheat with pickles and black pepper.

(Sorry, couldn't resist :) )

Posted: Tue Sep 06, 2005 5:24 pm
by Deleter
DrV wrote:6" ham on wheat with pickles and black pepper.

(Sorry, couldn't resist :) )
lol :)

Posted: Tue Sep 06, 2005 5:33 pm
by Patz QuickBASIC Creations
Rattrapmax6 wrote:Should be SUBs and FUNCTIONs.... And is this QB or FB or both? Cause I have mountians of FB SUBs and FUNCTIONs I put into code,.. or at least I think,.. but half are probaly useless w/o the code,... :roll: :wink:
Sorry for not being more specific. It needs to be:
SCREEN 0 <--Sorry, graphics peps (see bottom of message)
SUBs or FUNCTIONS
QuickBasic 4.5 (I can't get my mouse to work on PDS! library's corrupt)
Mouse support is allowed for: Left button, right button, X-Position, Y-Position

And, please clearly label your program with name, "company", and date. Labeling your VARIABLES would probably help too.

:!: GRAPHICS PEOPLE :!: I need screen savers! Any and all are allowed, but if they are in FB, they need to be pre-compiled.

(Note to SEB: I have a cool MATRIX looking screensaver for QBinux :wink:)

Posted: Tue Sep 06, 2005 7:28 pm
by Rattrapmax6
PQBC wrote: :!: GRAPHICS PEOPLE :!: I need screen savers! Any and all are allowed, but if they are in FB, they need to be pre-compiled.
.scr or .exe? or both? In any case I have a cool 3D one made in FB (FBSVR.scr), and I'm sure Mitth will let you have some of his he has made, which are also cool,... I'll ask him,.. :wink:

Posted: Wed Sep 07, 2005 10:38 am
by Guest
*.exe is for ECLIPSE, but some .SCRs would be appreciated :P

Posted: Wed Sep 07, 2005 1:57 pm
by Rattrapmax6
Hmm... wait, what is project ECLIPSE? Is it a program, or your website you been planning?

:?:

Posted: Wed Sep 07, 2005 3:25 pm
by Patz QuickBASIC Creations
ECLIPSE is a TUI which, hopefully, will be able to support many different programs in a special compatibility mode. The only times it uses different screens then 0 is at the title screen and screensavers.

Re: Post your favorite SUBs here!

Posted: Mon Sep 12, 2005 11:40 am
by Nodtveidt
PQBC wrote:The best, fastest, and most useful will be put into PQBC's latest project, ECLIPSE.
Looking for people to do your work for you, eh? :lol:

Posted: Tue Sep 13, 2005 11:35 pm
by DrV
Just a quick note - Eclipse is also the name of a major Java IDE: www.eclipse.org

Some commonly useful procedures that came to mind:

Code: Select all

function intmax(a as integer, b as integer) as integer
  if a >= b then
    intmax = a
  else
    intmax = b
  end if
end function

function intmin(a as integer, b as integer) as integer
  if a >= b then
    intmin = b
  else
    intmin = a
  end if
end function

sub plotchar(char as integer, x as integer, y as integer, colr as integer)
  def seg = &HB800
  poke (y * 80 + x) * 2, char '' might have these swapped - mind fuzzy - can't remember :)
  poke (y * 80 + x) * 2 + 1, colr
end sub

Re: Post your favorite SUBs here!

Posted: Sat Sep 17, 2005 10:06 am
by Patz QuickBASIC Creations
Nekrophidius wrote:
PQBC wrote:The best, fastest, and most useful will be put into PQBC's latest project, ECLIPSE.
Looking for people to do your work for you, eh? :lol:
of course! I don't have any ideas. If I did, I could probably make SUBs/FUNCTIONs, but this is quicker and less strain on my little brain. :P