create a soft

cheli

Registered
hello

i want to create a program (color related) in mac x.
what i got to learn?
(i have no idea from programming)

thanks for time
 

ElDiabloConCaca

U.S.D.A. Prime
Well, you're going to have to learn some programming if you intend to write a program. There are many languages you can learn to program under Mac OS X, but I would recommend getting a good bacground in C, C++ or Objective-C for the "guts" of the program, then learn Cocoa for the GUI of your program.

If you'd like some suggestions on good books that will help you learn, I'm sure there are a few developers here who would be happy to suggest a few. I would personally suggest taking a course somewhere for a beginning programmer, since diving into a book can be a little overwhelming (depending on the book).
 

kainjow

Registered
Learn C, that's the most basic language, and the foundation of all languages (sorta).

The best way to learn a language is to create a program that does something interesting! With straight C, you only can make command line programs (i.e. text only, no windows, menus, buttons, etc) so programs such as math helpers, or equation solvers, etc, or unit conversions (Celsius to Fahrenheit) are good starters.

Here's a quicky C program to get you started. You need to download Xcode to get all the developer tools. Once you do, open TextEdit and copy the following code into it.
Code:
#include <stdio.h>

int main()
{
	int firstNumber;
	int secondNumber;
	int sum;
	
	printf("Enter a whole number (i.e. 5, 14, 32):\n");
	scanf("%d", &firstNumber);
	printf("Enter another one:\n");
	scanf("%d", &secondNumber);
	
	sum = firstNumber + secondNumber;
	printf("The sum of %d and %d is %d.\n", firstNumber, secondNumber, sum);
	
	return 0;
}
Save it to your Desktop as "add.c". Then open Terminal (in /Applications/Utilities) and type the following to compile the program from human-readable language to machine language (binary):
Code:
gcc ~/Desktop/add.c -o add
Then if no errors show, type this into Terminal to run the program:
Code:
~/Desktop/add
And that's it! I'd recommend you go to your library and pick up a book about C. And then you can experiment via TextEdit and the Terminal, which is all you need for now!! Have fun!
 

barhar

Registered
'I want to create a program (color related) in mac x.' is not very specific.

MacOS X comes with AppleScript, C/C++, Objective C, Java, Perl, Python, and Ruby. You will have to install the '/Developer/' folder via the MacOS X installation disc.

'FreePascal' can be obtained at 'http://www.freepascal.org/fpcmac.html'.

-------------------

Apple's 'TextEdit' will save the 'add.c' file as 'add.c.rtf' (rich text format) by default. Even renaming the file as 'add.c', in 'Finder', will not help since 'gcc' will not properly compile it.

Use 'Tex-Edit Plus', 'BBEdit', 'XCode', or any text editor [do a 'www.versiontracker.com' search for 'text editor'] capable of saving the file in 'ASCII' format - to enter and save the provided sample C code to your 'Desktop'.

In 'Terminal:'
Enter 'gcc ~/Desktop/add.c -o ~/Desktop/add' and press <return>, to compile the code.
Enter '~/Desktop/add' and press <return>, to execute the resultant 'add' file.
Follow 'add's instructions.

-----

To learn AppleScript through Ruby, do some respective 'Google' searches. You should find many tutorials, examples, and support web sites.
 

ElDiabloConCaca

U.S.D.A. Prime
barhar said:
Apple's 'TextEdit' will save the 'add.c' file as 'add.c.rtf' (rich text format) by default. Even renaming the file as 'add.c', in 'Finder', will not help since 'gcc' will not properly compile it.
You can force TextEdit to save in plain ASCII by selecting "Make Plain Text" from the "Format" menu, or pressing Shift-Command-T.

I use XCode for most of my coding, but if I've got a FoxPro project, nothing beats TextEdit on the Mac side for some simple, free text editing... ;)
 

bobw

The Late: SuperMacMod
Dupe thread deleted.
 

HomunQlus

Artifical Lifeform
'While all answers are replies, not all replies are answers.'

HELLO?! Would you please give me a proper explanation to why my reply was deleted. I do not expect a deletion of this.
 
Top