Chaning Data Values Programmatically
BlitzPlus Forums/BlitzPlus Beginners Area/Chaning Data Values Programmatically
| ||
hi how can i change(edit) the Data values programmatically? File1.bb: graphics 800,600 setgame() function setgame() restore mydata read dat ;Why there is no Write Statement for Data values? ..... end function while not a gaming code flip cls wend include "file2.bb" ---------- File2: .mydata ;level 1 Data 1,1,1,1,,1,1, Data 2,2,2,2,2,2, Data 4,4,46,6,6,6 ;level 2 Data 1,4,1,1,,1,1, Data 2,2,9,2,2,2, Data 4,4,46,6,6,6 ;; when i run my game i want to edit the Data values so the next time when i run it i should get a new Data values (Do i have to use File statement?) |
| ||
Yes, Data statements, (and Include files) are not intended to be edited. The data from Data is stored in the executable as raw data. I'm not sure if it is compressed or anything, I have never tried to find it there. You could go for the file commands, but then still, you would need to store the values somehow to be able to edit them. So I think, you need to use an array: |
| ||
If you want to change values for sequential executions, you'll have to use an external file that you can edit to store the values. |