Advertisement
Ham62

Redim broken

May 23rd, 2018
937
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "crt.bi"
  2. Type Robot field=1
  3.     iUserRobot as Integer       'is the user's robot?
  4. End Type
  5.  
  6. Dim Shared as Integer bPal(255)
  7. Dim Shared as Robot Robot(0)
  8. Dim shared as integer iTotalRobots = 0
  9.  
  10. Sub SetupRobots()
  11.     Robot(0).iUserRobot = 1
  12.  
  13.     printf(!"%d\r\n", Robot(0).iUserRobot)
  14. End Sub
  15.  
  16.  
  17. function main as integer
  18.     var TR = 2
  19.  
  20.     ' THIS IS MAKING CHANGES IN FUNCTIONS NOT STICK!@!@!
  21.     Redim Robot(TR)
  22.  
  23.     SetupRobots()
  24.  
  25.     ' Is now zero?!?!?
  26.      printf(!"%d\r\n", Robot(0).iUserRobot)
  27.  
  28.     return 0
  29. end function
  30.  
  31. main()
  32.  
  33. sleep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement