Post your favorite SUBs here!

Discuss whatever you want here--both QB and non-QB related. Anything from the DEF INT command to the meaning of life!

Moderators: Pete, Mods

Post Reply
User avatar
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post your favorite SUBs here!

Post by Patz QuickBASIC Creations » Sat Sep 03, 2005 1:04 pm

The best, fastest, and most useful will be put into PQBC's latest project, ECLIPSE.

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Sat Sep 03, 2005 3:51 pm

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:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

User avatar
Zamaster
Veteran
Posts: 174
Joined: Wed Jun 15, 2005 1:51 pm
Contact:

Post by Zamaster » Sun Sep 04, 2005 1:18 pm

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!
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN

User avatar
Deleter
Veteran
Posts: 119
Joined: Sat May 07, 2005 7:31 pm

Post by Deleter » Sun Sep 04, 2005 2:19 pm

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 

User avatar
{Nathan}
Veteran
Posts: 1169
Joined: Thu Aug 19, 2004 6:08 pm
Location: The wetlands of central Ohio, USA
Contact:

Post by {Nathan} » Sun Sep 04, 2005 6:07 pm

Hey... uhh... what the hell does that sub calculate?
Image

User avatar
Deleter
Veteran
Posts: 119
Joined: Sat May 07, 2005 7:31 pm

Post by Deleter » Sun Sep 04, 2005 7:55 pm

thats distance formula. :D

DrV
Veteran
Posts: 63
Joined: Thu Jun 02, 2005 9:44 pm

Post by DrV » Sun Sep 04, 2005 11:49 pm

6" ham on wheat with pickles and black pepper.

(Sorry, couldn't resist :) )

User avatar
Deleter
Veteran
Posts: 119
Joined: Sat May 07, 2005 7:31 pm

Post by Deleter » Tue Sep 06, 2005 5:24 pm

DrV wrote:6" ham on wheat with pickles and black pepper.

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

User avatar
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post by Patz QuickBASIC Creations » Tue Sep 06, 2005 5:33 pm

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:)

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Tue Sep 06, 2005 7:28 pm

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:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

Guest

Post by Guest » Wed Sep 07, 2005 10:38 am

*.exe is for ECLIPSE, but some .SCRs would be appreciated :P

User avatar
Rattrapmax6
Veteran
Posts: 1055
Joined: Sun Jan 02, 2005 2:11 pm
Location: At my computer
Contact:

Post by Rattrapmax6 » Wed Sep 07, 2005 1:57 pm

Hmm... wait, what is project ECLIPSE? Is it a program, or your website you been planning?

:?:
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)

User avatar
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Post by Patz QuickBASIC Creations » Wed Sep 07, 2005 3:25 pm

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.

User avatar
Nodtveidt
Veteran
Posts: 826
Joined: Sun Jul 25, 2004 4:24 am
Location: Quebradillas, PR
Contact:

Re: Post your favorite SUBs here!

Post by Nodtveidt » Mon Sep 12, 2005 11:40 am

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:

DrV
Veteran
Posts: 63
Joined: Thu Jun 02, 2005 9:44 pm

Post by DrV » Tue Sep 13, 2005 11:35 pm

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

User avatar
Patz QuickBASIC Creations
Veteran
Posts: 399
Joined: Wed Mar 02, 2005 9:01 pm
Location: Nashville, Tennessee
Contact:

Re: Post your favorite SUBs here!

Post by Patz QuickBASIC Creations » Sat Sep 17, 2005 10:06 am

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

Post Reply