Browse Source

Added Examples/Tests folder

Armando Rivera 8 months ago
parent
commit
05fe9c49a7
100 changed files with 3992 additions and 0 deletions
  1. 7 0
      Examples/CPP/build.sh
  2. 10 0
      Examples/CPP/clean.sh
  3. 20 0
      Examples/CPP/namespace.bas
  4. 99 0
      Examples/CPP/virtual.bas
  5. 181 0
      Examples/Console/NotWorking/S100.bas
  6. 53 0
      Examples/Console/NotWorking/S101.bas
  7. 92 0
      Examples/Console/NotWorking/S105.bas
  8. 21 0
      Examples/Console/NotWorking/S114.bas
  9. 25 0
      Examples/Console/NotWorking/S116.bas
  10. 53 0
      Examples/Console/NotWorking/S119.bas
  11. 43 0
      Examples/Console/NotWorking/S126.bas
  12. 127 0
      Examples/Console/NotWorking/S128.bas
  13. 24 0
      Examples/Console/NotWorking/S131.bas
  14. 23 0
      Examples/Console/NotWorking/S137.bas
  15. 10 0
      Examples/Console/NotWorking/S140.bas
  16. 23 0
      Examples/Console/NotWorking/S149.bas
  17. 370 0
      Examples/Console/NotWorking/S152.bas
  18. 119 0
      Examples/Console/NotWorking/S153.bas
  19. 78 0
      Examples/Console/NotWorking/S154.bas
  20. 30 0
      Examples/Console/NotWorking/S18.bas
  21. 26 0
      Examples/Console/NotWorking/S35.bas
  22. 25 0
      Examples/Console/NotWorking/S42.bas
  23. 22 0
      Examples/Console/NotWorking/S48.bas
  24. 7 0
      Examples/Console/NotWorking/S51.bas
  25. 29 0
      Examples/Console/NotWorking/S53.bas
  26. 7 0
      Examples/Console/NotWorking/S58.bas
  27. 16 0
      Examples/Console/NotWorking/S60.bas
  28. 22 0
      Examples/Console/NotWorking/S65.bas
  29. 18 0
      Examples/Console/NotWorking/S66.bas
  30. 33 0
      Examples/Console/NotWorking/S67.bas
  31. 13 0
      Examples/Console/NotWorking/S68.bas
  32. 5 0
      Examples/Console/NotWorking/S69.bas
  33. 109 0
      Examples/Console/NotWorking/S70.bas
  34. 77 0
      Examples/Console/NotWorking/S71.bas
  35. 15 0
      Examples/Console/NotWorking/S72.bas
  36. 26 0
      Examples/Console/NotWorking/S73.bas
  37. 29 0
      Examples/Console/NotWorking/S74.bas
  38. 39 0
      Examples/Console/NotWorking/S77.bas
  39. 15 0
      Examples/Console/NotWorking/S78.bas
  40. 116 0
      Examples/Console/NotWorking/S79.bas
  41. 61 0
      Examples/Console/NotWorking/S85.bas
  42. 21 0
      Examples/Console/NotWorking/S88.bas
  43. 107 0
      Examples/Console/NotWorking/S90.bas
  44. 59 0
      Examples/Console/NotWorking/S92.bas
  45. 64 0
      Examples/Console/NotWorking/S94.bas
  46. 13 0
      Examples/Console/NotWorking/S96.bas
  47. 15 0
      Examples/Console/NotWorking/S98.bas
  48. 333 0
      Examples/Console/NotWorking/s100.c
  49. 22 0
      Examples/Console/S00.bas
  50. 17 0
      Examples/Console/S01.bas
  51. 20 0
      Examples/Console/S02.bas
  52. 12 0
      Examples/Console/S03.bas
  53. 25 0
      Examples/Console/S04.bas
  54. 7 0
      Examples/Console/S05.bas
  55. 7 0
      Examples/Console/S06.bas
  56. 13 0
      Examples/Console/S07.bas
  57. 11 0
      Examples/Console/S08.bas
  58. 9 0
      Examples/Console/S09.bas
  59. 31 0
      Examples/Console/S10.bas
  60. 14 0
      Examples/Console/S102.bas
  61. 39 0
      Examples/Console/S103.bas
  62. 19 0
      Examples/Console/S104.bas
  63. 9 0
      Examples/Console/S106.bas
  64. 37 0
      Examples/Console/S107.bas
  65. 21 0
      Examples/Console/S108.bas
  66. 14 0
      Examples/Console/S109.bas
  67. 3 0
      Examples/Console/S11.bas
  68. 49 0
      Examples/Console/S110.bas
  69. 61 0
      Examples/Console/S111.bas
  70. 24 0
      Examples/Console/S112.bas
  71. 22 0
      Examples/Console/S113.bas
  72. 22 0
      Examples/Console/S115.bas
  73. 35 0
      Examples/Console/S117.bas
  74. 22 0
      Examples/Console/S118.bas
  75. 19 0
      Examples/Console/S12.bas
  76. 37 0
      Examples/Console/S120.bas
  77. 26 0
      Examples/Console/S121.bas
  78. 28 0
      Examples/Console/S122.bas
  79. 25 0
      Examples/Console/S123.bas
  80. 24 0
      Examples/Console/S124.bas
  81. 28 0
      Examples/Console/S125.bas
  82. 37 0
      Examples/Console/S127.bas
  83. 27 0
      Examples/Console/S129.bas
  84. 18 0
      Examples/Console/S13.bas
  85. 27 0
      Examples/Console/S130.bas
  86. 11 0
      Examples/Console/S132.bas
  87. 5 0
      Examples/Console/S133.bas
  88. 58 0
      Examples/Console/S134.bas
  89. 24 0
      Examples/Console/S135.bas
  90. 19 0
      Examples/Console/S136.bas
  91. 30 0
      Examples/Console/S138.bas
  92. 30 0
      Examples/Console/S139.bas
  93. 11 0
      Examples/Console/S14.bas
  94. 27 0
      Examples/Console/S141.bas
  95. 17 0
      Examples/Console/S142.bas
  96. 42 0
      Examples/Console/S143.bas
  97. 49 0
      Examples/Console/S144.bas
  98. 57 0
      Examples/Console/S145.bas
  99. 21 0
      Examples/Console/S146.bas
  100. 0 0
      Examples/Console/S147.bas

+ 7 - 0
Examples/CPP/build.sh

@@ -0,0 +1,7 @@
+#!/bin/sh
+
+for f in *.bas;do
+	../../mbc4 $f -q -t
+done
+
+rm *.cpp

+ 10 - 0
Examples/CPP/clean.sh

@@ -0,0 +1,10 @@
+#!/bin/sh
+
+for f in *.bas; do
+	echo "--------"
+	echo "Removing  ${f%%.*} Executable..."
+	rm -f ./${f%%.*}
+	echo "--------"
+done
+
+

+ 20 - 0
Examples/CPP/namespace.bas

@@ -0,0 +1,20 @@
+$CPP
+$NOMAIN
+$EXECON
+'==============================================================================
+NAMESPACE Dlg_01
+	Sub DoIt()
+		Print "Dlg_01"
+	End Sub
+	
+	Function GetString$(A$) as string
+		function = "The String you Passed Was: " + enc$(A$)
+	end function
+END NAMESPACE
+'==============================================================================
+Function main(argc as INTEGER, argv as PCHAR ptr) as INTEGER
+	Print "James"
+	Dlg_01::DoIt()
+	print Dlg_01::GetString$("Hello, World!")	
+End Function
+

+ 99 - 0
Examples/CPP/virtual.bas

@@ -0,0 +1,99 @@
+'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
+'This example is from the article: How I explained Design Patterns to my wife : Part 1
+' Located Here: http://www.codeproject.com/KB/architecture/LearningDesignPatterns1.aspx
+'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
+$CPP
+$EXECON
+
+$NOMAIN
+ 
+Class IElectricalEquipment
+	public
+
+		Virtual sub PowerOn() = 0
+		Virtual sub PowerOff() = 0
+End Class
+'==============================================================================
+Class Fan  Inherits IElectricalEquipment 
+	public
+		Sub PowerOn()
+		Sub PowerOff()
+End Class
+
+Sub Fan::PowerOn()
+	Print "Fan is On"
+End Sub
+
+Sub Fan::PowerOff()
+	Print "Fan is Off"
+End Sub
+'==============================================================================
+Class Light Inherits IElectricalEquipment
+	public
+		Sub PowerOn()
+		Sub PowerOff()
+End Class
+
+Sub Light::PowerOn()
+	Print "Light is On"
+End Sub
+
+Sub Light::PowerOff()
+	Print "Light is Off"
+End Sub
+'==============================================================================
+Class Switch
+	public
+		Raw equipment As IElectricalEquipment* 
+		Sub On()
+		Sub Off()
+		Function get() As IElectricalEquipment Ptr
+		Sub set(param As IElectricalEquipment*)
+End Class
+
+Sub Switch::On()
+	Print "Switch On the Equipment"
+	equipment->PowerOn()
+End Sub
+
+Sub Switch::Off()
+	Print "Switch Off the Equipment"
+	equipment->PowerOff()	
+End Sub
+
+Function Switch::get() As IElectricalEquipment*
+	Function = equipment
+End Function
+
+Sub Switch::set(p As IElectricalEquipment*)
+	equipment = p
+End Sub
+''==============================================================================
+Class NormalSwitch Inherits Switch
+	
+End Class
+''==============================================================================
+Class FancySwitch Inherits Switch
+
+End Class
+
+
+
+
+Function main( argc As Integer,argv As char Ptr Ptr)
+	Raw f As IElectricalEquipment Ptr
+	Raw l AS IElectricalEquipment Ptr
+	Raw fs As Switch Ptr
+	Raw ns AS Switch Ptr
+	
+	 f = new Fan()
+	 l = new Light()
+	 fs = new FancySwitch()
+	 ns = new NormalSwitch()
+	 fs->set(f)
+	 fs->On()
+	 fs->Off()
+	 ns->set(l)
+	 ns->On()
+	 ns->Off()  
+End Function

+ 181 - 0
Examples/Console/NotWorking/S100.bas

@@ -0,0 +1,181 @@
+$execon
+
+Dim A$,B$,C$
+
+Cls
+Color 3,0
+Locate 6,23,0
+Print "The Ascii Macarena Dance"
+
+Locate 24,12,0
+Color  7,0
+Print "Created Using Bcx -- The Free Basic To C Translator";
+
+Do
+
+Color 9,0
+Locate 8,26,0
+Print "Press Any Key to Quit"
+Sleep (500)
+
+' ---------- Step One ------------
+
+  A$ = " o "
+  B$ = "^|\"
+  C$ = " /\"
+
+  Dance (A$, B$, C$, 3)
+
+' --------- Step Two --------------
+
+  A$ = " o "
+  B$ = "^|^"
+  C$ = " >\"
+
+  Dance (A$, B$, C$, 4)
+
+' --------- Step Three -------------
+
+  A$ = " o "
+  B$ = "v|^"
+  C$ = "/< "
+
+  Dance (A$, B$, C$, 5)
+
+' --------- Step Four ---------------
+
+  A$ = " o "
+  B$ = "v|^"
+  C$ = " >\"
+
+  Dance (A$, B$, C$, 4)
+
+' --------- Step Five ----------------
+
+  A$ = " o "
+  B$ = "|/^"
+  C$ = "/< "
+
+  Dance (A$, B$, C$, 3)
+
+' ---------- Step Six -----------------
+
+  A$ = " o "
+  B$ = "|-|"
+  C$ = " >\"
+
+  Dance (A$, B$, C$, 4)
+
+' ----------- Step Seven ---------------
+
+  A$ = " <o "
+  B$ = "//| "
+  C$ = "/<  "
+
+  Dance (A$, B$, C$, 5)
+
+' ----------- Step Eight -----------------
+
+  A$ = "<o> "
+  B$ = " |  "
+  C$ = " >//"
+
+  Dance (A$, B$, C$, 4)
+
+' ----------- Step Nine ------------------
+
+  A$ = " o> "
+  B$ = " // "
+  C$ = "/<  "
+
+  Dance (A$, B$, C$, 3)
+
+' ----------- Step Ten ------------------
+
+  A$ = " o "
+  B$ = " x "
+  C$ = " >\"
+
+  Dance (A$, B$, C$, 4)
+
+' ----------- Step Eleven ---------------
+
+  A$ = " o "
+  B$ = "</ "
+  C$ = "/< "
+
+  Dance (A$, B$, C$, 5)
+
+' ----------- Step Twelve ------------------
+
+  A$ = " o "
+  B$ = "<|>"
+  C$ = " >\"
+
+  Dance (A$, B$, C$, 4)
+
+' ----------- Step Thirteen ----------------
+
+  A$ = " o "
+  B$ = "</>"
+  C$ = "/< "
+
+  Dance (A$, B$, C$, 3)
+
+' ----------- Step Fourteen ---------------
+
+  A$ = " o "
+  B$ = "<\>"
+  C$ = " >\"
+
+  Dance (A$, B$, C$, 4)
+
+' ----------- Step Fifteen ---------------
+
+  A$ = " o "
+  B$ = "<)>"
+  C$ = " >>"
+
+  Dance (A$, B$, C$, 4)
+
+' ----------- Step Sixteen ----------------
+
+  A$ = " o "
+  B$ = " )\"
+  C$ = " LL"
+
+  Dance (A$, B$, C$, 5)
+
+Loop
+
+
+
+
+Sub Dance ( A$,B$,C$,Dlay )
+Local Kolor
+
+If Instat Then
+  Locate 1,1,1
+  Color 7,0
+  Cls
+  End
+End If
+
+Color 4,0
+Color 6,0 : Locate 12,33,0 : Print A$
+Color 4,0 : Locate 13,33,0 : Print B$
+Color 9,0 : Locate 14,33,0 : Print C$
+
+Sleep (Dlay * 100)
+
+Locate 24,12,0
+Kolor = Kolor +1
+If Kolor =  0 then Kolor++
+If Kolor = 15 then Kolor = 1
+Color  Kolor,0
+Print "Created Using Bcx -- The Free Basic To C Translator";
+
+Color 15,0
+Locate 8,26,0
+Print "Press Any Key to Quit"
+End Sub

