Link to home
Start Free TrialLog in
Avatar of mmcmillen
mmcmillen

asked on

gwbasic to vb

I need to convert GWbasic to vb. I know that is probably impossible, but how can i at least get gwbasic file to a .txt file so I can print it out?  I cant print from gwbasic because my usb printer wont capture the port
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Isn't it a .bas file? If so, it is simply a text file. You can open it from the Notepad and print it.
ASKER CERTIFIED SOLUTION
Avatar of GeneM
GeneM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GeneM
GeneM

Maybe I was too brief in my explanation.  In order to get a GWBASIC file into ASCII, you must load the file into the GWBASIC editing program.  If you do not know how to do that, or if you do not have GWBASIC, just let us know.  

Once you have it loaded, just save it as I said earlier.  

  SAVE "FileName.BAS",A
Ah, the memories...

Never used GWBasic, but I did use BasicA. I believe that was how you saved in it, so it may be the same.
like somebosy already stated

the .bas is a text file, you can open it up notepad copy the code.


then open vb up and paste it,

they start converting it that way, making sure that you allocate your objects to the code.


cheers
#andy
Not always. They typically saved to a binary file by default. Faster save/load and smaller file.
Avatar of mmcmillen

ASKER

I have gwbasic, and a vague, really vague memory of using it.  I tried opening the .bas file in vb as well as notepad. It isn't in ASCII completely.  I will try the save ,A function at home.  
Once you have the program back into ASCII code, open VB, insert the code as a module, then add a button to the form with code behind it to access the subroutines.

You'll print that certain things are not compatible (such as the "sound" command) but most will translate very nicely.  Also, the print commands will get dumped onto the form background, so you may want to place the button out of the way, and set the form's autoredraw property to true.
well for my 2 bits
dont do it, start from scratch with vb it will probably save you some headaches
I agree with that completely. Tried it myself once. It got a lot easier when when I just used the project for ideas instead of for the code.
I dont want to convert to vb. I am going line by line and rewriting but I have the following problem(s)...

I have a usb printer which wont allow me to print from dos or capture a lpt port. So I cant print the code.

I want the code in a text file so i can at least scroll through it, not see 10 lines of code at a time, and have to type in a new line number range everytime I have to move.



By the way, I couldnt get the save ,A  thing to work...
I was leaving the ending "   before the ,A.   Works great. Now I just have to trudge through the old code and rewrite.  Thanks