VB常用代码大全
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
#define __LLF_VB_GUI__
#include "vb.h"
//Sub Output( ByRef( msg As String ) ) { //why can't replace ',' ? Sub Output( ByRef( msg , String ) ) { //must add '{' now .
Call Print( msg ); //must add ';' .
End_Sub
Sub Main() {
If False Or False Then
Call Output( "That's True!\n" ); //must add ';' .
Else
Call Output( "That't False!\n" ); //must add ';'.
End_If
int i = 0;
//For( i, 0 To 10 ) //why can't replace ',' ?
For( i, 0, 10 )
Print( i );
Next
Pause();
End_Sub
#ifndef __LLF_VISUAL_BASIC_LIKE_MODULE_MAIN__
#define __LLF_VISUAL_BASIC_LIKE_MODULE_MAIN__
#include
inline void Print(const char *msg){ printf(msg); }
inline void Print(int i){ printf( "%i\n", i); }
inline void Pause() { getchar(); }
void Main();
int main (int argc, char *argv[]) { Main(); return 0; }
#endif
#ifndef __LLF_VISUAL_BASIC_LIKE_MODULE__
#define __LLF_VISUAL_BASIC_LIKE_MODULE__
//Ö÷º¯Êý¶¨ÒåÓëʹÓÃ
#ifdef __LLF_VB_GUI__
#include "winmain.h"
#else
#include "main.h"
#endif
//ÀàÐͶ¨Òå
#define Integer int
#define String char
#define Boolean bool
#define True true
#define False false
// Óï·¨Ïà¹Ø²¿·ÖµÄºê¶¨Òå
#define If if(
#define Then ){
#define End_If }
#define Or ||
#define And &&
#define Else }else{
#define To #@,
#define For(i, min , max) for(i=min;i<=max;i++){
#define Next }
//½á¹¹Ïà¹Ø²¿·ÖµÄºê¶¨Òå
#define Call
#define Sub void
#define NewSub(x) void x {
#define End_Sub }
#define As ,
#define ByRef(m, t) t *m
#define ByVal(m, t) t m
#endif
#ifndef __LLF_VISUAL_BASIC_LIKE_MODULE_MAIN__
#define __LLF_VISUAL_BASIC_LIKE_MODULE_MAIN__
#include
inline void Print(const char *msg){ MessageBox(NULL, msg, "vb", MB_OK); }
inline void Print(int i){ char s[1024]; Print( itoa(i, s, 1023) ); } inline void Pause() { Print("** Pause **"); }
void Main();
int WINAPI WinMain(HINSTANCE, HINSTANCE,LPSTR, int) { Main(); return 0; }
#endif