Problem with program...
Problem with program...
When i put my program to an EXE and run it, it gives me this message
Input run-time module path:
Please help me if you know this, and thank you very much!
Input run-time module path:
Please help me if you know this, and thank you very much!
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
You are using QB in an unfamiliar path
There are two ways this can happen.
1) The QB.EXE file cannot find a file outside of it's folder. Thus it asks for the path to it's folder files. You need to put the paths to all of QuickBasics EXE, Help, Include, and Library files into the Options menu of the IDE if they are not in the same folder you are working in.
2)When working in a directory other than QB's the EXE file can only access files in it's home folder. You must move the focus of QB by using CHDIR or SHELL to DOS commands to change to another folder. Then QB can find the module's files needed.
What I do is create all of my Modules in the same directory as QB.EXE so that everything works. Once I am done with a module I store them and any associated files into a ZIP file and move them to another folder for safekeeping. However I now have over 200 BAS files in the QB folder anyhow LOL.
Ted
1) The QB.EXE file cannot find a file outside of it's folder. Thus it asks for the path to it's folder files. You need to put the paths to all of QuickBasics EXE, Help, Include, and Library files into the Options menu of the IDE if they are not in the same folder you are working in.
2)When working in a directory other than QB's the EXE file can only access files in it's home folder. You must move the focus of QB by using CHDIR or SHELL to DOS commands to change to another folder. Then QB can find the module's files needed.
What I do is create all of my Modules in the same directory as QB.EXE so that everything works. Once I am done with a module I store them and any associated files into a ZIP file and move them to another folder for safekeeping. However I now have over 200 BAS files in the QB folder anyhow LOL.
Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
- Seb McClouth
- Veteran
- Posts: 342
- Joined: Wed Nov 09, 2005 7:47 am
- Location: Inside the Matrix...
- Contact:
Did you perhaps compiled it with brun45.exe? If so, you need that program along with it.
But you could just recompile and make sure you don't ask for that thing.
But you could just recompile and make sure you don't ask for that thing.
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
- Seb McClouth
- Veteran
- Posts: 342
- Joined: Wed Nov 09, 2005 7:47 am
- Location: Inside the Matrix...
- Contact:
sometimes the solution is simpler than we think...
anytime...
good luck on the programming!!
anytime...
good luck on the programming!!
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
LOL Who needs BRUN45? That should have been my first thought, but most programs do not require it.
If you use CHAIN then you can use it so that you pass COMMON SHARED values to the other module. Stand alone modules CHAINED will need a file to pass the values.
In any case, you still needed some type of file when that message comes up.
Ted
If you use CHAIN then you can use it so that you pass COMMON SHARED values to the other module. Stand alone modules CHAINED will need a file to pass the values.
In any case, you still needed some type of file when that message comes up.
Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
- Seb McClouth
- Veteran
- Posts: 342
- Joined: Wed Nov 09, 2005 7:47 am
- Location: Inside the Matrix...
- Contact:
burger2227, it happens to the best. I just thought of it because I used QB4.5 for a very long time. Now a days I use PDS7.1 thanks to Z!re.
Grtz
Grtz
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
now how can I make my program faster? Ill post the code....
Code: Select all
'Actor database of ZSO
DEFINT A-Z
CLS
Wbackround:
FOR i = 1 TO 30
COLOR 15, 12
LOCATE 15, 20
PRINT "Loading, Please wait."
FOR b = 1 TO 3000
NEXT b
CLS
LOCATE 15, 20
PRINT "Loading, Please wait.."
FOR C = 1 TO 3000
NEXT C
CLS
LOCATE 15, 20
PRINT "Loading, Please wait..."
FOR d = 1 TO 3000
NEXT d
CLS
NEXT i
CLS
test:
COLOR 15, 12
LOCATE 1, 1
PRINT "A production of Souylsin."
SLEEP 1
LOCATE 2, 1
PRINT "A find by the community of ZSO."
SLEEP 1
LOCATE 3, 1
PRINT "ZSO DAT 0.01"
SLEEP 1
LOCATE 4, 1
PRINT "Locating Actordat..."
OPEN "Actordat.txt" FOR INPUT AS #1
INPUT #1, there$
CLOSE #1
IF there$ = "0000 0000 Link (may sometimes cause Z-buffer glitches)" THEN
GOTO con
ELSE
LOCATE 5, 1
PRINT "Could not locate Actordat, now exitting..."
SLEEP 1
END
END IF
con:
DO
LOCATE 5, 1
PRINT there$
LOCATE 6, 1
PRINT "There are "; LEN(there$); " characters in this file."
LOCATE 7, 1
PRINT "Actordat Located successfully"
LOCATE 8, 1
PRINT "TEST COMPLETE"
LOCATE 9, 1
PRINT "Press Any key to Continue"
kp$ = INKEY$
IF kp$ <> "" THEN GOTO Menu
LOOP
Menu:
CLS
LOCATE 10, 20
Color 14,12
PRINT "Database of Zelda Actors"
LOCATE 20, 5
Color 10, 12
PRINT "(S)earch for Actors"
Color 15, 12
LOCATE 20, 50
PRINT "(E)xit"
DO
kp$ = INKEY$
IF kp$ = "s" THEN GOTO srcaktr
IF kp$ = "e" THEN GOTO ext
LOOP
srcaktr:
asearch:
CLS
LOCATE 1, 1
INPUT "Actor name, or part of one:", sactname$
cmd$ = "FIND /I " + CHR$(34) + sactname$ + CHR$(34) + " Actordat.txt"
SHELL cmd$
PRINT "(A)nother search or (E)xit?"
DO
kp$ = INKEY$
IF kp$ = "a" THEN GOTO asearch
IF kp$ = "e" THEN GOTO ext
Loop
ext:
CLS
RANDOMIZE TIMER
C = INT(RND * 0 + 15) + 1
COLOR C
SHELL "Title COW"
LOCATE 10, 25
PRINT "BYE!"
SLEEP 1
END
-
- Veteran
- Posts: 288
- Joined: Sat Feb 18, 2006 4:02 pm
Wont make it faster but you could get riddof whole lot of LOCATE's.
Now you can replace these
LOCATE 15, 20
PRINT "Loading, Please wait."
with this
TEXT 15, 12, "Loading Please wait."
Things that slows your program mostly are these
If you want some delay there, i would ratherly use SLEEP with one or two second parameter. Your way depends of computer speed.
Code: Select all
SUB Text(a AS Integer, b AS Integer, c AS String)
LOCATE a, b
PRINT c
END SUB
LOCATE 15, 20
PRINT "Loading, Please wait."
with this
TEXT 15, 12, "Loading Please wait."
Things that slows your program mostly are these
Code: Select all
FOR b = 1 TO 3000
NEXT b
-
- Veteran
- Posts: 288
- Joined: Sat Feb 18, 2006 4:02 pm
Well, thats a one way to say it. Not right but not wrong either
Here is another tip. I thought to create it after looking your start of code.
Dont get frustrated, you are goin good there. Just keep on learning
http://www.ascii-world.com/qbasic-snippets
E.K.Virtanen
Here is another tip. I thought to create it after looking your start of code.
Code: Select all
Temp$ = "Loading, Please wait..."
CLS ' no need to locate since CLS allways put's cursor at 1,1.
For counter = 1 TO LEN(Temp$)
Print MID$(Temp$, counter, 1); ' important to have ; at the end so line wont change.
'DELAY CODE HERE: SLEEP 1 or something
Next Counter
http://www.ascii-world.com/qbasic-snippets
E.K.Virtanen
Um wanna explain the code to me? Might help a bit, but i need the locate so the string appears in the middle of the screen, and not a 1,1. Know what I mean? Ill show you a update of my code shortly, maybe in like 10minutes.
EDIT:How would I be able to turn this into a sub?
EDIT:How would I be able to turn this into a sub?
Code: Select all
find:
OPEN file$ FOR INPUT AS #1
INPUT #1, there$
CLOSE #1
IF there$ = "0000 0000 Link (may sometimes cause Z-buffer glitches)" THEN
LOCATE a, 1
PRINT file$ " Located successfully."
GOTO done
ELSE
LOCATE a, 1
PRINT "Could not locate"; file$ "now exitting..."
SLEEP 1
END
END IF
-
- Veteran
- Posts: 288
- Joined: Sat Feb 18, 2006 4:02 pm
http://www.ascii-world.com/centering-text-on-the-screenLee wrote:Um wanna explain the code to me? Might help a bit, but i need the locate so the string appears in the middle of the screen, and not a 1,1. Know what I mean? Ill show you a update of my code shortly, maybe in like 10minutes.
You need to make that as function with return value. If value = ok, then call sub done and so on.EDIT:How would I be able to turn this into a sub?...
Example of simple function.Rude and anti-beautifull but it does the job.
Code: Select all
CONST OK = 1
Function OkOrNot(a AS Integer, FileName AS String) AS Integer
OPEN FileName FOR INPUT AS #1
INPUT #1, there$
CLOSE #1
locate a, 1
IF there$ = "0000 0000 Link (may sometimes cause Z-buffer glitches)" THEN
Print FileName; " Located successfully."
RETURN OK
ELSE
PRINT "Could not locate"; FileName "now exitting..."
SLEEP 1
END
END IF
END Function
' this works after you create "Done" as sub.
IF OkOrNot(a, "filenamehere") = OK Then Done
E.K.Virtanen
ok, ive tried a bunch of things to make a "highlight" menu. but no luck. can you please take my code and put one in? thanks
Code: Select all
DECLARE SUB TEXT (a AS INTEGER, b AS INTEGER, C AS STRING)
'A database of Souylsin
DEFINT A-Z
CLS
Wbackround:
FOR i = 1 TO 3
COLOR 15, 12
TEXT 15, 20, "Loading, Please wait."
SLEEP 1
CLS 2
TEXT 15, 20, "Loading, Please wait.."
SLEEP 1
CLS 2
TEXT 15, 20, "Loading, Please wait..."
SLEEP 1
CLS 2
NEXT i
CLS
test:
COLOR 15, 12
LOCATE 1, 1
PRINT "A production of Souylsin."
SLEEP 1
LOCATE 2, 1
PRINT "Thanks to everyine who has contributed to this production."
SLEEP 1
LOCATE 3, 1
PRINT "WikiDAT 0.11"
SLEEP 1
SHELL "TYPE help.txt"
SLEEP 1
LOCATE 10,1
PRINT "TEST COMPLETE"
LOCATE 11, 1
PRINT "Press Any key to Continue"
kp$ = INKEY$
IF kp$ <THEN> 4 THEN selection% = 1
GOSUB Redraw
CASE " "
goto
END SELECT
LOOP
Redraw:
CLS
FOR i = 1 TO 4
PRINT Menu$(i)
NEXT i
LOCATE selection%, 1
COLOR 15, 12
PRINT Menu$(selection%)
COLOR 0, 12
RETURN
LOCATE 5, 20
COLOR 14, 12
PRINT "Database of Zelda Actors"
ssearxh:
GS:
fnar:
Anicode:
asearch:
CLS 2
INPUT "Actor name, or part of one:", sactname$
cmd$ = "FIND /I " + CHR$(34) + sactname$ + CHR$(34) + " Actordat.txt"
SHELL cmd$
PRINT "(A)nother search or (B)ack to main?"
goto choice
ext:
CLS 2
RANDOMIZE TIMER
C = INT(RND * 0 + 15) + 1
COLOR C
LOCATE 10, 25
PRINT "BYE!"
SLEEP 1
END
SUB TEXT (a AS INTEGER, b AS INTEGER, C AS STRING)
LOCATE a, b
PRINT C
END SUB
-
- Veteran
- Posts: 288
- Joined: Sat Feb 18, 2006 4:02 pm
- Seb McClouth
- Veteran
- Posts: 342
- Joined: Wed Nov 09, 2005 7:47 am
- Location: Inside the Matrix...
- Contact:
on file, thing wouldn't it be wise to use ? Because a file could contain more, or heck, not even exist for that matter.
Code: Select all
do...until EOF(filenr%)
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
- burger2227
- Veteran
- Posts: 2466
- Joined: Mon Aug 21, 2006 12:40 am
- Location: Pittsburgh, PA
A TIMER Delay
Here is a simple Delay SUB that works for seconds down to .02 seconds and it is good on any speed computer:
I use this instead of SLEEP for a very important reason. SLEEP only stops a program until a keypress by the user!
To call the sub:
I use this SUB in many of my programs to slow things down. A call can also slow down loops.
As to file access, you MUST not try to read data that is past the End Of File or EOF(#) or you will get an error. Here is an example with a loop and without one:
The first example reads data from a file, numbered #1 in an OPEN statement, one piece at a time until the name matches. If the name is not found, the loop stops at the end of the file!
The second is used with IF to see if the EOF has been reached while taking an entire line of data like text. It will not Input data if it is at the end of the file!
Ted
Code: Select all
SUB Delay (Dela!)
start = TIMER
DO WHILE start + dela! > TIMER
IF start > TIMER THEN start = start - 86400 'midnite correction
LOOP
END SUB
To call the sub:
Code: Select all
Delay .5 '1/2 second delay
' or
CALL Delay(.5)
As to file access, you MUST not try to read data that is past the End Of File or EOF(#) or you will get an error. Here is an example with a loop and without one:
Code: Select all
DO WHILE (NOT EOF(1)) 'loop until end of file
INPUT #1, nme$, Phone$, age%, Zip%
IF nme$ = name$ THEN EXIT DO
LOOP
IF (NOT EOF(1)) THEN LINE INPUT #1, Line$ 'in an IF statement
The second is used with IF to see if the EOF has been reached while taking an entire line of data like text. It will not Input data if it is at the end of the file!
Ted
Last edited by burger2227 on Wed Nov 28, 2007 5:07 pm, edited 1 time in total.
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0