Help - Search - Members - Calendar
Full Version: Source Code To A Text File
OESF Forums > General Forums > General Support and Discussion > Software
g333
If I turn source code into a text file and edit it can I then turn it into a working program?
g333
I going to start playing with code and if someone out there can package it for me it would be great.

Source text to working program.
pgas
hmm, I think you seriously need to learn a couple of things before starting to write programs.

What language are you going to use?

Do you know what is a compiler?
Do you know what is an interpreter?
Do you know what languages exists?

You probably want to learn about the C or C++ language, maybe python which is perhaps more simple?

In practice it is nearly impossible to write a program if you are not able to run it and test it yourself

unfortunately I don't find a pointer to a really good introduction to programming online...
maybe
http://www.ibiblio.org/obp/thinkCSpy/foreword.htm

maybe a book like "Beginning Programming For Dummies" "C for dummies" "Linux Programming For Dummies" http://www.dummies.com/

I'am sorry If my estimation of your knowledge is wrong
g333
If I turn the source code into a text file I can easily read and edit it but I want to put it together in Windows. How can I compile the source data into a working program without using Linux or how do I do it on the Zaurus?
lardman
Source code is generally just a text file with a different extension.

You can't easily use Windows to cross-compile apps for the Z.

You could use a bootable CD with a Linux dev env on it, or try developing on the Z.

I don't know much about either, I use a Linux box to do my cross-compiling.

Sorry,


Si
Stubear
All the source code I've ever worked with IS plain text.

Do you want to convert a C source file into a Word doc for editting? I really don't understand what you want to do here.

I think you need to pgas's advice and start looking for some introductions to programming.

What language are you going to start "playing with code" in? I agree with pgas that python would be a good place to start. It's major advantage it that it interpreted rather than compiled so you can download python for windows and write programs that will also usually run on linux.

If you want to program C or C++, then google for cygwin that will allow you to compile the programs you write on windows in the windows system. Otherwise you will never get anywhere asking others to compile your code

Good Luck

Stu
iamasmith
QUOTE(Stubear @ Apr 7 2005, 03:12 PM)
.... Otherwise you will never get anywhere asking others to compile your code
*


actually that reminds me I never did get those punch-cards back... lol laugh.gif
g333
Just say I find a page like this http://only.mawhrin.net/~geometer/zaurus/zsolitaire.html and at the bottom it has the source code how do I know whick program to use to change it?
iamasmith
QUOTE(g333 @ Apr 7 2005, 09:15 PM)
Just say I find a page like this    http://only.mawhrin.net/~geometer/zaurus/zsolitaire.html  and at the bottom it has the source code how do I know whick program to use to change it?
*


This source is a gzip'ed tar archive or 'gzip tarball'.

You may possibly be able to unpack it with winzip. Then you can read the source. If the files and in .c then it's probably written in c. If they end in .cpp then it's probably written in c++.

If you haven't done any C programming before you will probably have a lot of trouble with C++. If you are new to Linux too then you are on a REAL steep 'learning curve'. Basically you are going to be reading a lot and not being very productive... that's my guess anyway.

Start by running Linux on your desktop environment. That's my advice. If you think this is too tricky then you don't want to start writing C++ for the Qtopia interface using cross-compiler toolsets as you need to run Linux on your desktop to do this anyway I would suggest not.

To get an idea of a 'starting point' buy a copy of 'The C Programming Language' by Kernigham and Ritchie... it's the bible of C programmers... when you have mastered that start looking for books on C++ which will allow you to program in the successor to C which offers an object orientated approach.

Sorry I can't be more positive.

Actually, one more thing. I started looking through some of your other postings and a couple of things occured to me.

i. You probably can get to grips with C if you can handle JavaScript, the format is similar so if the syntax is sensible to you then you may enjoy it.

ii. You aren't getting an awful lot of help. I think this is mainly because the questions that you ask make people think that there's far too much to explain to really help out. Really I would suggest that you become more familiar with Linux... read stuff on Linux, some introductory books and then some specific ones about programming... don't expect to port Halflife 2 in your first week... in fact don't expect to write anything with graphics for a while. Build yourself a Linux desktop machine and use that instead of Windows if you can; but be warned if you ask questions of the Linux community (typically) that show that you really need to learn a lot then that may be too much effort for some people to be bothered with.

Hope this helps, oh and did I mention... run Linux on a desktop machine for a while. smile.gif

- Andy
g333
OK, I'll get a version of Linux for my machine. Which is the best to use with the Zaurus and easiest to use? rolleyes.gif

Thanks for your reply wink.gif
raduga
QUOTE(pgas @ Apr 6 2005, 11:23 PM)
In practice it is nearly impossible to write a program if you are not able to run it and test it yourself


Nearly impossible.... yes.

QUOTE(iamasmith @ Apr 7 2005, 8:07 AM)
actually that reminds me I never did get those punch-cards back... lol laugh.gif


Back in the Paper Age, coders were made of sterner stuff than we mere silicon children.

Though... when our grade school class was sent in for a BASIC lesson,
the grim, professional computerist who lectured us, passed out a batch of yellowing punch cards, and made us handwrite our programs on the back of each one, which we passed before his brooding gaze for approval-
after which we were given leave to enter them ourselves on teletype terminals, and see what havoc ensued.

Only three years later, when I came back to visit the site; teletypes dialing up to a murky mainframe somewhere indefinably downtown, had all been replaced with mutely beeping Apple ][c's. The crusty, fierce computerist had been retired, and substituted by a twenty-years-younger math teacher, who'd never seen the day when logic circuits hummed, sparked, and glowed.

Math teacher didn't like me, much.

Such is progress.
iamasmith
QUOTE(g333 @ Apr 7 2005, 10:56 PM)
OK, I'll get a version of Linux for my machine. Which is the best to use with the Zaurus and easiest to use?  rolleyes.gif

Thanks for your reply  wink.gif
*


My personal preference is SuSE.
pgas
Let's start a distro war! wink.gif

I'am a newly convert to ubuntu

You can even use Linux without installing anything on your computer these days, with liveCD like ubuntu or knoppix.
lardman
I use Mandrake.

QUOTE
how do I know whick program to use to change it?


Use a text editor, any one will do. The only problem that may occur, is that if you edit the file in Windows, it will add line feeds to the end of each line which Linux doesn't like (and so it probably won't compile like that). In this case you'll need to run the text/source file though dos2unix to stip away the line feed characters before you compile it.

Let's not be so negative, look at the source, try to get an idea of how it works - however a Linux box will be the easiest way to get it compiled once you've worked out what to change, etc.


Si

P.S. There are other programs available to edit source code which do things like syntax highlighting (changing the colour of keywords, strings, etc.). However they still work with the same source/text file and are just more 'intelligent' that a normal text editor.
g333
Wow! I didn't know I could run Linux from a CD. That's cool!!! I will download knoppix. Once I get that I might need a bit of help again with software compiling but at least I will be using Linux.
g333
I just saw the source C++ code for the Sharp dictionary. Is there any free software I can use to compile and run it on Windows XP? Also if a program is made for a Zaurus in C++ can it be run on other systems? I haven't compiled something is C++ before. I know Java is fantastic and can be run on almost anything.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.