+ 53 - 0
Examples/Console/NotWorking/S101.bas

@@ -0,0 +1,53 @@
+$execon
+
+
+Print OsVersion$(), " detected"
+
+Function OsVersion$()
+Dim os As OSVERSIONINFO
+os.dwOSVersionInfoSize = SizeOf(os)
+If GetVersionEx(&os) Then
+  Select Case os.dwPlatformId
+
+    Case 1
+    IF os.dwMinorVersion = 0  THEN
+
+     IF os.szCSDVersion[1] <> 66 AND os.szCSDVersion[1] <> 67 THEN
+       Function = "Windows 95"
+     END IF
+     IF os.szCSDVersion[1] = 66 OR os.szCSDVersion[1] = 67 THEN
+       Function = "Windows 95 OSR2"
+     END IF
+    End If
+    IF os.dwMinorVersion = 10 THEN
+     IF os.szCSDVersion[1] = 65 THEN
+       Function = "Windows 98 Second Edition"
+     END IF
+     IF os.szCSDVersion[1] <> 65 THEN
+       Function = "Windows 98"
+     END IF
+    End If
+    IF os.dwMinorVersion = 90 THEN
+      Function = "Windows Millennium"
+    End If
+
+    Case 2   '  Windows NT 3.51
+    IF os.dwMajorVersion = 3 THEN
+      Function = "Windows NT 3.51"
+    End If
+    IF os.dwMajorVersion = 4 THEN
+      Function = "Windows NT 4.0"
+    End If
+    IF os.dwMajorVersion = 5 THEN
+     IF os.dwMinorVersion = 0 THEN
+      Function = "Windows 2000"
+     End If
+     IF os.dwMinorVersion = 1 THEN
+      Function = "Windows XP"
+     End If
+    End If
+
+  End Select
+End If
+Function = 0
+End Function

+ 92 - 0
Examples/Console/NotWorking/S105.bas

@@ -0,0 +1,92 @@
+$execon
+
+Dim Arg$
+Dim F$
+
+Arg$ = COMMAND$
+
+If Arg$ = "" Then
+  Color 7,0
+  Cls
+  Print "-----------------------------------------------------------------"
+  Color 2,0
+  Print "PickFile 1.0 by Kevin Diggins ( 32 bit Freeware ) For Win95/98/NT"
+  Color 7,0
+  Print "-----------------------------------------------------------------"
+  Print "PickFile provides commandline users with a Windows File Dialog"
+  Print "from which to choose and then pass on the selected filename to "
+  Print "the program specified on the command line by the user."
+  Print "-----------------------------------------------------------------"
+  Color 2,0
+  Print "For Example:    PickFile C:\Windows\Command\EDIT"
+  Color 7,0
+  Print "takes the file chosen from the Windows File Dialog and then"
+  Print "passes it to EDIT, which is a simple MSDOS text editor."
+  Print "-----------------------------------------------------------------"
+  End
+End If
+
+F$ = "*.*"
+
+OpenFileDialog (0,"PickFile v1.0 by Kevin Diggins",F$,"","All","*.*",0)
+
+If F$ <> "*.*" Then
+  Arg$ = Arg$ & " " & F$
+  Shell Arg$
+End If
+
+
+
+
+FUNCTION OpenFileDialog _
+(                       _
+    hWnd AS HWND      , _
+    zCaption$         , _
+    zFilespec$        , _
+    zInitialDir$      , _
+    zFilter$          , _
+    zDefExtension$    , _
+    Flags               _
+)
+
+LOCAL ofn AS OPENFILENAME
+LOCAL File$
+LOCAL FileTitle$
+LOCAL Filter$
+LOCAL InitialDir$
+LOCAL Title$
+LOCAL DefExt$
+LOCAL RetFlg
+
+IF Len(zInitialDir$) = 0 Then
+  InitialDir$ = CURDIR$
+End If
+
+Filter$               = zFilter$
+InitialDir$           = zInitialDir$
+File$                 = zFilespec$
+DefExt$               = zDefExtension$
+Title$                = zCaption$
+
+ofn.lStructSize       = SIZEOF(ofn)
+ofn.hwndOwner         = hWnd
+ofn.lpstrFilter       = Filter$
+ofn.nFilterIndex      = 1
+ofn.lpstrFile         = File$
+ofn.nMaxFile          = SIZEOF(File$)
+ofn.lpstrFileTitle    = FileTitle$
+ofn.nMaxFileTitle     = SIZEOF(FileTitle$)
+ofn.lpstrInitialDir   = InitialDir$
+ofn.Flags             = Flags
+ofn.lpstrDefExt       = DefExt$
+
+If Len(Title$) > 0 Then
+  ofn.lpstrTitle       = Title$
+End If
+
+RetFlg = GetOpenFileName(&ofn)
+
+zFilespec$ = File$
+Flags    = ofn.Flags
+Function = RetFlg
+End Function

+ 21 - 0
Examples/Console/NotWorking/S114.bas

@@ -0,0 +1,21 @@
+$execon
+
+'  ******************************************************************
+'  EWX_FORCE Forces processes to terminate. When this flag is set,
+'  Windows doesn't send WM_QUERYENDSESSION and WM_ENDSESSION messages to
+'  running applications in the system. This can cause the applications to
+'  lose data. Therefore, you should only use this flag in an emergency.
+'
+'  EWX_LOGOFF Shuts down all processes running in the security context of the
+'  process that called the ExitWindowsEx function and logs the user off.
+'
+'  EWX_POWEROFF Shuts down the system and turns off the power, if supported.
+'
+'  EWX_REBOOT Shuts down the system and then restarts the system.
+'
+'  EWX_SHUTDOWN Shuts down the system to a point at which it is safe to
+'  turn off the power. All file buffers have been flushed to disk, and
+'  all running processes have stopped.
+'  ******************************************************************
+
+ExitWindowsEx ( EWX_LOGOFF, 0 )

+ 25 - 0
Examples/Console/NotWorking/S116.bas

@@ -0,0 +1,25 @@
+$execon
+
+'===========================================
+'Read & Write Ini Files Easily Using BCX
+'===========================================
+Dim Length
+Dim Info$
+Dim MyIni$
+
+MyIni$ = TEMPDIR$ & "\test-ini.ini"
+
+PutIni ("Header","Title","Value",MyIni$)
+Info$ = GetIni ("Header","Title",MyIni$)
+Print Info$
+
+Sub PutIni( Section$, Var$, Value$, File$)
+WritePrivateProfileString( Section$, Var$, Value$, File$)
+End Sub
+
+Function GetIni$ (Section$, Var$, File$)
+Dim Buffer$ * MAX_PATH
+Length  = GetPrivateProfileString(Section$,Var$,"",Buffer$,MAX_PATH,File$)
+Buffer$  = Left$(Buffer$,Length)
+Function = Buffer$
+End Function

+ 53 - 0
Examples/Console/NotWorking/S119.bas

@@ -0,0 +1,53 @@
+$execon
+
+DrawBox (20,5,60,20,3,4,11,9,3,"BCX  ROCKS!")
+
+
+While Not Instat
+  Locate 12,34,0
+  Color 4,9
+  Print "BCX  ROCKS!";
+  Sleep(200)
+  Locate 12,34,0
+  Color 15,9
+  Print "BCX  ROCKS!";
+  Sleep(200)
+Wend
+Color 7,0 : Cls
+
+
+
+
+SUB DrawBox (X1,Y1,X2,Y2,Bdrfg,Bdrbg,Winfg,Winbg,Style,Title$)
+LOCAL Tb,Sid,Tlc,Trc,Blc,Brc,Tmp,Temp$
+
+Select Case Style
+'-----------------------------------------------------------------
+  Case 1          'Single Sides,Top And Bottom
+'-----------------------------------------------------------------
+  Tb=196  :  Sid=179  :  Tlc=218  :  Trc=191  :  Blc=192  :  Brc=217
+'-----------------------------------------------------------------
+  Case 2          'Double Sides,Top And Bottom
+'-----------------------------------------------------------------
+  Tb=205  :  Sid=186  :  Tlc=201  :  Trc=187  :  Blc=200  :  Brc=188
+'-----------------------------------------------------------------
+  Case 3          'Single Sides,Double Top And Bottom
+'-----------------------------------------------------------------
+  Tb=205  :  Sid=179  :  Tlc=213  :  Trc=184  :  Blc=212  :  Brc=190
+'-----------------------------------------------------------------
+End Select
+
+Temp$ = Chr$(Tlc) & String$(X2-X1-2,Tb) & Chr$(Trc)
+Locate Y1,X1,0  :  Color Bdrfg,Bdrbg  :  Print Temp$;
+Locate Y1,((X1+X2)/2) - (Len(Title$)/2),0  :  Print Title$;
+
+For Tmp = Y1+1 To Y2-1
+  Color Bdrfg,Bdrbg
+  Locate Tmp,X1,0    :  Print Chr$(Sid);
+  Color Winfg,Winbg  :  Print Space$(X2-X1-2);
+  Color Bdrfg,Bdrbg  :  Print Chr$(Sid);
+Next
+
+Temp$ = Chr$(Blc) & String$(X2-X1-2,Tb) & Chr$(Brc)
+Locate Y2,X1,0  :  Print Temp$;
+End Sub

+ 43 - 0
Examples/Console/NotWorking/S126.bas

@@ -0,0 +1,43 @@
+$execon
+
+'-------------------------------------------------
+'   BrowseFolder --  Original by Jacob Navia
+'   Converted to BCX version by Kevin Diggins
+'-------------------------------------------------
+
+$LIBRARY <shell32.lib>    ' link with shell32.lib
+
+Dim MyFolder$
+
+IF BrowseDir ( "Choose a directory", MyFolder$ ) THEN
+  PRINT "Chosen Folder: ", MyFolder$
+ELSE
+  Print "Action Cancelled"
+END IF
+
+FUNCTION BrowseDir ( Title$, Result$ )
+'---------------------------------------
+LOCAL pMalloc      AS LPMALLOC
+LOCAL browseInfo   AS BROWSEINFO
+LOCAL lpItemIDList AS LPITEMIDLIST
+LOCAL Rc
+
+'---------------------------------------
+IF S_OK <> SHGetMalloc(&pMalloc) THEN EXIT FUNCTION
+memset ( &browseInfo, 0, sizeof(BROWSEINFO))
+browseInfo.hwndOwner      = GetActiveWindow()
+browseInfo.pszDisplayName = Result$
+browseInfo.lpszTitle      = Title$
+browseInfo.ulFlags = BIF_NEWDIALOGSTYLE
+
+lpItemIDList = SHBrowseForFolder(&browseInfo)
+IF lpItemIDList <> NULL THEN
+  Result$ = ""
+  IF SHGetPathFromIDList(lpItemIDList,Result$) THEN
+    IF LEN(Result$) > 0 THEN Rc = 1
+  END IF
+  pMalloc->lpVtbl->Free ( pMalloc,lpItemIDList )
+END If
+pMalloc->lpVtbl->Release (pMalloc)     ' BCX is amazing !
+FUNCTION = Rc
+END FUNCTION

