上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 49 下一页
摘要: #include <stdio.h>void main(void) { enum { Monday, Tuesday, Wednesday, Thursday, Friday } day; for (day = Monday; day <= Friday; day++) if (day == Monday) printf("No fun---meetings all day Monday\n");... 阅读全文
posted @ 2012-06-04 12:30 XE2011 阅读(136) 评论(0) 推荐(0)
摘要: #include <conio.h>void main(void) { int i, j; window(1, 1, 40, 12); for (i = 0; i < 15; i++) { for (j = 0; j < 50; j++) cprintf("%d", j); cprintf("\r\n"); } }通过 Wiz 发布 阅读全文
posted @ 2012-06-04 12:30 XE2011 阅读(89) 评论(0) 推荐(0)
摘要: #include <stdio.h>void main(void) { char *workdays[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "" }; char **work_day; work_day = workdays; while (*work_day) printf("%s\n", *work_day+... 阅读全文
posted @ 2012-06-04 12:30 XE2011 阅读(138) 评论(0) 推荐(0)
摘要: #include <stdio.h>#include <dos.h>#include <string.h>// Note: If you want to use XMS function 0xB, this simple // xms_access routine only works for tiny, small, or medium // models where the value of ... 阅读全文
posted @ 2012-06-04 12:30 XE2011 阅读(152) 评论(0) 推荐(0)
摘要: #include <stdio.h>#include <string.h>void main (void) { char line[255]; // Line of text read while (fgets(line, sizeof(line), stdin)) fputs(strupr(line), stdout); }通过 Wiz 发布 阅读全文
posted @ 2012-06-04 12:29 XE2011 阅读(115) 评论(0) 推荐(0)
摘要: #include <stdio.h>Main () { printf ("This program does not compile."); }通过 Wiz 发布 阅读全文
posted @ 2012-06-04 12:29 XE2011 阅读(105) 评论(0) 推荐(0)
摘要: #include <stdio.h>void hello_world(void) { printf("Hello, world!\n"); }void main(void) { hello_world(); }通过 Wiz 发布 阅读全文
posted @ 2012-06-04 12:29 XE2011 阅读(146) 评论(0) 推荐(0)
摘要: procedure TForm1.Button1Click(Sender: TObject);beginSendMessage(ComboBox1.Handle, CB_SHOWDROPDOWN, 1,0);end;通过 Wiz 发布 阅读全文
posted @ 2012-06-03 17:56 XE2011 阅读(255) 评论(0) 推荐(0)
摘要: //WM_PAINT带背景的窗体private{ Private declarations }Bitmap:TBitmap;procedure WMPaint(var msg:TWMPAINT);Message WM_PAINT;procedure TForm1.WMPaint(var msg:TWMPAINT);begininherited;StretchBlt(canvas.Handle,0,... 阅读全文
posted @ 2012-06-03 17:56 XE2011 阅读(483) 评论(0) 推荐(0)
摘要: //sendmessage WM_PAINT带背景的窗体private{ Private declarations }Bitmap:TBitmap;procedure WMPaint(var msg:TWMPAINT);Message WM_PAINT;procedure TForm1.WMPaint(var msg:TWMPAINT);begininherited;StretchBlt(canv... 阅读全文
posted @ 2012-06-03 17:56 XE2011 阅读(223) 评论(0) 推荐(0)
摘要: //TMemo组件的光标定位privateprocedure MemoRow;{ Private declarations }varForm1: TForm1;procedure TForm1.MemoRow;varLpos,Cpos,LineLength:Integer;beginLpos := SendMessage(Memo1.Handle,em_linefromchar,Memo1.Sel... 阅读全文
posted @ 2012-06-03 17:56 XE2011 阅读(432) 评论(0) 推荐(0)
摘要: procedure TForm1.Button1Click(Sender: TObject);varHWndCalculator : HWnd;beginHWndCalculator := FindWindow(nil, '计算器'); // 查找计算器句柄if HWndCalculator <> 0 thenSendMessage(HWndCalculator, WM_CLOSE, 0, 0);... 阅读全文
posted @ 2012-06-03 17:55 XE2011 阅读(164) 评论(0) 推荐(0)
摘要: //if 条件语句条件语句通过条件检测,判断是否执行该条件语句中包含的语句。条件语句可有两种基本形式:if语句和case语句。If语句对if-then型语句,仅当条件满足时,语句才执行;对if-then-else型,if语句在两条语句中选择一条执行。procedure TForm1.Button1Click(Sender: TObject);begin// simple if statementi... 阅读全文
posted @ 2012-06-03 17:55 XE2011 阅读(200) 评论(0) 推荐(0)
摘要: //For循环{Pascal 中的for循环严格地建立在计数器基础上,循环每执行一次,计数器不是增加一个值就是减小一个值。注意:用 Break 和 Continue 系统过程可以改变循环执行的标准流程。Break中断循环;Continue直接跳至循环测试句,或使计数器增加一个步长,然后继续循环(除非条件为空或计数器达到最大值)。还有两个系统过程 Exit 和 Halt,让你立即从函数或过程中返回,... 阅读全文
posted @ 2012-06-03 17:55 XE2011 阅读(129) 评论(0) 推荐(0)
摘要: uses ShellAPI;{$IFNDEF Win32}//Var上面end;下面function ShellAbout(Wnd: HWnd; App, Stuff: PChar; Icon: HIcon): Integer; far; external 'shell';{$ENDIF}procedure TForm1.Button1Click(Sender: TObject);beginShe... 阅读全文
posted @ 2012-06-03 17:55 XE2011 阅读(159) 评论(0) 推荐(0)
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 49 下一页