02-13-2005, 11:41 AM
I've found many of us using DO..LOOP to substitute =INKEY$ or waiting user input/respond before ending the program. Why not we make it as an official keyword called PAUSE. To simulate the success of DO..LOOP on handling this need here I made sub for it named PAUSE. Save this code as freebasic.bi and place it into \inc folder:
[syntax="FreeBasic.bi"]
#ifndef freebasic_bi
#define freebasic_bi
'------------------------
' PAUSE
'------------------------
sub pause
do until inkey$<>""
loop
end sub
'------------------------
' Add other commons used
' constants and routines
' in this file.
'------------------------
#endif 'freebasic_bi
[/syntax]
You could add some more useful commons thats you've always used while making FB application.
Here is the example of using it. Everyone should know already how to use it. Anyway, I just add it for this post completion:
[syntax="Pause.bas"]
'$include once: "freebasic.bi"
print "-------------------------"
print "FREEBASIC Compiler v0.11b"
print "-------------------------"
print "Press any key to exit...";
pause
[/syntax]
Any idea to add more commons routine and turn it as instant keywords are welcome.
[syntax="FreeBasic.bi"]
#ifndef freebasic_bi
#define freebasic_bi
'------------------------
' PAUSE
'------------------------
sub pause
do until inkey$<>""
loop
end sub
'------------------------
' Add other commons used
' constants and routines
' in this file.
'------------------------
#endif 'freebasic_bi
[/syntax]
You could add some more useful commons thats you've always used while making FB application.
Here is the example of using it. Everyone should know already how to use it. Anyway, I just add it for this post completion:
[syntax="Pause.bas"]
'$include once: "freebasic.bi"
print "-------------------------"
print "FREEBASIC Compiler v0.11b"
print "-------------------------"
print "Press any key to exit...";
pause
[/syntax]
Any idea to add more commons routine and turn it as instant keywords are welcome.
= inc(¢)