Register FAQ Search Today's Posts Mark Forums Read
Go Back   JazzJackrabbit Community Forums » Open Forums » General Jazz Jackrabbit Talk

Help with BASIC

Doubble Dutch

JCF Member

Joined: Mar 2004

Posts: 3,072

Doubble Dutch is doing well so far

Aug 11, 2008, 02:51 AM
Doubble Dutch is offline
Reply With Quote
Help with BASIC

Hey there;

I've recently made some basic er... BASIC programs for fiddling around with the Jazz Jackrabbit 1 graphics The only problem seems to be that well, they're a bit hard to use if you're not totally DOS immersed like I am. They're all command line interfaces, and a bit picky at that.

So what I was wondering was, is there anyone here who knows more BASIC than me (That's not hard) that knows how to make opening or accessing files a little more easy than having to type out the whole name? (People really don't like doing this)

Or, if you have any tips for making my programs easier to use, they can be got here: http://www.jazz2online.com/J2Ov2/dow...p?levelID=5147
__________________

nonne amicus certus in re incerta cernitur?

/)_/)
(^.^)
((")(")
HorvatM

JCF Member

Joined: Jul 2007

Posts: 70

HorvatM is doing well so far

Aug 11, 2008, 04:26 AM
HorvatM is offline
Reply With Quote
I am an experienced BASIC programmer. The problem is, that I've never really found any other solution to opening files easier than typing the path and file name. However, one suggestion is (albeit not really elegant):

Tell the user that the files he/she wants to work with must be in the directory of the program. Then, you can make him/her write his/her files in a file with a listing of all the files, which is read by the program when choosing a file. In Microsoft QBasic, reading that file would be like this:

Code:
OPEN "Filelist.txt" FOR INPUT AS #1
DO WHILE NOT EOF(1)
  Counter = Counter + 1
  INPUT #1, FileName$(Counter)
  PRINT FileName$(Counter)
LOOP
CLOSE #1
Of course this only works if the files are one per line, and they are written with double quotes before and after their names (such as "MyFile.txt"). To save disk space by two bytes for each file and to simplify the process for the user not having to enter each file in quotes, use LINE INPUT in place of INPUT.

You can also sort the files by name, but I'm not going to deal with this at the moment.

Note that I have only tested these techniques on Microsoft QBasic. Your BASIC interpreter/compiler may use different commands for dealing with files.

Hope this helps!
__________________
Jazz 2 Utilities

Last edited by HorvatM; Aug 11, 2008 at 04:28 AM. Reason: A few errors.
Cpp

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

Aug 11, 2008, 12:04 PM
Cpp is offline
Reply With Quote
I used to program in Quick Basic on Commodore64, but later on I've done numerous programs in Visual Basic 6. Recently I've stopped VB6 altogether to focus on x86 assembly, C++ and linux scripting.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>
Doubble Dutch

JCF Member

Joined: Mar 2004

Posts: 3,072

Doubble Dutch is doing well so far

Aug 16, 2008, 10:59 PM
Doubble Dutch is offline
Reply With Quote
I see. Well, that is a pity then. I can only hope that someone who knows better language than me will work up the gumption to make replacements for my rudimentary programs. (Go go OpenJazz)
__________________

nonne amicus certus in re incerta cernitur?

/)_/)
(^.^)
((")(")
Torkell

Stealth Admin

Joined: Jul 2004

Posts: 2,153

Torkell is a forum legendTorkell is a forum legendTorkell is a forum legend

Aug 17, 2008, 08:12 AM
Torkell is offline
Reply With Quote
Which BASIC variant are you using?

In Visual Basic 6, you can either use the Common Dialogs Control (needs a Form) or the dlgobjs.dll that I think is in the Package and Deployment Wizard folder (you may need to register it with regsvr32.exe) to display the standard Windows file open dialog. Obviously you'll have to include whichever one you use with your program, and either an installer or instructions on registering it.

If you're using QuickBASIC/QB, then you'll have to write your own console-based file browser. You could also read the filename in from the COMMAND$ function as part of the command-line arguments - this will let the user drag and drop the file on to your program.

I've not downloaded and tried your programs yet, as I don't have a JJ1 variant to hand (got the Xmas versions somewhere), so do say if I'm barking up the wrong tree here.
__________________
-- Torkell



Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT -8. The time now is 05:31 AM.