+ 127 - 0
Examples/Console/NotWorking/S128.bas

@@ -0,0 +1,127 @@
+$execon
+
+' ---------------------------------------------------------------
+'   Console utility used to retrieve files from a HTTP server.
+' ---------------------------------------------------------------
+' From the book WinSock 2.0 by Lewis Napper covering programming
+' with sockets.      Adapted to BCX BASIC by Kevin Diggins
+' ---------------------------------------------------------------
+$LIBRARY <WSOCK32.LIB>               ' LINK WITH WSOCK32.LIB
+
+#include <fcntl.h>
+
+GLOBAL wsaData AS WSADATA
+GLOBAL wVersionRequested
+GLOBAL nRet
+
+
+wVersionRequested  = MAKEWORD(1,1)
+
+
+IF ARGC <> 3 THEN
+  PRINT "Syntax : GetHTTP    ServerName   PathAndFileName"
+  PRINT "Example: GetHTTP   www.yahoo.com   index.html"
+  END
+END IF
+
+
+nRet = WSAStartup(wVersionRequested, &wsaData)
+
+
+IF nRet THEN
+  PRINT "WSAStartup()", nRet
+  WSACleanup()
+  END
+END IF
+
+
+IF wsaData.wVersion <> wVersionRequested THEN
+  PRINT "WinSock version not supported"
+  WSACleanup()
+  END
+END IF
+
+
+_setmode(_fileno(stdout), _O_BINARY)
+
+GetHTTP (ARGV[1], ARGV$[2])
+
+WSACleanup()
+
+
+
+
+
+
+
+SUB GetHTTP (lpServerName$, lpFileName$)
+' =======================================
+DIM  LOCAL  nRet
+DIM  LOCAL  iaHost       AS  IN_ADDR
+DIM  LOCAL  lpHostEntry  AS  LPHOSTENT
+DIM  LOCAL  Socket       AS  SOCKET
+DIM  LOCAL  lpServEnt    AS  LPSERVENT
+DIM  LOCAL  saServer     AS  SOCKADDR_IN
+DIM  LOCAL  szBuffer$
+' =======================================
+
+iaHost.s_addr = inet_addr(lpServerName)
+
+IF iaHost.s_addr = INADDR_NONE THEN
+  lpHostEntry = gethostbyname(lpServerName$)
+ELSE
+  lpHostEntry = gethostbyaddr((char*)&iaHost, SIZEOF(IN_ADDR), AF_INET)
+END IF
+
+IF lpHostEntry = NULL THEN
+  PRINT "Error: HOST NOT FOUND : gethostbyname()"
+  END
+END IF
+
+Socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)
+
+IF Socket = INVALID_SOCKET THEN
+  PRINT "Error: INVALID_SOCKET : socket ()"
+  END
+END IF
+
+lpServEnt = getservbyname("http", "tcp")
+
+IF lpServEnt = NULL THEN
+  saServer.sin_port = htons(80)
+ELSE
+  saServer.sin_port = lpServEnt->s_port
+END IF
+
+saServer.sin_family = AF_INET
+saServer.sin_addr = *((LPIN_ADDR)*lpHostEntry->h_addr_list)
+nRet = connect (Socket, (LPSOCKADDR)&saServer, SIZEOF (SOCKADDR_IN))
+
+IF nRet = SOCKET_ERROR THEN
+  PRINT "Error: SOCKET_ERROR : connect()"
+  closesocket(Socket)
+  END
+END IF
+
+szBuffer$ = "GET " & CHR$(13) & CHR$(10) & lpFileName$
+nRet      =  send(Socket, szBuffer$, LEN (szBuffer$), 0)
+
+IF nRet = SOCKET_ERROR THEN
+  PRINT "Error: SOCKET_ERROR : send()"
+  closesocket(Socket)
+  END
+END IF
+
+WHILE (TRUE)
+  nRet = recv(Socket, szBuffer$, SIZEOF(szBuffer$),0)
+  IF nRet = SOCKET_ERROR THEN
+    PRINT "Error: SOCKET_ERROR : recv()"
+    EXIT LOOP
+  END IF
+  IF nRet = 0 THEN
+    EXIT LOOP
+  END IF
+  PRINT szBuffer$
+WEND
+closesocket(Socket)
+END SUB

+ 24 - 0
Examples/Console/NotWorking/S131.bas

@@ -0,0 +1,24 @@
+$execon
+
+DIM a as string
+DIM b as integer
+DIM c as double
+
+a   = Foo  ("hello"," there") : Print a
+b   = Foo  (123)              : Print b
+c   = Foo  ( 7.01 )           : Print c
+
+
+overloaded function Foo (b as integer) as integer
+function = b
+end function
+
+
+overloaded function Foo (a as string, b as string) as string
+function = a & b
+end function
+
+
+overloaded function Foo (b as double ) as double
+function = b * b
+end function

+ 23 - 0
Examples/Console/NotWorking/S137.bas

@@ -0,0 +1,23 @@
+$execon
+
+DIM Url$
+DIM Fil$
+
+IF Argc < 3 THEN
+  COLOR 2,0
+  PRINT "Usage : Download            RemoteURL              LocalFileName.ext"
+  COLOR 1,0
+  PRINT "********************************************************************"
+  COLOR 12,0
+  PRINT "Sample: Download  http://www.yahoo.com/index.html  c:\temp\yahoo.htm"
+  END
+END IF
+
+Url$ = Argv$[1]
+Fil$ = Argv$[2]
+
+IF DOWNLOAD (Url$,Fil$) THEN
+  PRINT "Download Successful"
+ELSE
+  PRINT "Download UnSuccessful"
+END IF

+ 10 - 0
Examples/Console/NotWorking/S140.bas

@@ -0,0 +1,10 @@
+$execon
+
+CLS
+COLOR 4,0
+LOCATE 1,1
+PRINT "ABC";
+COLOR 7,0
+PRINT
+PRINT "The ASCII Value of the Char at Y,X [1,2] =", SCREEN(1,2)
+PRINT "The Color Attribute of Char at Y,X [1,2] =", SCREEN(1,2,1)

+ 23 - 0
Examples/Console/NotWorking/S149.bas

@@ -0,0 +1,23 @@
+$execon
+
+' --------------------------------------------------------------------
+' Shows how to multi-select files using Windows common dialog
+' Thanks to Larry Keys for enhancing GETFILENAME$ to support this
+' --------------------------------------------------------------------
+
+DIM A$ * 500000
+
+DIM FileName$[10000]
+DIM i,o
+
+A$ = GETFILENAME$ _
+("OPEN","Bas Files(*.bas)|*.bas;",0,NULL,OFN_EXPLORER|OFN_ALLOWMULTISELECT)
+
+IF INCHR(A$,",") >0 THEN
+  o = SPLIT(FileName$,A$,",")      'multiple files separated by commas!
+  FOR i = 1 TO o-1
+    PRINT i; ") "; FileName$[i]
+  NEXT
+ELSE
+  PRINT A$
+END IF

+ 370 - 0
Examples/Console/NotWorking/S152.bas

@@ -0,0 +1,370 @@
+$execon
+
+
+
+CONST MaxFlights = 100
+
+TYPE FL
+  Depart[20] AS CHAR
+  Arrival[20] AS CHAR
+  Distance AS INTEGER
+  Skip AS INTEGER
+END TYPE
+
+TYPE STACK
+  Depart[20] AS CHAR
+  Arrival[20] AS CHAR
+  Distance AS INTEGER
+END TYPE
+
+
+GLOBAL Flight[MaxFlights] AS FL
+GLOBAL Bt_Stack[MaxFlights] AS STACK
+GLOBAL Solution[MaxFlights] AS STACK
+GLOBAL F_pos AS INTEGER
+GLOBAL Find_pos AS INTEGER
+GLOBAL tos AS INTEGER
+GLOBAL stos AS INTEGER
+GLOBAL start$
+GLOBAL end$
+GLOBAL gdist AS INTEGER
+GLOBAL c1$
+GLOBAL c2$
+GLOBAL c3$
+GLOBAL Use_Method
+GLOBAL RouteTest
+GLOBAL dd
+GLOBAL tt
+CONST Depth   = 0
+CONST Width   = 1
+CONST Path    = 2
+CONST Node    = 3
+CONST Optimal = 4
+
+PRINT "From ";
+INPUT start$
+PRINT "to ";
+INPUT end$
+'start$ = "New York"
+'end$ = "Los Angeles"
+'start$ = "Calgary"
+'end$ = "Houston"
+
+CALL Setup
+dd = Find(start$,end$)
+
+IF dd THEN
+  PRINT "Direct Route, Distance is ";dd
+  getchar()
+  END = 0
+END IF
+
+CALL Setup
+PRINT
+PRINT "Search by Depth"
+Use_Method = Depth
+IsFlight(start$, end$)
+
+CALL Setup
+PRINT
+PRINT "Search by Width"
+Use_Method = Width
+IsFlight(start$, end$)
+
+CALL Setup
+PRINT
+PRINT "Search by Path Removal"
+Use_Method = Path
+DO
+  RouteTest = IsFlight(start$, end$)
+  tos = 0
+LOOP WHILE RouteTest > 0
+
+CALL Setup
+PRINT
+PRINT "Search by Node Removal"
+Use_Method = Node
+DO
+  RouteTest = IsFlight(start$, end$)
+  CALL ClearMarkers
+  IF tos > 0 THEN
+    CALL Pop(c2$, c3$, &gdist)
+    CALL Pop(c1$, c3$, &gdist)
+    CALL Retract(c1$, c2$)
+    tos = 0
+  END IF
+LOOP WHILE RouteTest > 0
+
+CALL Setup
+Use_Method = Optimal
+PRINT
+PRINT "Optimal Search"
+RouteTest = IsFlight(start$, end$)
+tt = 0
+dd = 0
+WHILE tt < stos
+  PRINT Solution[tt].Depart;" to ";
+  dd += Solution[tt].Distance
+  tt++
+WEND
+PRINT end$
+PRINT "Distance is ";dd
+
+getchar();
+END = 0
+
+
+
+
+SUB Setup
+  F_pos = 0
+  tos = 0
+  stos = 0
+  Find_pos = 0
+  Assert_Flight("New York","Chicago",1000)
+  Assert_Flight("Chicago","New York",1000)
+  Assert_Flight("New York","Urbana",1200)
+  Assert_Flight("Urbana","New York",1200)
+  Assert_Flight("Chicago","Denver",1000)
+  Assert_Flight("Denver","Chicago",1000)
+  Assert_Flight("Chicago","Urbana",400)
+  Assert_Flight("Urbana","Chicago",400)
+  Assert_Flight("Urbana","Houston",900)
+  Assert_Flight("Houston","Urbana",900)
+  Assert_Flight("New York","Toronto",800)
+  Assert_Flight("Toronto","New York",800)
+  Assert_Flight("New York","Denver",1900)
+  Assert_Flight("Denver","New York",1900)
+  Assert_Flight("Toronto","Calgary",1500)
+  Assert_Flight("Calgary","Toronto",1500)
+  Assert_Flight("Toronto","Los Angeles",1800)
+  Assert_Flight("Los Angeles","Toronto",1800)
+  Assert_Flight("Toronto","Chicago",500)
+  Assert_Flight("Chicago","Toronto",500)
+  Assert_Flight("Denver","Urbana",1000)
+  Assert_Flight("Urbana","Denver",1000)
+  Assert_Flight("Denver","Houston",1500)
+  Assert_Flight("Houston","Denver",1500)
+  Assert_Flight("Houston","Los Angeles",1500)
+  Assert_Flight("Los Angeles","Houston",1500)
+  Assert_Flight("Denver","Los Angeles",1000)
+  Assert_Flight("Los Angeles","Denver",1000)
+END SUB
+
+SUB Assert_Flight(frm$, dst$, dist AS INTEGER)
+  IF F_pos < MaxFlights THEN
+    Flight[F_pos].Depart = frm$
+    Flight[F_pos].Arrival = dst$
+    Flight[F_pos].Distance = dist
+    Flight[F_pos].Skip = 0
+    F_pos++
+  ELSE
+    PRINT "Flight database full"
+  END IF
+END SUB
+
+FUNCTION Match(frm$, dst$)
+  DIM RAW t
+
+  t = 0
+  WHILE t < F_pos
+    IF Flight[t].Depart = frm$ AND Flight[t].Arrival = dst$ THEN
+      FUNCTION = Flight[t].Distance
+    END IF
+    t++
+  WEND
+  FUNCTION = 0
+END FUNCTION
+
+FUNCTION BeenTo(where$)
+  DIM RAW t
+  t = 0
+  WHILE t < tos
+    IF Bt_Stack[t].Depart = where$ THEN
+      FUNCTION = 1
+    END IF
+    t++
+  WEND
+  FUNCTION = 0
+END FUNCTION
+
+FUNCTION Find(frm$, anywhere$)
+  Find_pos = 0
+  WHILE Find_pos < F_pos
+    IF Flight[Find_pos].Depart = frm$ AND Flight[Find_pos].Skip = 0 THEN
+      IF BeenTo(Flight[Find_pos].Arrival) = 0 THEN
+        anywhere$ = Flight[Find_pos].Arrival
+        Flight[Find_pos].Skip = 1+tos
+        FUNCTION = Flight[Find_pos].Distance
+      END IF
+    END IF
+    Find_pos++
+  WEND
+  FUNCTION = 0
+END FUNCTION
+
+SUB Push(frm$, dst$, dist AS INTEGER)
+  IF tos < MaxFlights THEN
+    Bt_Stack[tos].Depart = frm$
+    Bt_Stack[tos].Arrival = dst$
+    Bt_Stack[tos].Distance = dist
+    tos++
+  ELSE
+    PRINT "Stack full"
+  END IF
+END SUB
+
+SUB Pop(frm$, dst$, dist AS INTEGER PTR)
+  IF tos > 0 THEN
+    tos--
+    frm$ = Bt_Stack[tos].Depart
+    dst$ = Bt_Stack[tos].Arrival
+    *dist = Bt_Stack[tos].Distance
+  ELSE
+    PRINT "Stack underflow"
+  END IF
+END SUB
+
+SUB Spush(frm$, dst$, dist AS INTEGER)
+  IF stos < MaxFlights THEN
+    Solution[stos].Depart = frm$
+    Solution[stos].Arrival = dst$
+    Solution[stos].Distance = dist
+    stos++
+  ELSE
+    PRINT "Solution Stack full"
+  END IF
+END SUB
+
+SUB ClearFar()
+  DIM RAW ts
+
+  ts = tos + 1
+  Find_pos = 0
+  WHILE Find_pos < F_pos
+    IF Flight[Find_pos].Skip > ts THEN
+      Flight[Find_pos].Skip = 0
+    END IF
+    Find_pos++
+  WEND
+END SUB
+
+SUB ClearWidth(frm$, anywhere$)
+  DIM RAW ts
+
+  ts = 0
+  Find_pos = 0
+  WHILE Find_pos < F_pos
+    IF Flight[Find_pos].Depart = frm$ AND (Flight[Find_pos].Arrival = anywhere$ OR ts = 1)THEN
+      ts = 1
+      Flight[Find_pos].Skip = 0
+    END IF
+    Find_pos++
+  WEND
+END SUB
+
+FUNCTION IsFlight(frm$, dst$) AS INTEGER
+  DIM RAW d
+  DIM RAW dist
+  DIM RAW temp
+  DIM RAW anywhere$
+  DIM RAW fany$
+  DIM RAW r
+
+  r = 0
+  IF Use_Method = Width THEN
+    dist = Find(frm$,anywhere$)
+    fany$ = anywhere$
+    WHILE dist
+      d = Match(anywhere$,dst$)
+      IF d THEN
+        Push(frm$,dst$,dist)
+        Push(anywhere$,dst$,d)
+        r = Route(dst$)
+        FUNCTION = r
+      END IF
+      dist = Find(frm$,anywhere$)
+    WEND
+    CALL ClearWidth(frm$,fany$)
+  END IF
+
+  IF Use_Method <> Width THEN
+    d = Match(frm$, dst$)
+    IF d THEN
+      Push(frm$,dst$,d)
+      r = Route(dst$)
+      IF Use_Method = Optimal AND r > 0 THEN
+        Pop(frm$,dst$,&dist)
+        Pop(frm$,dst$,&dist)
+        CALL ClearFar
+        r = IsFlight(frm$,dst$)
+      END IF
+      FUNCTION = r
+    END IF
+  END IF
+
+  dist = Find(frm$,anywhere$)
+  IF dist THEN
+    Push(frm$,dst$,dist)
+    r = IsFlight(anywhere$,dst$)
+  ELSE
+    IF tos > 0 THEN
+      Pop(frm$,dst$,&dist)
+      CALL ClearFar
+      r = IsFlight(frm$,dst$)
+    END IF
+  END IF
+  FUNCTION = r
+END FUNCTION
+
+FUNCTION Route(dst$) AS INTEGER
+  DIM RAW dist
+  DIM RAW t
+  STATIC old_dist = 32000
+
+  IF Use_Method = Optimal AND tos = 0 THEN
+    FUNCTION = 0
+  END IF
+  dist = 0
+  t = 0
+  WHILE t < tos
+    IF Use_Method <> Optimal THEN PRINT Bt_Stack[t].Depart;" to ";
+    dist += Bt_Stack[t].Distance
+    t++
+  WEND
+  IF Use_Method <> Optimal THEN
+    PRINT dst$
+    PRINT "Distance is ";dist
+  END IF
+  IF Use_Method = Optimal THEN
+    IF dist < old_dist AND dist > 0 THEN
+      t = 0
+      old_dist = dist
+      stos = 0
+      WHILE t < tos
+        CALL Spush(Bt_Stack[t].Depart,Bt_Stack[t].Arrival,Bt_Stack[t].Distance)
+        t++
+      WEND
+    END IF
+  END IF
+  FUNCTION = dist
+END FUNCTION
+
+SUB ClearMarkers
+  DIM RAW t
+
+  FOR t = 0 TO F_pos
+    Flight[t].Skip = 0
+  NEXT
+END SUB
+
+SUB Retract(frm$, dst$)
+  DIM RAW t
+
+  FOR t = 0 TO F_pos
+    IF Flight[t].Depart = frm$ AND Flight[t].Arrival = dst$ THEN
+      Flight[t].Depart = ""
+      EXIT SUB
+    END IF
+  NEXT
+END SUB

+ 119 - 0
Examples/Console/NotWorking/S153.bas

@@ -0,0 +1,119 @@
+$execon
+
+TYPE LIST
+    Cnt AS integer
+    b[32] AS CHAR
+    nxt AS LIST PTR
+    prv AS LIST PTR
+END TYPE
+
+CONST sp = 0
+
+DIM Head AS LIST PTR
+
+DIM a$,buffer$[40], i, j
+
+a$ = "this is a test"
+i = SPLIT(buffer$,a$," ", sp)
+FOR j = 0 TO i - 1
+   CALL AddString(buffer$[j])
+NEXT
+a$ = "the quick brown fox jumped over the lazy dog"
+i = SPLIT(buffer$,a$," ", sp)
+FOR j = 0 TO i - 1
+   CALL AddString(buffer$[j])
+NEXT
+a$ = "to error is human to really screw up requires a computer"
+i = SPLIT(buffer$,a$," ", sp)
+FOR j = 0 TO i - 1
+   CALL AddString(buffer$[j])
+NEXT
+a$ = "if a function takes up more space than can fit on a screen it has an error in it"
+i = SPLIT(buffer$,a$," ", sp)
+FOR j = 0 TO i - 1
+   CALL AddString(buffer$[j])
+NEXT
+
+
+CALL OutPutData()
+!fflush(stdout);
+getchar();
+
+SUB OutPutData
+   IF Head THEN
+      WHILE Head->prv
+         Head = Head->prv
+      WEND
+      WHILE Head
+         PRINT Head->b$; Head->Cnt
+         Head = Head->nxt
+      WEND
+   END IF
+END SUB
+
+SUB AddString(a$)
+   DIM RAW PHead AS LIST PTR
+   DIM RAW CHead AS LIST PTR
+   DIM RAW NHead AS LIST PTR
+
+   IF !(Head) THEN
+      Head = MakeRecord()
+      Head->b$ = a$
+      Head->Cnt = 1
+      EXIT SUB
+   END IF
+
+   CHead = Head
+   WHILE CHead->b$ < a$
+      IF CHead->nxt THEN
+         CHead = CHead->nxt
+      ELSE
+         PHead = CHead
+         CHead->nxt = MakeRecord()
+         CHead = CHead->nxt
+         CHead->b$ = a$
+         CHead->Cnt = 1
+         CHead->prv = PHead
+         EXIT SUB
+      END IF
+   WEND
+
+   IF CHead->b$ = a$ THEN
+      CHead->Cnt++
+      EXIT SUB
+   END IF
+
+   WHILE CHead->b$ > a$
+      IF CHead->prv THEN
+         CHead = CHead->prv
+      ELSE
+         PHead = CHead
+         CHead->prv = MakeRecord()
+         CHead = CHead->prv
+         CHead->b$ = a$
+         CHead->Cnt = 1
+         CHead->nxt = PHead
+         EXIT SUB
+      END IF
+   WEND
+
+   IF CHead->b$ = a$ THEN
+      CHead->Cnt++
+      EXIT SUB
+   END IF
+
+   NHead = MakeRecord()
+   NHead->b$ = a$
+   NHead->Cnt = 1
+
+   PHead = CHead->nxt
+   CHead->nxt = NHead
+   NHead->nxt = PHead
+   NHead->prv = CHead
+   PHead->prv = NHead
+   
+END SUB
+
+FUNCTION MakeRecord() AS LIST PTR
+!   return(calloc(1, sizeof(LIST)));
+END FUNCTION

+ 78 - 0
Examples/Console/NotWorking/S154.bas

@@ -0,0 +1,78 @@
+$execon
+
+'===============================================================
+' Semi-OOP implementation for BCX by Kevin Diggins Dec 01, 2003
+'===============================================================
+
+$NOWIN
+#include <windows.h>
+
+TYPE FOO
+  MyVar
+  FUNCTION Squared (This AS FOO_CLASS) AS INTEGER
+  FUNCTION Cubed   (This AS FOO_CLASS) AS INTEGER
+  FUNCTION TimesX  (This AS FOO_CLASS, X AS INTEGER) AS INTEGER
+END TYPE
+
+
+DIM Me  AS FOO : Initialize (  &Me, 3 )
+DIM You AS FOO : Initialize ( &You, 4 )
+
+CLS
+
+PRINT "================="
+PRINT "Me.Squared  "  , Me.Squared  (&Me)
+PRINT "Me.Cubed    "  , Me.Cubed    (&Me)
+PRINT "Me.TimesX   "  , Me.TimesX   (&Me,100)
+PRINT "================="
+PRINT "You.Squared "  , You.Squared (&You)
+PRINT "You.Cubed   "  , You.Cubed   (&You)
+PRINT "You.TimesX  "  , You.TimesX  (&You,100)
+PRINT "================="
+
+PRINT "Changing .MyVar in Me and You"
+
+Me.MyVar  = 6
+You.MyVar  = 7
+
+
+PRINT "================="
+PRINT "Me.Squared  "  , Me.Squared  (&Me)
+PRINT "Me.Cubed    "  , Me.Cubed    (&Me)
+PRINT "Me.TimesX   "  , Me.TimesX   (&Me,100)
+PRINT "================="
+PRINT "You.Squared "  , You.Squared (&You)
+PRINT "You.Cubed   "  , You.Cubed   (&You)
+PRINT "You.TimesX  "  , You.TimesX  (&You,100)
+PRINT "================="
+
+
+
+
+
+SUB Initialize (This AS FOO_CLASS, b AS INTEGER)
+  WITH This
+    .MyVar   =       b
+    .Squared = Squared
+    .Cubed   =   Cubed
+    .TimesX  =  TimesX
+  END WITH
+END SUB
+
+
+
+FUNCTION Squared (This AS FOO_CLASS)
+  FUNCTION = This.MyVar * This.MyVar
+END FUNCTION
+
+
+
+FUNCTION Cubed (This AS FOO_CLASS)
+  FUNCTION = This.MyVar * This.MyVar * This.MyVar
+END FUNCTION
+
+
+
+FUNCTION TimesX (This AS FOO_CLASS, X)
+  FUNCTION = This.MyVar * X
+END FUNCTION

+ 30 - 0
Examples/Console/NotWorking/S18.bas

@@ -0,0 +1,30 @@
+$execon
+
+Dim i
+Do
+  i = MsgBox ( "This is a message", "BCX Demo", 3+64) ' 3=YNC, 64=Info Icon
+  Select Case i
+    Case 2
+    MsgBox "You Pressed CANCEL !", "BCX Demo", 1 : END
+    Case 6
+    MsgBox "You Pressed YES !", "BCX Demo", 1
+    Case 7
+    MsgBox "You Pressed NO !" , "BCX Demo", 1
+  End Select
+Loop
+
+'----------------------------------------------------------------------------
+'     OK                   0     Display OK button only.
+'     OKCancel             1     Display OK and Cancel buttons.
+'     AbortRetryIgnore     2     Display Abort, Retry, and Ignore buttons.
+'     YesNoCancel          3     Display Yes, No, and Cancel buttons.
+'     YesNo                4     Display Yes and No buttons.
+'     RetryCancel          5     Display Retry and Cancel buttons.
+'     Critical            16     Display Critical Message icon.
+'     Question            32     Display Warning Query icon.
+'     Exclamation         48     Display Warning Message icon.
+'     Information         64     Display Information Message icon.
+'     DefaultButton1       0     First button is default.
+'     DefaultButton2     256     Second button is default.
+'     DefaultButton3     512     Third button is default.
+'----------------------------------------------------------------------------

+ 26 - 0
Examples/Console/NotWorking/S35.bas

@@ -0,0 +1,26 @@
+$execon
+
+
+
+SetConsoleTitle ("BCX Demonstration")
+
+
+color 15,1
+frame (15,10,65,20)
+dim a
+input a
+color 7,0
+cls
+
+
+
+sub frame(x1,y1,x2,y2)     ' while interesting, this is meant only as a
+dim x                      ' sample SUB.  The built-in PANEL statement
+dim y                      ' is much faster and more flexible
+for y = y1 to y2
+  for x = x1 to x2
+    locate y,x,0
+    print " ";
+  next
+next
+end sub

+ 25 - 0
Examples/Console/NotWorking/S42.bas

@@ -0,0 +1,25 @@
+$execon
+
+Dim A$
+
+Send   ("Status: 200 OK")
+
+A$ = "Content-type: text/html" & chr$(13) & chr$(10)
+
+Send   ( A$)
+
+Send   ("<HTML><HEAD><TITLE> BCX Sample CGI </TITLE></HEAD>")
+Send   ("<BODY>")
+Send   ("Hello, World From BCX cgi-bin!")
+Send   ("</BODY>")
+Send   ("</HTML>")
+
+
+
+Sub Send (A$)
+Dim ret
+Dim hConsole as HANDLE
+hConsole = GetStdHandle (STD_OUTPUT_HANDLE)
+A$ = A$ & Chr$(13) & Chr$(10)
+WriteFile (hConsole, A$,len(A$),&ret,NULL)
+End sub

+ 22 - 0
Examples/Console/NotWorking/S48.bas

@@ -0,0 +1,22 @@
+$execon
+
+Dim A$
+
+A$ = Command$
+If A$ = "" Then A$ = "*.*"
+ShowDir(A$)
+
+
+Sub ShowDir(b$)
+! WIN32_FIND_DATA FindData;
+! HANDLE FileHandle;
+! int found;
+! FileHandle = FindFirstFile(b,&FindData);
+! found = (int) FileHandle;
+! while (found != 0)
+! {
+!  printf("%s\n",FindData.cFileName);
+!  found = FindNextFile(FileHandle, &FindData);
+! }
+! FindClose(FileHandle);
+End Sub

+ 7 - 0
Examples/Console/NotWorking/S51.bas

@@ -0,0 +1,7 @@
+$execon
+
+'------------------------------------------------------------
+'This simple one line program will minimize all windows
+'------------------------------------------------------------
+
+PostMessage(FindWindow("Shell_TrayWnd",NULL),WM_COMMAND,419,0)

+ 29 - 0
Examples/Console/NotWorking/S53.bas

@@ -0,0 +1,29 @@
+$execon
+
+
+Const DRIVE_REMOVABLE = 2
+Const DRIVE_FIXED     = 3
+Const DRIVE_REMOTE    = 4
+Const DRIVE_CDROM     = 5
+Const DRIVE_RAMDISK   = 6
+
+Dim i
+Dim a$
+Dim k
+
+For i = 0 To 25
+  a$ = Chr$(i + 65) & ":\"
+  k = GetDriveType(a$)
+  Select Case k
+    Case DRIVE_REMOVABLE
+    Print a$, "  Is a removable disk."
+    Case DRIVE_FIXED
+    Print a$, "  Is a fixed disk."
+    Case DRIVE_REMOTE
+    Print a$, "  Is a remote disk."
+    Case DRIVE_CDROM
+    Print a$, "  Is a Cd-Rom drive."
+    Case DRIVE_RAMDISK
+    Print a$, "  Is a RamDisk."
+  End Select
+Next

+ 7 - 0
Examples/Console/NotWorking/S58.bas

@@ -0,0 +1,7 @@
+$execon
+
+dim a$
+
+GetSystemDirectory (a$,256)
+
+? a$

+ 16 - 0
Examples/Console/NotWorking/S60.bas

@@ -0,0 +1,16 @@
+$execon
+
+
+
+Print GetMachineName$()
+
+
+
+
+Function GetMachineName$()
+Dim A$
+Dim b AS DWORD
+b = 256
+GetComputerName(A$,&b)
+Function = A$
+End Function

+ 22 - 0
Examples/Console/NotWorking/S65.bas

@@ -0,0 +1,22 @@
+$execon
+
+
+SetFileAttr (command$, FILE_ATTRIBUTE_HIDDEN )
+
+
+
+Sub SetFileAttr(t$,a)
+'----------------------------------------------------------------------------
+' CONSTANT                    MEANING
+'----------------------------------------------------------------------------
+'FILE_ATTRIBUTE_ARCHIVE   -- The file is an archive file
+'FILE_ATTRIBUTE_HIDDEN    -- The file is hidden
+'FILE_ATTRIBUTE_NORMAL    -- The file has no other attributes set
+'FILE_ATTRIBUTE_OFFLINE   -- The data of the file is not immediately available
+'FILE_ATTRIBUTE_READONLY  -- The file is read-only
+'FILE_ATTRIBUTE_SYSTEM    -- The file is part of the operating system
+'FILE_ATTRIBUTE_TEMPORARY -- The file is being used for temporary storage
+'----------------------------------------------------------------------------
+SetFileAttributes(t$,a)
+'----------------------------------------------------------------------------
+End Sub

+ 18 - 0
Examples/Console/NotWorking/S66.bas

@@ -0,0 +1,18 @@
+$execon
+
+$LIBRARY <shell32.lib>          ' Linked with shell32.lib
+
+DIM Src$
+DIM Dst$
+DIM sfs AS SHFILEOPSTRUCT
+
+Src$ = "*.BAS"     & CHR$(0) & CHR$(0)
+Dst$ = "C:\TEMP"   & CHR$(0) & CHR$(0)
+
+sfs.wFunc               =  FO_COPY
+sfs.pFrom               =  Src$
+sfs.pTo                 =  Dst$
+sfs.fFlags              =  FOF_NOCONFIRMATION OR FOF_SILENT
+sfs.lpszProgressTitle   =  Src$
+
+SHFileOperation (&sfs)

+ 33 - 0
Examples/Console/NotWorking/S67.bas

@@ -0,0 +1,33 @@
+$execon
+
+Dim A$
+
+Cls
+
+If Command$ = "" Then
+  A$ = FindFirst$("*.*")
+Else
+  A$ = FindFirst$(Command$)
+End If
+
+While A$ <> ""
+  ShowFiles (A$)
+  A$ = FindNext$
+Wend
+
+
+
+Sub ShowFiles (A$)
+Local T1$
+
+T1$ = ""
+
+If GetAttr(A$) = 32 Then
+  T1$ = "[" & A$ & "]"
+Else
+  T1$ = A$
+End If
+
+Print T1$
+
+End Sub

+ 13 - 0
Examples/Console/NotWorking/S68.bas

@@ -0,0 +1,13 @@
+$execon
+
+DIM A$
+
+IF COMMAND$ = "" THEN
+  PRINT "Usage: Wav filename [.wav]"
+  PRINT "Plays a wave file"
+  END
+END IF
+
+A$ = EXTRACT$(COMMAND$,".") & ".WAV"
+
+PlayWav(A$)

+ 5 - 0
Examples/Console/NotWorking/S69.bas

@@ -0,0 +1,5 @@
+$execon
+
+? "The Current Directory is: " , curdir$
+? " The System Directory is: " , sysdir$
+? "   The Temp Directory is: " , tempdir$

+ 109 - 0
Examples/Console/NotWorking/S70.bas

@@ -0,0 +1,109 @@
+$execon
+
+
+'===================  Flags for GetSystemInfo  ===========================
+
+Const PROCESSOR_INTEL_386             = 386
+Const PROCESSOR_INTEL_486             = 486
+Const PROCESSOR_INTEL_PENTIUM         = 586
+Const PROCESSOR_MIPS_R4000            = 4000
+Const PROCESSOR_ALPHA_21064           = 21064
+Const PROCESSOR_PPC_601               = 601
+Const PROCESSOR_PPC_603               = 603
+Const PROCESSOR_PPC_604               = 604
+Const PROCESSOR_PPC_620               = 620
+Const PROCESSOR_HITACHI_SH3           = 10003    'Windows CE
+Const PROCESSOR_HITACHI_SH3E          = 10004    'Windows CE
+Const PROCESSOR_HITACHI_SH4           = 10005    'Windows CE
+Const PROCESSOR_MOTOROLA_821          = 821      'Windows CE
+Const PROCESSOR_SHx_SH3               = 103      'Windows CE
+Const PROCESSOR_SHx_SH4               = 104      'Windows CE
+Const PROCESSOR_STRONGARM             = 2577     'Windows CE - 0xA11
+Const PROCESSOR_ARM720                = 1824     'Windows CE - 0x720
+Const PROCESSOR_ARM820                = 2080     'Windows CE - 0x820
+Const PROCESSOR_ARM920                = 2336     'Windows CE - 0x920
+Const PROCESSOR_ARM_7TDMI             = 70001    'Windows CE
+
+Const PROCESSOR_ARCHITECTURE_INTEL    =   0
+Const PROCESSOR_ARCHITECTURE_MIPS     =   1
+Const PROCESSOR_ARCHITECTURE_ALPHA    =   2
+Const PROCESSOR_ARCHITECTURE_PPC      =   3
+Const PROCESSOR_ARCHITECTURE_SHX      =   4
+Const PROCESSOR_ARCHITECTURE_ARM      =   5
+Const PROCESSOR_ARCHITECTURE_IA64     =   6
+Const PROCESSOR_ARCHITECTURE_ALPHA64  =   7
+
+Const PROCESSOR_LEVEL_80386           =   3
+Const PROCESSOR_LEVEL_80486           =   4
+Const PROCESSOR_LEVEL_PENTIUM         =   5
+Const PROCESSOR_LEVEL_PENTIUMII       =   6
+
+Const nkb = 1024
+
+'================================================================
+
+Dim tmp$
+Dim a$
+Dim kb$
+
+Dim si as SYSTEM_INFO
+Dim ms as MEMORYSTATUS
+
+'================================================================
+
+kb$ = " kbytes"
+
+ms.dwLength = sizeof(&ms)
+
+GlobalMemoryStatus (&ms)
+
+GetSystemInfo (&si)
+
+'================================================================
+
+Print : Print "Number Of Processors ", si.dwNumberOfProcessors
+
+Select Case si.dwProcessorType
+  Case PROCESSOR_INTEL_386
+  tmp$ = " 386 "
+  Case PROCESSOR_INTEL_486
+  tmp$ = " 486 "
+  Case PROCESSOR_INTEL_PENTIUM
+  tmp$ = " Pentium "
+  Case PROCESSOR_MIPS_R4000
+  tmp$ = " MIPS 4000 "
+  Case PROCESSOR_ALPHA_21064
+  tmp$ = " Alpha "
+End Select
+
+Print "Processor Type ", si.dwProcessorType, tmp$
+
+Select Case si.wProcessorLevel
+  Case PROCESSOR_LEVEL_80386
+  tmp$ = " Intel 80386 "
+  Case PROCESSOR_LEVEL_80486
+  tmp$ = " Intel 80486 "
+  Case PROCESSOR_LEVEL_PENTIUM
+  tmp$ = " Intel Pentium "
+  Case PROCESSOR_LEVEL_PENTIUMII
+  tmp$ = " Intel Pentium Pro or Pentium II "
+End Select
+
+Print "Processor Level", si.wProcessorLevel, tmp$
+Print "Processor Revision ";
+Print si.wProcessorRevision;
+Print " Model ";
+Print HIBYTE(si.wProcessorRevision);
+Print ", Stepping ";
+Print LOBYTE(si.wProcessorRevision)
+Print
+
+'================================================================
+
+a$ = "Memory Used     " & Str$ (ms.dwMemoryLoad)        & "% free"  : ? a$
+a$ = "Total Memory    " & Str$ (ms.dwTotalPhys/nkb)     &  kb$      : ? a$
+a$ = "Avail Memory    " & Str$ (ms.dwAvailPhys/nkb)     &  kb$      : ? a$
+a$ = "Total Page File " & Str$ (ms.dwTotalPageFile/nkb) &  kb$      : ? a$
+a$ = "Avail PageFile  " & Str$ (ms.dwAvailPageFile/nkb) &  kb$      : ? a$
+a$ = "Total Virtual   " & Str$ (ms.dwTotalVirtual/nkb)  &  kb$      : ? a$
+a$ = "Avail Virtual   " & Str$ (ms.dwAvailVirtual/nkb)  &  kb$      : ? a$

+ 77 - 0
Examples/Console/NotWorking/S71.bas

@@ -0,0 +1,77 @@
+$execon
+
+' --------------------------------------------------------
+'              Clip by Kevin Diggins (C) 2000
+'        Copies a text file to the Windows clipboard
+' --------------------------------------------------------
+
+Dim Fsize                   'Size of file in bytes
+Dim Test                    'Test if the filename EXIST's
+Dim FilName$
+Cls
+
+If Command$ = "" Then
+  Print "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
+  Print "³ Clip!   A Win32 command line clipboard utility      ³"
+  Print "³ Usage:  Clip!  Filename  ( LongFileNames Allowed)   ³"
+  Print "³ Copy any text file to the Windows clipboard FAST!   ³"
+  Print "³ Freeware by Kevin Diggins -- created using BCX!     ³"
+  Print "³ BCX - The free BASIC to C Translator For LCC-Win32  ³"
+  Print "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
+  End
+End If
+
+FilName$ = Command$
+Test = Exist(FilName$)            ' Does it exist?
+If Test = 0 then                  ' Nope ...
+  Print "File Not Found"
+  End                             ' Exit stage left
+End If
+Fsize = LOF (FilName$)            'How big is the file?
+
+Dim Buffer$ * Fsize + 10          'Create a buffer at least that big
+
+Buffer$ = ""                      'initialize it
+GetFile (FilName$,Buffer$,Fsize)
+SetClipBoard (Buffer$)            'Place it on the clipboard
+Free Buffer$                      'release allocated memory back to Windows
+
+Print "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
+Print "³ Clip!   A Win32 command line clipboard utility      ³"
+Print "³ Usage:  Clip!  Filename  ( LongFileNames Allowed)   ³"
+Print "³ Copy any text file to the Windows clipboard FAST!   ³"
+Print "³ Freeware by Kevin Diggins -- created using BCX!     ³"
+Print "³ BCX - The free BASIC to C Translator For LCC-Win32  ³"
+Print "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
+Color 4,0
+Print "        ",Fsize," bytes sent to the clipboard!"
+Color 7,0
+
+'---------------------------------------------------------------------------
+
+SUB SetClipBoard (Text$)
+LOCAL nd  AS HANDLE
+LOCAL ns$ AS LPSTR
+nd  =  GlobalAlloc (GHND,LEN(Text$)+1)
+ns  =  GlobalLock(nd)
+ns$ =  Text$
+GlobalUnlock (nd)
+OpenClipboard (0)
+EmptyClipboard ()
+SetClipboardData (CF_TEXT,nd)
+CloseClipboard ()
+End Sub
+
+
+
+Sub GetFile (Fname$,Buffer$,Count)
+' ------------------------------------------------------
+'   Assumes a valid Filename to a file that exists
+'   and a Buffer large enough to hold Count bytes
+' -------------------------------------------------------
+Dim Read AS DWORD
+Dim H    AS HANDLE
+H = CreateFile(Fname,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,0);
+ReadFile (H,Buffer$,Count,&Read,NULL)
+CloseHandle(H)
+End Sub

+ 15 - 0
Examples/Console/NotWorking/S72.bas

@@ -0,0 +1,15 @@
+$execon
+
+
+
+
+Print ExeName$()
+
+
+FUNCTION ExeName$
+  LOCAL hModule AS HANDLE
+  LOCAL Buffer$
+  hModule = GetModuleHandle(NULL)
+  GetModuleFileName (hModule,Buffer$,256)
+  FUNCTION = Buffer$
+END FUNCTION

+ 26 - 0
Examples/Console/NotWorking/S73.bas

@@ -0,0 +1,26 @@
+$execon
+
+$LIBRARY <imagehlp.lib>      ' link with imagehlp.lib
+#include <imagehlp.h>
+
+Dim Drive2Scan$
+Dim File2Find$
+Dim Result$
+Dim rc
+
+If Command$ = "" Then
+  Print "Usage: S73 FileName"
+  Print "Win32 freeware by Kevin Diggins (1999)"
+  End
+End If
+
+Drive2Scan$ =  "c:\"
+File2Find$  =  Command$
+
+rc = SearchTreeForFile(Drive2Scan$, File2Find$, Result$)
+
+If rc = 0 Then
+  Result$ = "File was not found"
+End If
+
+Print Result$

+ 29 - 0
Examples/Console/NotWorking/S74.bas

@@ -0,0 +1,29 @@
+$execon
+
+If Command$ = "" Then
+  Print "Usage: S74 FileName.Ext"
+  End
+End If
+
+Print Command$ , "  " , FileDateTime$(Command$)
+
+
+FUNCTION FileDateTime$ (Filenam$)
+LOCAL  fd  AS WIN32_FIND_DATA
+LOCAL  st  AS SYSTEMTIME
+LOCAL  fh  AS HANDLE
+LOCAL  Temp$
+LOCAL  Text$
+Text$  = Filenam$
+fh     = FindFirstFile(Text$, &fd)
+IF fh  = INVALID_HANDLE_VALUE THEN
+  EXIT FUNCTION
+END IF
+FindClose (&fh)
+FileTimeToLocalFileTime (&fd.ftLastWriteTime, &fd.ftLastWriteTime)
+FileTimeToSystemTime ( &fd.ftLastWriteTime, &st)
+GetDateFormat ( LOCALE_USER_DEFAULT, DATE_SHORTDATE, &st, NULL, Text$, 255)
+Temp$ = Text$
+GetTimeFormat ( LOCALE_USER_DEFAULT, TIME_NOSECONDS, &st, NULL, Text$, 255)
+FUNCTION = Temp$ & "  " & Text$
+END FUNCTION

+ 39 - 0
Examples/Console/NotWorking/S77.bas

@@ -0,0 +1,39 @@
+$execon
+
+Dim FileSize
+Dim Junk
+
+If Command$ = "" Then
+  Print "Usage: S77 filename"
+  End
+End If
+
+Dim Buffer$ * LOF (Command$) + 1
+
+FileSize = LoadFile(Command$,Buffer$)
+
+Color 3,0 : Print "LoadFile loaded", FileSize, " bytes into Buffer$"
+Color 7,0 : Input "Press Enter to display contents of Buffer$" , Junk
+Cls
+
+Print Buffer$
+
+Free Buffer$
+
+
+Function LoadFile (Fname$,Buffer$) AS DWORD
+' ------------------------------------------------------
+' Assumes Fname$ is a valid FileName to an existing file
+' Assumes Buffer$ is large enough to hold entire file
+' -------------------------------------------------------
+Dim Read AS DWORD
+Dim H    AS HANDLE
+Dim Fsize
+Fsize = LOF (Fname$)
+H = CreateFile(Fname,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,0);
+If H Then
+  ReadFile (H,Buffer$,Fsize,&Read,NULL)
+  CloseHandle(H)
+End If
+Function = Read
+End Function

+ 15 - 0
Examples/Console/NotWorking/S78.bas

@@ -0,0 +1,15 @@
+$execon
+
+
+  Dim st AS SYSTEMTIME
+  Dim d$
+  Dim t$
+  Dim s$
+
+  GetLocalTime (&st)
+
+  GetDateFormat (LOCALE_USER_DEFAULT, DATE_LONGDATE, &st,NULL,d$,64)
+  GetDateFormat (LOCALE_USER_DEFAULT, DATE_SHORTDATE,&st,NULL,s$,64)
+  GetTimeFormat (LOCALE_USER_DEFAULT, TIME_NOSECONDS,&st,NULL,t$,64)
+
+  Print t$, ", " ,  d$, " (" , s$ , ")"

+ 116 - 0
Examples/Console/NotWorking/S79.bas

@@ -0,0 +1,116 @@
+$execon
+
+' *************************************************************************
+' BCX recognizes WinMain and WndProc as being indicative of GUI programming
+' otherwise, BCX defaults to generating code for the console only.  This is
+' the first Gui program ever successfully translated by BCX. Possibilities?
+' *************************************************************************
+
+Function WinMain()
+
+LOCAL hWnd AS  HWND
+LOCAL Msg  AS  MSG
+LOCAL wc   AS  WNDCLASSEX
+
+Dim AppName$
+
+AppName$ = "BCX_Demo"
+
+ wc.cbSize        = SIZEOF(wc)
+ wc.style         = CS_HREDRAW OR CS_VREDRAW
+ wc.lpfnWndProc   = WndProc
+ wc.cbClsExtra    = 0
+ wc.cbWndExtra    = 0
+ wc.hInstance     = hInst
+ wc.hIcon         = LoadIcon( hInst, "BCX_GUI" )
+ wc.hCursor       = LoadCursor( NULL, IDC_ARROW )
+ wc.hbrBackground = GetStockObject( WHITE_BRUSH )
+ wc.lpszMenuName  = NULL
+ wc.lpszClassName = AppName$
+ wc.hIconSm       = LoadIcon( hInst, IDI_APPLICATION )
+ RegisterClassEx    (&wc)
+
+
+hWnd = CreateWindow ( AppName$,"Introducing BCX!", _
+WS_OVERLAPPEDWINDOW, 0, 0, 400, 200, NULL, NULL, hInst, NULL )
+
+ShowWindow (hWnd,CmdShow)
+UpdateWindow(hWnd)
+
+WHILE (GetMessage(&Msg,NULL,0,0))
+ TranslateMessage(&Msg)
+ DispatchMessage(&Msg)
+WEND
+
+Function = Msg.wParam
+End Function
+
+
+
+
+
+Callback Function WndProc()
+LOCAL  hButton  AS  HANDLE
+LOCAL  hdc      AS  HDC
+LOCAL  ps       AS  PAINTSTRUCT
+LOCAL  rect     AS  RECT
+LOCAL  tm       AS  TEXTMETRIC
+LOCAL  Tmp$
+LOCAL  cx
+LOCAL  cy
+
+SELECT CASE Msg
+
+ CASE WM_CREATE
+ hdc = GetDC (hWnd)
+ SelectObject (hdc,GetStockObject (SYSTEM_FIXED_FONT))
+ GetTextMetrics (hdc, &tm)
+ cx = tm.tmAveCharWidth * 10
+ cy = (tm.tmHeight + tm.tmExternalLeading) * 2
+ ReleaseDC (hWnd, hdc)
+ hButton = CreateWindow("button","Too Cool!",    _
+ WS_CHILD OR WS_VISIBLE OR BS_PUSHBUTTON,        _
+ 140,115,cx,cy,hWnd,1,NULL,NULL)
+ CenterWindow (hWnd)
+
+
+ CASE WM_PAINT
+ hdc = BeginPaint(hWnd,&ps)
+ GetClientRect(hWnd,&rect)
+ Tmp$ = "BCX does Gui Windows too ..."
+ TextOut(hdc,85,30,Tmp$,Len(Tmp$))
+ Tmp$ = "For Free!"
+ TextOut(hdc,150,70,Tmp$,Len(Tmp$))
+ EndPaint(hWnd,&ps)
+ Exit Function
+
+
+ CASE WM_COMMAND
+ If LOWORD(wParam)=1 THEN
+  IF HIWORD(wParam)=BN_CLICKED Then
+   DestroyWindow (hWnd)
+  End If
+ End If
+ Exit Function
+
+
+ CASE WM_DESTROY
+ PostQuitMessage (0)
+
+END SELECT
+Function = DefWindowProc(hWnd,Msg,wParam,lParam)
+End Function
+
+
+
+
+SUB CenterWindow (hWnd AS HANDLE)
+DIM wRect AS RECT
+DIM x     AS DWORD
+DIM y     AS DWORD
+GetWindowRect (hWnd, &wRect)
+x = (GetSystemMetrics (SM_CXSCREEN) - (wRect.right-wRect.left))/2
+y = (GetSystemMetrics (SM_CYSCREEN) -    _
+(wRect.bottom - wRect.top + GetSystemMetrics (SM_CYCAPTION)))/2
+SetWindowPos (hWnd, NULL,x,y,0,0,SWP_NOSIZE OR SWP_NOZORDER)
+END SUB

+ 61 - 0
Examples/Console/NotWorking/S85.bas

@@ -0,0 +1,61 @@
+$execon
+
+'-----------------------------------------------------
+' This program demonstrates toggling full screen mode
+' This version works in Win95/98/ME/NT
+'-----------------------------------------------------
+
+DIM A
+
+FOR A = 1 TO 4
+  ToggleFullScreen()
+  Sleep(2000)                  'delay 2 second each iteration
+NEXT
+
+
+
+
+SUB ToggleFullScreen()
+DIM SetConsoleDisplayMode AS FARPROC
+DIM GetConsoleDisplayMode AS FARPROC
+DIM Proc_Ptr              AS FARPROC
+DIM hKernel32             AS HMODULE
+DIM hOut      AS HANDLE
+DIM dwOldMode AS DWORD
+DIM hConWnd AS HWND
+DIM ConTxt$
+
+CONST ID_SWITCH_CONSOLEMODE = 0xE00F
+
+IF IsNT() THEN
+' ------------------------------------------------
+' taken from http://www.codepile.com/tric16.shtml
+' ------------------------------------------------
+  hKernel32 = GetModuleHandle("kernel32.dll")
+  Proc_Ptr = GetProcAddress(hKernel32, "SetConsoleDisplayMode")
+  SetConsoleDisplayMode = MakeProcInstance(Proc_Ptr, hKernel32)
+  Proc_Ptr = GetProcAddress(hKernel32, "GetConsoleDisplayMode")
+  GetConsoleDisplayMode = MakeProcInstance (Proc_Ptr, hKernel32)
+  hOut = GetStdHandle(STD_OUTPUT_HANDLE)
+  GetConsoleDisplayMode(&dwOldMode)
+  SetConsoleDisplayMode(hOut, 1 XOR dwOldMode, 0)
+ELSE
+  GetConsoleTitle(ConTxt$, SIZEOF(ConTxt$))
+  hConWnd = FindWindow("tty", ConTxt$)
+  SendMessage(hConWnd, WM_COMMAND, ID_SWITCH_CONSOLEMODE, 0)
+END IF
+END SUB
+
+
+
+
+
+FUNCTION IsNT()
+DIM dwVersion AS DWORD
+dwVersion = GetVersion()
+IF (dwVersion < 0x80000000) THEN
+  FUNCTION = TRUE
+ELSE
+  FUNCTION = FALSE
+END IF
+END FUNCTION

+ 21 - 0
Examples/Console/NotWorking/S88.bas

@@ -0,0 +1,21 @@
+$execon
+
+ShowDesktopIcons (0)
+Sleep (3000)              ' create a 3 second delay
+ShowDesktopIcons (1)
+
+
+
+
+sub ShowDesktopIcons (bShow)
+DIM hProgMan AS HANDLE
+hProgMan  = FindWindow (NULL, "Program Manager")
+
+if hProgMan then
+  if (bShow) then
+    ShowWindow (hProgMan, SW_SHOW)
+  else
+    ShowWindow (hProgMan, SW_HIDE)
+  end if
+end if
+end sub

+ 107 - 0
Examples/Console/NotWorking/S90.bas

@@ -0,0 +1,107 @@
+$execon
+
+'-----------------------------------------------------------------
+' BCX Console mode demonstration by Kevin Diggins (2000)
+' Uses pointer arithmetic to grab screen text and color attributes
+' Clears the screen and then restores the original text screen
+'-----------------------------------------------------------------
+
+Dim Buffer$ * (80*25*2)+1
+GetText (1,1,80,24,Buffer$)
+Say("Press a key to Clear the screen")
+Cls
+Say("Press a key to Restore the screen")
+PutText (1,1,80,24,Buffer$)
+Free Buffer$
+
+
+Sub Say(A$)
+  Local EatKey
+  Print A$
+  While NOT Instat
+  Wend
+  EatKey = Keypress
+END SUB
+
+
+
+Sub GetText(x1,y1,x2,y2,dest$)
+  LOCAL  i       AS  DWORD
+  LOCAL  ilen    AS  DWORD
+  LOCAL  width   AS  DWORD
+  LOCAL  coord   AS  COORD
+  LOCAL  pwattr  AS  LPWORD
+  LOCAL  y       AS  DWORD
+  LOCAL  pstr    AS  LPSTR
+
+  width = (x2 - x1 + 1)
+  pwattr = malloc(width * sizeof(*pwattr)+1)
+
+  IF NOT pwattr THEN
+    EXIT SUB
+  END IF
+
+  pstr = malloc(width)
+
+  IF NOT pstr THEN
+    free(pwattr)
+    EXIT SUB
+  END IF
+
+  FOR y = y1 TO y2
+    coord.X = x1 - 1
+    coord.Y = y - 1
+    ReadConsoleOutputCharacterA(hConsole,pstr,width,coord,&ilen)
+    ReadConsoleOutputAttribute(hConsole,pwattr,width,coord,&ilen)
+    FOR i = 0 TO width
+      *dest$ = *(pstr + i)
+      dest++
+      *dest$ = (char)*(pwattr + i)
+      dest++
+    NEXT
+  NEXT
+  free(pwattr)
+  free(pstr)
+END SUB
+
+
+
+
+Sub PutText( x1, y1, x2, y2,srce$)
+  LOCAL  i       AS  DWORD
+  LOCAL  ilen    AS  DWORD
+  LOCAL  width   AS  DWORD
+  LOCAL  coord   AS  COORD
+  LOCAL  pwattr  AS  LPWORD
+  LOCAL  y       AS  DWORD
+  LOCAL  pstr    AS  LPSTR
+
+  width = (x2 - x1 + 1)
+  pwattr = malloc(width * sizeof(*pwattr))
+
+  IF NOT pwattr THEN
+    EXIT SUB
+  END IF
+
+  pstr = malloc(width+1)
+
+  IF NOT pstr THEN
+    free(pwattr)
+    EXIT SUB
+  END IF
+
+  FOR y = y1 TO y2
+    FOR i = 0 TO width
+      *(pstr + i) = *srce$
+      srce++
+      *(pwattr + i) = *srce$
+      srce++
+    NEXT
+    coord.X = x1 - 1
+    coord.Y = y - 1
+    WriteConsoleOutputCharacterA(hConsole, pstr, width, coord, &ilen)
+    WriteConsoleOutputAttribute(hConsole, pwattr, width, coord, &ilen)
+  NEXT
+  free(pwattr)
+  free(pstr)
+END SUB

+ 59 - 0
Examples/Console/NotWorking/S92.bas

@@ -0,0 +1,59 @@
+$execon
+
+'-------------------------------------------------------
+'           Display Winsock Version Information
+'-------------------------------------------------------
+$LIBRARY <WSOCK32.LIB>          ' LINK WITH WSOCK32.LIB
+
+GLOBAL  wVersionRequested
+GLOBAL  wsaData AS WSADATA
+GLOBAL  rc
+
+wVersionRequested = MAKEWORD(1,1)
+
+rc = WSAStartup(wVersionRequested, &wsaData)
+
+IF NOT rc THEN
+  PrintWSAData(&wsaData)
+ELSE
+  PRINT "Winsock error"
+END IF
+
+WSACleanup()
+
+
+
+
+SUB PrintWSAData( pWSAData AS LPWSADATA )
+
+DIM  Lo
+DIM  Hi
+DIM  I
+DIM  A$
+
+'-------------------------------------
+PRINT "Winsock Version Information"
+'-------------------------------------
+Lo = LOBYTE(pWSAData->wVersion)
+Hi = HIBYTE(pWSAData->wVersion)
+A$ = LTRIM$(STR$(Lo)) & "." &  LTRIM$(STR$(Hi))
+PRINT "Version: ", A$
+'-------------------------------------
+Lo = LOBYTE(pWSAData->wHighVersion)
+Hi = HIBYTE(pWSAData->wHighVersion)
+A$ = LTRIM$(STR$(Lo)) & "." &  LTRIM$(STR$(Hi))
+PRINT "HighVersion: ", A$
+'-------------------------------------
+A$ = pWSAData->szDescription$
+PRINT "Description: ",  A$
+'-------------------------------------
+A$ = pWSAData->szSystemStatus$
+PRINT "System status: ",A$
+'-------------------------------------
+I = pWSAData->iMaxSockets
+PRINT "Max number of sockets: ",I
+'-------------------------------------
+I = pWSAData->iMaxUdpDg
+PRINT "MAX UDP datagram size: ",I
+'-------------------------------------
+End Sub

+ 64 - 0
Examples/Console/NotWorking/S94.bas

@@ -0,0 +1,64 @@
+$execon
+
+' ********************************************************
+'   BCX sample console program by Kevin Diggins that ...
+'   (1)  Launches NotePad
+'   (2)  Creates a 1 second delay
+'   (3)  Sets NotePad's Window to Foreground
+'   (4)  Creates another 1 second delay
+'   (5)  Centers NotePad's Window on the desktop
+' ********************************************************
+
+Shell "notepad.exe"
+
+Sleep(1000)
+
+SetForegroundWindow (FindWindowText("Untitled - Notepad"))
+
+Sleep(1000)
+
+CenterWindow        (FindWindowText("Untitled - Notepad"))
+
+
+
+
+
+
+Function FindWindowText(WindowText$) AS HANDLE
+
+Local zBuffer$
+Local hNext AS HWND
+Local hPrev AS HWND
+Local hTop  AS HWND
+
+hTop  = GetTopWindow(0)
+hPrev = hTop
+hNext = 0
+
+While hNext <> hTop
+  hNext = GetWindow (hPrev, GW_HWNDNEXT)
+  GetWindowText (hNext, zBuffer$, LEN(WindowText$) + 1)
+  If Ucase$(zBuffer$) = Ucase$(WindowText$) Then
+    Function = hNext
+  End If
+  hPrev = hNext
+Loop
+Function = 0
+End Function
+
+
+
+
+
+
+Sub CenterWindow (hWnd AS HWND)
+Dim wRect AS RECT
+Dim x AS DWORD
+Dim y AS DWORD
+GetWindowRect (hWnd, &wRect)
+x = (GetSystemMetrics ( _
+SM_CXSCREEN)-(wRect.right-wRect.left))/2
+y = (GetSystemMetrics ( _
+SM_CYSCREEN)-(wRect.bottom-wRect.top+GetSystemMetrics(SM_CYCAPTION)))/2
+SetWindowPos (hWnd, NULL,x,y,0,0,SWP_NOSIZE OR SWP_NOZORDER)
+End Sub

