Author Topic: Source Code To A Text File  (Read 8413 times)

g333

  • Full Member
  • ***
  • Posts: 196
    • View Profile
Source Code To A Text File
« on: April 06, 2005, 08:04:36 pm »
If I turn source code into a text file and edit it can I then turn it into a working program?
SL-C3000, Sharp ROM 1.11 JP, AirEdge AH-S405C...

g333

  • Full Member
  • ***
  • Posts: 196
    • View Profile
Source Code To A Text File
« Reply #1 on: April 06, 2005, 08:40:23 pm »
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.
SL-C3000, Sharp ROM 1.11 JP, AirEdge AH-S405C...

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Source Code To A Text File
« Reply #2 on: April 07, 2005, 03:23:04 am »
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
SLC-860 cacko / senao wifi

g333

  • Full Member
  • ***
  • Posts: 196
    • View Profile
Source Code To A Text File
« Reply #3 on: April 07, 2005, 10:52:50 am »
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?
SL-C3000, Sharp ROM 1.11 JP, AirEdge AH-S405C...

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Source Code To A Text File
« Reply #4 on: April 07, 2005, 11:03:54 am »
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
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
Source Code To A Text File
« Reply #5 on: April 07, 2005, 11:12:00 am »
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
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Source Code To A Text File
« Reply #6 on: April 07, 2005, 12:07:56 pm »
Quote
.... Otherwise you will never get anywhere asking others to compile your code
[div align=\"right\"][a href=\"index.php?act=findpost&pid=74022\"][{POST_SNAPBACK}][/a][/div]

actually that reminds me I never did get those punch-cards back... lol  
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

g333

  • Full Member
  • ***
  • Posts: 196
    • View Profile
Source Code To A Text File
« Reply #7 on: April 07, 2005, 05:15:01 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?
SL-C3000, Sharp ROM 1.11 JP, AirEdge AH-S405C...

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Source Code To A Text File
« Reply #8 on: April 07, 2005, 05:37:12 pm »
Quote
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?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=74117\"][{POST_SNAPBACK}][/a][/div]

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.

- Andy
« Last Edit: April 07, 2005, 06:11:48 pm by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

g333

  • Full Member
  • ***
  • Posts: 196
    • View Profile
Source Code To A Text File
« Reply #9 on: April 07, 2005, 06:56:20 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?  

Thanks for your reply  
SL-C3000, Sharp ROM 1.11 JP, AirEdge AH-S405C...

raduga

  • Full Member
  • ***
  • Posts: 129
    • View Profile
    • http://
Source Code To A Text File
« Reply #10 on: April 07, 2005, 07:45:16 pm »
Quote
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
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

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Source Code To A Text File
« Reply #11 on: April 08, 2005, 04:29:27 am »
Quote
OK, I'll get a version of Linux for my machine. Which is the best to use with the Zaurus and easiest to use?   

Thanks for your reply 
[div align=\"right\"][a href=\"index.php?act=findpost&pid=74141\"][{POST_SNAPBACK}][/a][/div]

My personal preference is SuSE.
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Source Code To A Text File
« Reply #12 on: April 08, 2005, 05:16:14 am »
Let's start a distro war!

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.
SLC-860 cacko / senao wifi

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Source Code To A Text File
« Reply #13 on: April 08, 2005, 06:04:25 am »
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.
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

g333

  • Full Member
  • ***
  • Posts: 196
    • View Profile
Source Code To A Text File
« Reply #14 on: April 09, 2005, 06:39:45 pm »
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.
SL-C3000, Sharp ROM 1.11 JP, AirEdge AH-S405C...