Advertisement
NotWinlogon

visual basic more like visual blasphemy

Jun 15th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. I HATE VISUAL BASIC
  2. JUST LOOK
  3.  
  4. BASIC:
  5. ```
  6. 10 INPUT "What is your name: "; U$
  7. 20 PRINT "Hello "; U$
  8. 30 INPUT "How many stars do you want: "; N
  9. 40 S$ = ""
  10. 50 FOR I = 1 TO N
  11. 60 S$ = S$ + "*"
  12. 70 NEXT I
  13. 80 PRINT S$
  14. 90 INPUT "Do you want more stars? "; A$
  15. 100 IF LEN(A$) = 0 THEN GOTO 90
  16. 110 A$ = LEFT$(A$, 1)
  17. 120 IF A$ = "Y" OR A$ = "y" THEN GOTO 30
  18. 130 PRINT "Goodbye "; U$
  19. 140 END
  20. ```
  21.  
  22. QBasic:
  23. ```
  24. REM QuickBASIC example
  25.  
  26. REM Forward declaration - allows the main code to call a
  27. REM subroutine that is defined later in the source code
  28. DECLARE SUB PrintSomeStars (StarCount!)
  29.  
  30. REM Main program follows
  31. INPUT "What is your name: ", UserName$
  32. PRINT "Hello "; UserName$
  33. DO
  34. INPUT "How many stars do you want: ", NumStars
  35. CALL PrintSomeStars(NumStars)
  36. DO
  37. INPUT "Do you want more stars? ", Answer$
  38. LOOP UNTIL Answer$ <> ""
  39. Answer$ = LEFT$(Answer$, 1)
  40. LOOP WHILE UCASE$(Answer$) = "Y"
  41. PRINT "Goodbye "; UserName$
  42. END
  43.  
  44. REM subroutine definition
  45. SUB PrintSomeStars (StarCount)
  46. REM This procedure uses a local variable called Stars$
  47. Stars$ = STRING$(StarCount, "*")
  48. PRINT Stars$
  49. END SUB
  50. ```
  51.  
  52. meanwhile Visual Basic...
  53. ```
  54. Public Module StarsProgram
  55. Private Function Ask(prompt As String) As String
  56. Console.Write(prompt)
  57. Return Console.ReadLine()
  58. End Function
  59.  
  60. Public Sub Main()
  61. Dim userName = Ask("What is your name: ")
  62. Console.WriteLine("Hello {0}", userName)
  63.  
  64. Dim answer As String
  65.  
  66. Do
  67. Dim numStars = CInt(Ask("How many stars do you want: "))
  68. Dim stars As New String("*"c, numStars)
  69. Console.WriteLine(stars)
  70.  
  71. Do
  72. answer = Ask("Do you want more stars? ")
  73. Loop Until answer <> ""
  74. Loop While answer.StartsWith("Y", StringComparison.OrdinalIgnoreCase)
  75.  
  76. Console.WriteLine("Goodbye {0}", userName)
  77. End Sub
  78. End Module
  79. ```
  80.  
  81. this looks more like c# than basic wtf
  82. its just cursed
  83. whoever made this language is a heretic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement