Data and Variables
Blitz3D Forums/Blitz3D Beginners Area/Data and Variables| 
 | ||
| Have you ever tried putting a variable in a data section?  Something along these lines: .someLabel Data test,0,0,0,0 I was curious to see if you could do something like. Apparently not, but it does not cause the program to crash immediately. Instead it prompts the user to open a .bb file, and then crashes afterwards. Has anyone else noticed this? Why does this happen? | 
| 
 | ||
| Data fields are stored in the executable. That is why they should be constant. Basically, you can't use variables as a Data field. You could however, use a String: 
Data "test", 0, 0, 1, 0
For i = 1 To 5
   Read d$
   Select d$
   Case "test"
       val = test
   Default
       val = d$
   End Select
   Print "value:" + d$
Next
 | 
| 
 | ||
| That answers part of the question, but why would it want to open a .bb file? | 
| 
 | ||
|  but why would it want to open a .bb file?   This sort of thing has been known in various forms for years. If a Data statement is malformed then a file requester may pop up. Nobody knows why. | 
| 
 | ||
| Thanks.  I'm relatively new to programming, so I hadn't heard about that before. | 
| 
 | ||
| Yarp. Old bug. |