FireBASIC
« New commands »

Welcome Guest. Please Login or Register.
Nov 22nd, 2009, 2:45pm




Pages: 1  Reply Notify Send Topic Print
 thread  Author  Topic: New commands  (Read 68 times)
SS
Administrator
ImageImageImageImageImage

member is offline

Avatar




Homepage PM


Posts: 113
xx New commands
« Thread started on: Jan 17th, 2008, 9:47pm »
Quote

Hi everyone,

I am having this short contest because I only got a limited amount of commands to add to my program. This one, You can submit the command in, then explain about it and if you want, you can give me a code in lb, or vbscript to enter in for it to be submited. The Prize is still the same, but I dont know about GameBASIC.
User IP Logged

A.H - Confuzed
FireBASIC Devloper

member is offline

Avatar




PM


Posts: 33
xx Re: New commands
« Reply #1 on: Jan 18th, 2008, 07:29am »
Quote

Here is some commands for ya, and there code, you may have to edit it to work but I think BPL and FB has similar variables!

gosub command:

LB Code:
Code:
case "gosub"
#main.t "!lines numlines"
    For w = 1 to numlines
        #main.t "!line ";w;" ed1$"
        if wd = 1 then ed1$ = hand$ 
        ed$ = word$(ed1$, 1)
        if ed$ = word$(s$, 2) then i=w
        next
 


Code to use in FB:

Code:
gosub {sub}
 


The variable names are totally random so change them to what you want!

For..Next Loop

LB Code
Code:
case "for"
loopnum$ = word$(s$, 2)
loopnum = val(loopnum$)
loopto = i

case "next"
f=f+1
if f = loopnum then
goto [for]
else
i=loopto
end if
[for]
 


FB code:

Code:
for 10
....commands here....
next
 


In this case it would loop 10 times

!When command

LB Code:

Code:
case "!when"
when$=word$(s$, 2)
sub$=word$(s$, 3)
select case when$
case "left_button_down"'    - the left mouse button has been pressed
print #win, "when leftButtonDown [click]"

case "left_button_up"    '       - the left mouse button has been released
print #win, "when leftButtonUp [click]"

case "left_button_move"
print #win, "when leftButtonMove [click]"

case "left_button_double" '    - the left mouse button has been double-clicked
print #win, "when leftButtonDouble [click]"

case "right_button_down"   ' - the right mouse button has been pressed
print #win, "when rightButtonDown [click]"

case  "right_button_up"    '- the right mouse button has been released
print #win, "when rightButtonUp [click]"

case  "right_button_move"   ' - the mouse moved while the right button was down
print #win, "when rightButtonMove [click]"

case  "right_button_double"  '  - the right mouse button has been double-clicked
print #win, "when rightButtonDouble [click]"

case  "middle_button_down"    '- the middle mouse button has been pressed
print #win, "when middleButtonDown [click]"

case  "middle_button_up"    '- the middle mouse button has been released
print #win, "when middleButtonUp [click]"

case  "middle_button_move"   ' - the mouse moved while the middle button was down
print #win, "when middleButtonDown [click]"

case  "middle_button_double"  '  - the middle mouse button has been double-clicked
print #win, "when middleButtonDouble [click]"

case  "mouse_move"
print #win, "when moveMouse [click]"

case  "character_input"
print #win, "when characterInput [click]"

case else
notice "Error 0908: Invalid !when instruction."
end select
 


FB Code:

Code:
!when middle_button_double {sub} 



Hope this helps!


User IP Logged

SS
Administrator
ImageImageImageImageImage

member is offline

Avatar




Homepage PM


Posts: 113
xx Re: New commands
« Reply #2 on: Jan 18th, 2008, 5:01pm »
Quote

Wow, I think you read my mind for this one, lol. It seems like there's one person in the Lead.

User IP Logged

A.H - Confuzed
FireBASIC Devloper

member is offline

Avatar




PM


Posts: 33
xx Re: New commands
« Reply #3 on: Jan 19th, 2008, 09:21am »
Quote

Well, no problem!
User IP Logged

Pages: 1  Reply Notify Send Topic Print
« Previous Topic | Next Topic »


New Monthly Ad-Free Plan!

$6.99 Gets 50,000 Ad-Free Pageviews!
| Free Shoutboxes | Hookah |

This Board Hosted For FREE By Conforums ©
Get Your Own Free Message Board!