PDA

View Full Version : Freeware BASIC interpreters that can do TCP handling


squidgy
20th May 2001, 12:21
Does anyone know of any?

You see, the thread at http://65.108.99.49/showthread.php&threadid=352 reminded me a while ago that I was going to try to make my own download manager.

Thing is, though, I'm pretty hopeless at learning new programming languages, but I did do some BASIC programming at school. So I like QBASIC and I like YaBasic.

However, so far the only interpreter I've found that allows you to open TCP communication channels (either as a server or a client) is called Rebol. So what I have tried to do is to write a sort of interfacing program for Rebol which uses temporary files on the hard disk to control TCP communications. That is, it reads info on which port to open a server on, or which IP/port to connect as a client to from a temporary file, and it reads the information it needs to send to the remote host to another temporary file, and it writes the data it receives in blocks to another temporary file on the hard disk.

The idea of doing this was that absolutely any programming language could then be used to handle TCP communications, simply by handling these temporary files using its ordinary binary file handling routines. This would allow me to write fully functioning FTP, email and news clients and servers in QBASIC or Yabasic. The BASIC program would do all of the interpreting of the protocol commands, server messages and user interface, and decide what to reply to the remote host with accordingly, and the file-TCP interface written in Rebol would simply facilitate it.

Thing is, I think that's a very messy way of doing it, and it's bound to go wrong if I'm not careful about naming files, appending them or deleting them. Does anyone know if there's a better way without me having to learn more languages? Thanks. :)

oh .... this would strictly be for personal use only. There's no way that I'd be so lame as to try to sell an FTP client or server that actually worked in this way!

onomatopoeia
20th May 2001, 13:50
:eek: I have no idea at all

Using two interpreted languages communicating using temporary files is probably going to be harder work than learning a new operating system and programming language.

Get a giveaway compiled language from a magazine coverdisk. :) PC Plus tends to have the last but one version of Borland languages on its cover disks occasionally.

SpaceAgent
20th May 2001, 18:44
Echo what Mark said. Learning languages isn't difficult, it's learning concepts that's the problem. Get Delphi or C++ Builder from a PC Plus cover disk, learn how to use it and go for it. I'm sure it will end up easier, and definitely be faster and more robust, than the current approach.

squidgy
21st May 2001, 00:26
I guess you're right. I'm tempted to say that it's easy to say that "it's easy to learn a language" when you already happen to know it. :) Mind you, one year ago, I didn't know enough HTML to bang together a web page, let alone the protocol commands necessary to control what an FTP or SMTP server, either manually or writing your own program to do it. But then again, these are just command sets, like simple MSDOS, they aren't languages, in that you can't really do conditional loops and handle variables and stuff.

The real aim for me here is to get my computer to do as much of exactly what I want as possible, for as little effort and outlay on commercial software or educational courses or books as possible. Perhaps the best thing for me to do is simply write a routine that handles TCP communications that can be called from a BASIC program. I think there might be ways of doing this for Yabasic if you happen to know a little bit of C programming language. I think I'll look into this.

SpaceAgent
21st May 2001, 07:24
I still reckon it's fairly easy to learn a new language once you can program at all. All languages give you conditionals (usually some form of "if" statement), loops (generally more than one - usually "for", "while", "repeat" or "loop"), a way to define variables (and often a way to define constants as well), a way to define functions (may be known as "procedures", "routines" or "subroutines") and usually some way of interacting with the computer's hardware and operating system. Once you understand these concepts then learning a new language is just a matter of learning a (generally fairly small) bit of syntax. The only caveat is that it's a bit trickier if you want to learn a new programming paradigm such as OO or event driven programming.

pudds
21st May 2001, 19:40
I basically echo what everyone else has to say. Learning a new language would be far easier. As you allready have knowledge of BASIC then visual basic would be a good choice. Unfortunatly unless you are prepared to go down the not so legal route it would be very expensive.
C/C++ would be good as you could make direct calls to the winsock DLL
and manipulate TCP/IP stuff etc.
Borland give away a comand line compiler and you can download IDE's to make it easier to use. Good luck whatever you decide :)

onomatopoeia
22nd May 2001, 00:10
Install linux and you get the most splendid C compiler in the world for free (gcc). Lots of other free languages. Almost all open source as well so you can recompile the compiler :lol

You will then have to learn one of a number of interesting text editors ....

SpaceAgent
22nd May 2001, 08:17
There's a Win32 version of gcc as well isn't there Mark?

onomatopoeia
22nd May 2001, 09:26
I know you can run it under something called cygwin, and compile and run a number of other *n*x programs as well the same way. I've never tried it myself though. I ought to really, I much prefer the text editors available in windows (notepad, wordstar) to vi.

SpaceAgent
22nd May 2001, 10:35
I used WordStar from v1 to v6. I remember being stunned by v1 running on a 1MHz Z80 with 16K RAM :lol

These days I generally do Windows programming with Visual Studio IDE but I think my favourite ever programmer's editor has to be Brief.

onomatopoeia
22nd May 2001, 11:06
I still use Wordstar v6.0 :):):) I started on it when I got this job almost 10 years ago. Those were the days - IBM PS/2 Model 50 with a 80286@10MHz, 1MB RAM and 10MB Hard drive. My makeuk.bat file that compiled the entire english language version of the product (which I still use today but massively expanded) took about 10-15 minutes to run through so I went to make tea. Now compiling about 3 times as much stuff it takes under 60 seconds on a 533 Celeron with 128MB RAM.

The Visual Studio IDE is very good, but not a lot of help with assembly language :lol plus I find myself typing Ctrl-KB to mark the start of a block, Ctrl-KD to save etc etc which can produce interesting and unexpected results :lol:lol

I never used brief, remember people raving about it at university but in those days I was an Acorn devotee with my Archimedes A310 and it had it's own editor (not that I remember what it was now).