Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

GW Basic compiler 1

Status
Not open for further replies.

Golestan

Mechanical
Nov 27, 2006
110
Hi Guys,
I am looking for a windows based BASIC compiler. I used to be good at programing in basic and also I have some design programs that I want to use now.
Thanks for any information.
 
Replies continue below

Recommended for you

I used to use Microsoft Quick Basic years ago. There have been so many changes to computers that I don't even know if programs compiled under Quick Basic or GW Basic will even run any more.

My suggestion is to try using the Visual Basic for Applications (VBA) available in Microsoft Excel. If you are crunching numbers, Excel makes a new user interface: put your input data in the spreadsheet, then read it and work with it using VBA. You can report the results back to the spreadsheet or to a text file (you can even have Excel VBA open up the output file in Windows Notepad).
 
Overall, I'd question the need to use BASIC. What do you need to do that can't be done directly in Excel? BASIC was a great tool in the days when there were few other programming languages and hardly any mathematical tools.

Nowadays, you have Excel, Mathcad, Matlab, etc. You can get public-licensed clone of Matlab for free, which does all the math and has some degree of user interface capability:

For almost everything I'd done in the last 10 yrs, Excel, Mathcad, and Matlab pretty much covered.

TTFN

FAQ731-376
 
Hi there:

Just do what TomBrash is telling you to do and you cannot go wrong.

Get a copy of MS Office and use MS Excel. VB (Visual BASIC) compiler is there for free.

Do regular spreadsheet work and when needed use VB. Even spreadsheet cells can take input date from given cells and present the output in another cell.

Programming will never go away.

Knowing how hard it used to be, it is unbelievable what is available today and how far you can go ...

What else can you ask for?

Thanks,

G. Feric, PE
 
Qbasic programs do run under XP, I don't know about Vista.



Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Compiled Quickbasic DOS programs run in XP. GWBASIC run too. You can get the free DOSBOX program that creates a DOS environment and run even DOS graphic programs.
 
There's also VBScript. Your computer comes with a VBScript interpreter built in. The programming is pretty similar to VB/VBA. You can run a VBScript program directly without being inside another program like Word or Excel. Of course, it's not going to be as powerful or flexible as VBA in Excel or VB Express, especially in the area of GUI.
 
What is the best way to learn the basics and get started using VBA for Excel?

I use Excel spreadsheets for a lot, however I have never tried a macro or VBA. I used to use macros for Quattro Pro in my DOS days.
 
IRstuff is wrong about VBA.
It is indeed compiled. The code is compiled and saved as part of the workbook. What distinguishes VBA from VB is that VBA needs a host application. As such it can not be run as a stand alone application like VB.
 
VBA for Excel has a great utility, which is the macro recorder. Just about anything that you might want to do in Excel can be macro recorded, which gives you a great starting point for coding.

The VBA help files are generally useful, although the structure of the objects in VBA for Excel can be obscure, at times.

TTFN

FAQ731-376
 
There may be some misinterpretation of the term 'compiled' in relation to computer jargon. The VBA code in a spreadsheet is included in the spreadsheet itself, but is not compiled in the computing sense. That would imply converting the instructions irreversibly into machine code. VBA code is interpreted afresh with every run of the code, so is not compiled in the normal sense.

Excel VBA is fairly well documented in Excel VBA help which can be accessed from an Excel VBA code window (ALT-F11 from a spreadsheet) and MSDN has documentation currently here but liable to move

Good Luck
johnwm
________________________________________________________
To get the best from these forums read faq731-376 before posting
Steam Engine enthusiasts
Steam Engine Prints
 
You don't need a compiler.

E.g. QBASIC just screams on a modern computer, even a 'slow' one.

Those old programs that used to give you time to get coffee will finish before you can stand up.





Mike Halloran
Pembroke Pines, FL, USA
 
To All:

Change in the computer world is just amazing.

What used to take for ever, today it is done in a few seconds or even less ...

It is good to read posts from people who know more than I do and have been doing computer calculations for many, many years. It is always good to read such engineering and computer opinons and experiences.

I have to admit that every day I can learn and hear something new about computing and computers and the whole thing just keeps getting beter and better.

Thanks,

G. Feric, PE
 
VBA is a bit of a mixed bag.

While it is not a traditional "compiled" language that goes to machine code, it does compile to a psuedocode that's similar to the basic infrastructure used in VC++ and VB.

However, the psuedocode is itself interpreted in Excel, so for VBA, it's still an interpreted result.

TTFN

FAQ731-376
 
Thanks for all the comments,
What is the best way to teach this old dog, (GWBASIC programmer) to lear and use the VB in excell. I have been told that all the calculations I want to do, can be done in excell.
Where do I start?
regards,
 
Your best bet is to turn on the macro recorder in Excel, do a sample calc, and look at the generated code.

I've bought MANY VBA books, but the end result is that I always record some kernel of code and then use the VBA help files for the rest.

And bear in mind that the basic structure of VBA is still BASIC. The only annoyance is the object structure that you have to slog through to reference things on the worksheet.

The following isn't terribly relevant, but it shows flow of the program and the ability to reference MS Word documents and copying stuff and pasting back into Excel
Code:
Sub LT7()


'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Dim ColIndex, RowIndex, StartRow, Done
    Dim FileName, SheetName
    
    Dim WordApp As Object
    Dim Trans As String
       
    Set WordApp = GetObject(, "word.application")
    
    FileName = ActiveWorkbook.Name
    SheetName = ActiveSheet.Name
    
    Sheets(SheetName).Select
    Done = False
    ColIndex = ActiveCell.Column
    RowIndex = ActiveCell.Row
    StartRow = RowIndex
    
    Cells(RowIndex, ColIndex).Select
    With WordApp.Selection.Find
        .Text = "transmittance ="
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    For Index = 1 To 25
        WordApp.Selection.Find.ClearFormatting
        WordApp.Selection.Find.Execute
        WordApp.Selection.MoveRight unit:=wdCharacter, Count:=1
        WordApp.Selection.MoveRight unit:=wdSentence, Count:=1, Extend:=wdExtend
'        WordApp.Selection.Copy
        Trans = WordApp.Selection.Text
        WordApp.Selection.MoveDown unit:=wdLine
        
        Cells(RowIndex, ColIndex).Select
'        ActiveSheet.Paste
        ActiveCell.Formula = Trans
        
        RowIndex = RowIndex + 1
    Next
    Cells(StartRow, ColIndex).Select
End Sub

TTFN

FAQ731-376
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor