Post your favorite SUBs here!
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
Post your favorite SUBs here!
The best, fastest, and most useful will be put into PQBC's latest project, ECLIPSE.
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
My 2 favorite subs!
I use these puppies all the time!
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
C:\DOS
C:\DOS\RUN
RUN\DOS\RUN
C:\DOS\RUN
RUN\DOS\RUN
I don't know why, but I really like this function...I know, its not a sub, but so what.
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
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
Sorry for not being more specific. It needs to be: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,...
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 )
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
.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,..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.
-Kevin (aka:Rattra)
(x.t.r.GRAPHICS)
(x.t.r.GRAPHICS)
-
- Veteran
- Posts: 1055
- Joined: Sun Jan 02, 2005 2:11 pm
- Location: At my computer
- Contact:
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
Re: Post your favorite SUBs here!
Looking for people to do your work for you, eh?PQBC wrote:The best, fastest, and most useful will be put into PQBC's latest project, ECLIPSE.
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:
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
-
- Veteran
- Posts: 399
- Joined: Wed Mar 02, 2005 9:01 pm
- Location: Nashville, Tennessee
- Contact:
Re: Post your favorite SUBs here!
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.Nekrophidius wrote:Looking for people to do your work for you, eh?PQBC wrote:The best, fastest, and most useful will be put into PQBC's latest project, ECLIPSE.