Andrew Cattle found this in a legacy system. I wonder what would have taken longer: this or actually porting the code from VB to C++?
#include <windows.h>
/* Message Box Variables */
#define vbAbortRetryIgnore MB_ABORTRETRYIGNORE
#define vbApplicationModal MB_APPLMODAL
#define vbDefaultButton1 MB_DEFBUTTON1
#define vbDefaultButton2 MB_DEFBUTTON2
#define vbDefaultButton3 MB_DEFBUTTON3
#define vbDefaultButton4 MB_DEFBUTTON4
#define vbExclamation MB_ICONEXCLAMATION
#define vbInformation MB_ICONINFORMATION
#define vbMsgBoxHelpButton MB_HELP
#define vbMSgBoxRight MB_RIGHT
#define vbMsgBoxRtlReading MB_RTLREADING
#define vbMsgBoxSetForeground MB_SETFOREGROUND
#define vbOKCancel MB_OKCANCEL
#define vbOKOnly MB_OK
#define vbQuestion MB_ICONQUESTION
#define vbRetryCancel MB_RETRYCANCEL
#define vbSystemModal MB_SYSTEMMODAL
#define vbYesNo MB_YESNO
#define vbYesNoCancel MB_YESNOCANCEL
#define vbYes IDYES
#define vbNo IDNO
/* Waste */
#define Option
#define Explicit
/* Wahhh */
#define Private
#define Sub
#define End ;return 0;}
#define Form_Load() int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
/* Variables */
#define Dim int
#define As
#define Integer ;
/* Logic */
#define Or ||
#define And &&
#define If ;if (
#define Then ) {
#define EndIf ;}
#define Else ;} else {
#define Call
/* Functions */
#define MsgBox(a,b,c) MessageBox(NULL,a,c,b)
/* And So On */
Option Explicit
Private Sub Form_Load()
//real code changed to protect the innocent
Dim i As Integer
i = 100
If MsgBox("Are you alright?", vbYesNo,"Question") = vbNo Then
Call MsgBox("Thats Very Good!",vbInformation ,"Answer")
Else
Call MsgBox("Thats NOT Very Good!",vbInformation ,"Answer")
EndIf
Call MsgBox("By the way, Pointless integer called i here",vbInformation ,"BTW")
End Sub
Also, on another note ... Last Wednesday, my frusteration level with Oracle grew to a record high, inspiring me to join the I-Hate-Oracle Club (IHOC). Feel free to join the IHOC as well ;-).
[Advertisement]
BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!