+ 13 - 0
Examples/Console/NotWorking/S96.bas

@@ -0,0 +1,13 @@
+$execon
+
+'  **************************************************
+'      Pass this program any filename and it will
+'    return its' SHORT NAME.  Works with 8.3 or LFN
+'  **************************************************
+
+
+DIM ShortName$
+
+GetShortPathName ( COMMAND$ , ShortName$ , 256)
+
+PRINT ShortName$

+ 15 - 0
Examples/Console/NotWorking/S98.bas

@@ -0,0 +1,15 @@
+$execon
+
+' ============================================================================
+'                     BCX Console mode sample program
+' Win32 command line utility to change the desktop wallpaper.  Passing an
+' invalid filename has the effect of setting the wallpaper to <none>
+' ============================================================================
+
+If Command$ = "" Then
+  Print "<S>et <W>all <P>aper by Kevin Diggins (2000)"
+  Print "Usage: SWP filename.bmp"
+  End
+End If
+
+SystemParametersInfo( SPI_SETDESKWALLPAPER, 0 , Command$, SPIF_UPDATEINIFILE )

+ 333 - 0
Examples/Console/NotWorking/s100.c

@@ -0,0 +1,333 @@
+// *********************************************************************
+//   Created with MacBC (V) 3.0-Alpha1v2 (2010/11/18)Ported to OSX by Armando Rivera
+//   Ported from BCX32 BASIC To C/C++ Translator (V) 5.12
+//   BCX (c) 1999 - 2009 by Kevin Diggins
+// *********************************************************************
+//   Translated for compiling with the g++ Compiler
+//   g++ -Os -Wformat -D_FORTIFY_SOURCE=2 -Wno-write-strings $FILE$.c -ldl -o $FILE$
+// *********************************************************************
+#include <stdbool.h>
+#include <ctype.h>
+#include <math.h>
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <string.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <setjmp.h>
+#include <time.h>
+#include <stdarg.h>
+#include <dirent.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <dlfcn.h>
+#include <term.h>
+
+
+// ***************************************************
+// Compiler Defines
+// ***************************************************
+  #define C_EXPORT extern "C"
+  #define C_IMPORT extern "C"
+
+#ifndef stat
+  #define lstat stat
+#endif
+#ifndef _fcloseall
+  #define _fcloseall _fcloseall
+#endif
+#ifndef HWND
+  #define HWND GHWND
+#endif
+#ifndef MAX_PATH
+  #define MAX_PATH 2048
+#endif
+#ifndef CALLBACK
+  #define CALLBACK
+#endif
+#if defined (_WIN32_WINNT)
+#define nothing 1
+#else
+  typedef unsigned int HINSTANCE;
+  typedef char* PCHAR;
+  typedef unsigned char byte;
+  typedef unsigned int  UINT;
+  typedef unsigned char UCHAR;
+  typedef unsigned long ULONG;
+  typedef unsigned long DWORD;
+
+#ifndef TRUE
+  #define TRUE 1
+#endif
+
+#ifndef FALSE
+  #define FALSE 0
+#endif
+#define BOOL bool
+
+#endif
+
+// *************************************************
+//                System Variables
+// *************************************************
+
+char    NUL [1]={0};     // Null
+char    BEL [2]={7,0};   // Bell
+char    BS  [2]={8,0};   // Back Space
+char    TAB [2]={9,0};   // Horz Tab
+char    LF  [2]={10,0};  // Line Feed
+char    VT  [2]={11,0};  // Vert Tab
+char    FF  [2]={12,0};  // Form Feed
+char    CR  [2]={13,0};  // Carr Rtn
+char    EF  [2]={26,0};  // End-of-File
+char    ESC [2]={27,0};  // Escape
+char    SPC [2]={32,0};  // Space
+char    DQ  [2]={34,0};  // Double-Quote
+char    DDQ [3]={34,34,0}; // Double-Double-Quote
+char    CRLF[3]={13,10,0}; // Carr Rtn & Line Feed
+int     color_fg = 7;
+int     color_bg = 0;
+char    *AR_fgets_retval;
+
+// *************************************************
+//            User Global Variables
+// *************************************************
+
+static PCHAR   *G_argv;
+static int     G_argc;
+static char    A[2048];
+static char    B[2048];
+static char    C[2048];
+static int     F_GetVal;
+static int     F_PutVal;
+
+
+
+// *************************************************
+//               Standard Macros
+// *************************************************
+
+#define CBOOL(A)(A!=0)?1:0
+#define IsPtr(a)((DWORD)a)
+#define BAND &
+#define BOR |
+#define BNOT ~(int)
+#define ubound(T)(sizeof((T))/sizeof((T[0]))-1)
+#define Clear(arg)memset(&arg,0,sizeof(arg))
+#define imod(a,b)((a)%(b))
+#define GET(A,B,C) F_GetVal=fread(B,1,C,A)
+#define PUT(A,B,C) F_PutVal=fwrite(B,1,C,A)
+#define STRPTR(A)((char*)&(A))
+#define VAL(a)(double)atof(a)
+#define VALL(a) (long double)strtold(a,(char**)NULL)
+#define GETATTR(a)(DWORD)GetFileAttributes(a)
+#define SETATTR(a,b)(DWORD)SetFileAttributes(a,b)
+#define FINT(a)floor(a)
+#define FRAC(a)(double)(a-FIX(a))
+#define FRACL(a)(long double)(a-FIX(a))
+#define FIX(a)(int)((a))
+#define CSNG(a)((float)(a))
+#define CDBL(a)((double)(a))
+#define CLDBL(a)((long double)(a))
+
+
+// *************************************************
+//               Standard Prototypes
+// *************************************************
+
+void    cls(void);
+void    color (int,int);
+void    locate (int,int,int=1,int=12);
+char*   BCX_TmpStr(size_t);
+
+// *************************************************
+//               User Prototypes
+// *************************************************
+
+void    Dance (char *, char *, char *, int);
+
+
+// *************************************************
+//            User Global Initialized Arrays
+// *************************************************
+
+
+// *************************************************
+//                  Main Program
+// *************************************************
+
+int main(int argc, char *argv[])
+{
+  G_argc = argc;
+  G_argv = argv;
+  cls();
+  color (3,0);
+  locate (6,23,0);
+  printf("%s\n","The Ascii Macarena Dance");
+  locate (24,12,0);
+  color (7,0);
+  printf("%s","Created Using Bcx -- The Free Basic To C Translator");
+  for(;;)
+    {
+      color (9,0);
+      locate (8,26,0);
+      printf("%s\n","Press Any Key to Quit");
+      sleep(500);
+      strcpy(A," o ");
+      strcpy(B,"^|\\");
+      strcpy(C," /\\");
+      Dance(A,B,C,3);
+      strcpy(A," o ");
+      strcpy(B,"^|^");
+      strcpy(C," >\\");
+      Dance(A,B,C,4);
+      strcpy(A," o ");
+      strcpy(B,"v|^");
+      strcpy(C,"/< ");
+      Dance(A,B,C,5);
+      strcpy(A," o ");
+      strcpy(B,"v|^");
+      strcpy(C," >\\");
+      Dance(A,B,C,4);
+      strcpy(A," o ");
+      strcpy(B,"|/^");
+      strcpy(C,"/< ");
+      Dance(A,B,C,3);
+      strcpy(A," o ");
+      strcpy(B,"|-|");
+      strcpy(C," >\\");
+      Dance(A,B,C,4);
+      strcpy(A," <o ");
+      strcpy(B,"//| ");
+      strcpy(C,"/<  ");
+      Dance(A,B,C,5);
+      strcpy(A,"<o> ");
+      strcpy(B," |  ");
+      strcpy(C," >//");
+      Dance(A,B,C,4);
+      strcpy(A," o> ");
+      strcpy(B," // ");
+      strcpy(C,"/<  ");
+      Dance(A,B,C,3);
+      strcpy(A," o ");
+      strcpy(B," x ");
+      strcpy(C," >\\");
+      Dance(A,B,C,4);
+      strcpy(A," o ");
+      strcpy(B,"</ ");
+      strcpy(C,"/< ");
+      Dance(A,B,C,5);
+      strcpy(A," o ");
+      strcpy(B,"<|>");
+      strcpy(C," >\\");
+      Dance(A,B,C,4);
+      strcpy(A," o ");
+      strcpy(B,"</>");
+      strcpy(C,"/< ");
+      Dance(A,B,C,3);
+      strcpy(A," o ");
+      strcpy(B,"<\\>");
+      strcpy(C," >\\");
+      Dance(A,B,C,4);
+      strcpy(A," o ");
+      strcpy(B,"<)>");
+      strcpy(C," >>");
+      Dance(A,B,C,4);
+      strcpy(A," o ");
+      strcpy(B," )\\");
+      strcpy(C," LL");
+      Dance(A,B,C,5);
+    }
+  return 0;   //  End of main program
+  }
+
+// *************************************************
+//                 Runtime Functions
+// *************************************************
+
+char *BCX_TmpStr (size_t Bites)
+{
+  static int   StrCnt;
+  static char *StrFunc[2048];
+  StrCnt=(StrCnt + 1) & 2047;
+  if(StrFunc[StrCnt]) free (StrFunc[StrCnt]);
+    #if defined BCX_MAX_VAR_SIZE
+  if(Bites*sizeof(char)>BCX_MAX_VAR_SIZE)
+  {
+  printf("Buffer Overflow caught in BCX_TmpStr - requested space of %d EXCEEDS %d\n",(int)(Bites*sizeof(char)),BCX_MAX_VAR_SIZE);
+  abort();
+  }
+  #endif
+  return StrFunc[StrCnt]=(char*)calloc(Bites+128,sizeof(char));
+}
+
+
+void locate (int row,int col,int show,int shape)
+{
+  printf("%c%s%u%s%u%s",27,"[",row,";",col,"H");
+  // find cursor size/shape function!
+}
+
+
+void cls (void)
+{
+  printf("%s%s%s%s",ESC,"[2J",ESC,"[H");
+}
+
+
+void color (int fg,int bg)
+{
+  printf("%c%s%u%s%u%s",27,"[",30+(fg&7),";",40+(bg&7),"m");
+}
+
+
+
+// ************************************
+//       User Subs and Functions
+// ************************************
+
+
+void Dance (char *A, char *B, char *C, int Dlay)
+{
+  static int     Kolor;
+  memset(&Kolor,0,sizeof(Kolor));
+  if(kbhit())
+    {
+      locate (1,1,1);
+      color (7,0);
+      cls();
+      fflush(stdout);
+      exit(0);
+    }
+  color (4,0);
+  color (6,0);
+  locate (12,33,0);
+  printf("%s\n",A);
+  color (4,0);
+  locate (13,33,0);
+  printf("%s\n",B);
+  color (9,0);
+  locate (14,33,0);
+  printf("%s\n",C);
+  sleep(Dlay*100);
+  locate (24,12,0);
+  Kolor+=1;
+  if(Kolor==0)
+    {
+      Kolor++;
+    }
+  if(Kolor==15)
+    {
+      Kolor=1;
+    }
+  color (Kolor,0);
+  printf("%s","Created Using Bcx -- The Free Basic To C Translator");
+  color (15,0);
+  locate (8,26,0);
+  printf("%s\n","Press Any Key to Quit");
+}
+
+

+ 22 - 0
Examples/Console/S00.bas

@@ -0,0 +1,22 @@
+$execon
+
+DIM K
+
+CLS
+
+FOR K = 0 TO 15
+  COLOR K,0
+  LOCATE 2+K,5,0
+  PRINT "Introducing BCX! The Basic To C Translator for Win32 by Kevin Diggins."
+NEXT
+
+COLOR 15,1
+
+LOCATE 23,28,0
+
+INPUT "Press Enter To End" , K
+
+COLOR 7,0
+
+CLS
+

+ 17 - 0
Examples/Console/S01.bas

@@ -0,0 +1,17 @@
+$execon
+
+dim a$
+
+
+a$="abcdefg"