Skip to main content
Home Documents Game Manuals Mac Program For Dummies3rd Ed
Mac Program For Dummies3rd Ed

Mac Program For Dummies3rd Ed

Game Manuals · PDF
FilenameMacProgramForDummies3rdEd.pdf
Size31.96 MB
Subsection Mac Program For Dummies3rd Ed
Downloads1
Enjoying MacTrove? Anonymous downloads are free and unlimited. Create a free account to track favorites, contribute metadata corrections, and join the community chat.
Reader
Mac Program For Dummies3rd Ed
/
Loading…
OCR / Text contents
11 Basics and Figure Out ti e -:nd in No Time! start Programmi. 96 A Reference for The Fun and Easy Way"' the Rest of Us!' to Create New Mac -Pro/lrams by Dan Parks Sydow Your First Aid Kit' for Compiling Soutce Cade -with COt/eWamor Ute Complexities Of C - Explained in Plain English Mac®l'roframminf For Dummies; 3rtl Edition C Lan9ua9e Data TlJ.pes Use Data Type Example Smallwholenumber short short days = 3; Big whole number 1 ong l ong p o pulati o n = 5600200 ; Decimal numbers f 1oat float secon ds = 42 . 53 ; Event record Event Record EventRecord theEvent ; Wi ndow WindowPtr WindowP t r t heWi ndow ; Rectangle Re ct Rect s mallSquare ; C Lan9ua9e Math In the following examples, assume that all variable s are declared to be of type short. Operation Symbol Example Add~on + newAge = cu rr en tAg e + l; Subtraction 1 os s = tot a 1 damaged ; Multiplication * days = weeks * 7; Division I years a months I 12 ; lncrementbyl ++ loopCounter++ ; Important Toolbox Functions In the following examples, assume that t he exampl e va ri ables are declared as follows: t he Event is of type Event Re co rd, thew i ndow is of typ e Wi ndo wP tr, and the Rec t is of type Re c t . Task Toolbox Function Exampl e Get event information WaitNextEvent WaitNextEvent(everyEvent . &theEvent . OL . OL) ; Open a window GetNewWindow GetNewWi ndow ( 128 . ni 1 • (WindowPtr)-lL): Ready wind ow for drawing Set Port SetPo rt(theWindow) ; Location to start drawing Move To MoveTo(20 . 50) ; Draw a line of text Drawstring DrawString("\pThis i s a test. " ) ; Draw a line Line Line(l00 . 0) : Set up a rectang le SetRect SetRect(&theRect . 10 . 10 . 60 , 80) ; Draw a rectangle Fr ameRect FrameRect(&theRect) ; Bee ping the speake r …

Showing first 3,000 characters of 1,017,330 total. Open the full document →

mp.ls